Skip to content

Commit 6ef3cb1

Browse files
committed
PAYARA-2399 Add Tyrus client dependencies to Micro profile, and use @RunAsClient
1 parent 82f56bd commit 6ef3cb1

File tree

9 files changed

+46
-8
lines changed

9 files changed

+46
-8
lines changed

pom.xml

+14
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,20 @@
442442
<version>1.0.Beta3-m1</version>
443443
<scope>test</scope>
444444
</dependency>
445+
446+
<!-- WebSocket client dependencies -->
447+
<dependency>
448+
<groupId>org.glassfish.tyrus</groupId>
449+
<artifactId>tyrus-client</artifactId>
450+
<version>1.13</version>
451+
<scope>test</scope>
452+
</dependency>
453+
<dependency>
454+
<groupId>org.glassfish.tyrus</groupId>
455+
<artifactId>tyrus-container-grizzly-client</artifactId>
456+
<version>1.13</version>
457+
<scope>test</scope>
458+
</dependency>
445459
</dependencies>
446460

447461
<build>

websocket/binary/src/test/java/org/javaee7/websocket/binary/test/MyEndpointTest.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import org.javaee7.websocket.binary.MyEndpointClient;
2121
import org.javaee7.websocket.binary.MyEndpointInputStream;
2222
import org.jboss.arquillian.container.test.api.Deployment;
23+
import org.jboss.arquillian.container.test.api.RunAsClient;
2324
import org.jboss.arquillian.junit.Arquillian;
2425
import org.jboss.arquillian.test.api.ArquillianResource;
2526
import org.jboss.shrinkwrap.api.ShrinkWrap;
@@ -43,7 +44,7 @@ public class MyEndpointTest {
4344
* Arquillian specific method for creating a file which can be deployed
4445
* while executing the test.
4546
*/
46-
@Deployment(testable = false)
47+
@Deployment
4748
public static WebArchive createDeployment() {
4849
return ShrinkWrap.create(WebArchive.class)
4950
.addClasses(MyEndpointByteBuffer.class,
@@ -60,6 +61,7 @@ public static WebArchive createDeployment() {
6061
* @throws IOException
6162
*/
6263
@Test
64+
@RunAsClient
6365
public void testEndpointByteBuffer() throws URISyntaxException, DeploymentException, IOException, InterruptedException {
6466
MyEndpointClient.latch = new CountDownLatch(1);
6567
Session session = connectToServer("bytebuffer");
@@ -79,6 +81,7 @@ public void testEndpointByteBuffer() throws URISyntaxException, DeploymentExcept
7981
* @throws URISyntaxException
8082
*/
8183
@Test
84+
@RunAsClient
8285
public void testEndpointByteArray() throws DeploymentException, IOException, URISyntaxException, InterruptedException {
8386
MyEndpointClient.latch = new CountDownLatch(1);
8487
Session session = connectToServer("bytearray");
@@ -98,6 +101,7 @@ public void testEndpointByteArray() throws DeploymentException, IOException, URI
98101
* @throws URISyntaxException
99102
*/
100103
@Test
104+
@RunAsClient
101105
public void testEndpointInputStream() throws DeploymentException, IOException, URISyntaxException, InterruptedException {
102106
MyEndpointClient.latch = new CountDownLatch(1);
103107
Session session = connectToServer("inputstream");

websocket/chat/src/test/java/org/javaee7/websocket/chat/ChatTest.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import javax.websocket.Session;
1111
import javax.websocket.WebSocketContainer;
1212
import org.jboss.arquillian.container.test.api.Deployment;
13+
import org.jboss.arquillian.container.test.api.RunAsClient;
1314
import org.jboss.arquillian.junit.Arquillian;
1415
import org.jboss.arquillian.test.api.ArquillianResource;
1516
import org.jboss.shrinkwrap.api.ShrinkWrap;
@@ -27,7 +28,7 @@ public class ChatTest {
2728
@ArquillianResource
2829
URI base;
2930

30-
@Deployment(testable = false)
31+
@Deployment()
3132
public static WebArchive createDeployment() {
3233
return ShrinkWrap.create(WebArchive.class)
3334
.addClasses(ChatEndpoint.class,
@@ -36,6 +37,7 @@ public static WebArchive createDeployment() {
3637
}
3738

3839
@Test
40+
@RunAsClient
3941
public void testConnect() throws URISyntaxException, DeploymentException, IOException, InterruptedException {
4042
ChatClientEndpoint1.latch = new CountDownLatch(1);
4143
final Session session1 = connectToServer(ChatClientEndpoint1.class);

websocket/encoder-client/src/test/java/org/javaee7/websocket/encoder/client/MyClientTest.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import javax.websocket.WebSocketContainer;
1616

1717
import org.jboss.arquillian.container.test.api.Deployment;
18+
import org.jboss.arquillian.container.test.api.RunAsClient;
1819
import org.jboss.arquillian.junit.Arquillian;
1920
import org.jboss.arquillian.test.api.ArquillianResource;
2021
import org.jboss.shrinkwrap.api.ShrinkWrap;
@@ -34,7 +35,7 @@ public class MyClientTest {
3435
* Arquillian specific method for creating a file which can be deployed
3536
* while executing the test.
3637
*/
37-
@Deployment(testable = false)
38+
@Deployment
3839
public static WebArchive createDeployment() {
3940
return ShrinkWrap.create(WebArchive.class)
4041
.addClasses(MyEndpoint.class,
@@ -44,6 +45,7 @@ public static WebArchive createDeployment() {
4445
}
4546

4647
@Test
48+
@RunAsClient
4749
public void testEndpoint() throws URISyntaxException, DeploymentException, IOException, InterruptedException {
4850
String JSON = "{\"apple\":\"red\",\"banana\":\"yellow\"}";
4951
Session session = connectToServer(MyClient.class);

websocket/encoder-programmatic/src/test/java/org/javaee7/websocket/encoder/programmatic/MyClientTest.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import javax.websocket.WebSocketContainer;
1616

1717
import org.jboss.arquillian.container.test.api.Deployment;
18+
import org.jboss.arquillian.container.test.api.RunAsClient;
1819
import org.jboss.arquillian.junit.Arquillian;
1920
import org.jboss.arquillian.test.api.ArquillianResource;
2021
import org.jboss.shrinkwrap.api.ShrinkWrap;
@@ -30,7 +31,7 @@ public class MyClientTest {
3031
@ArquillianResource
3132
URI base;
3233

33-
@Deployment(testable = false)
34+
@Deployment
3435
public static WebArchive createDeployment() {
3536
return ShrinkWrap.create(WebArchive.class)
3637
.addClasses(MyEndpoint.class,
@@ -41,6 +42,7 @@ public static WebArchive createDeployment() {
4142
}
4243

4344
@Test
45+
@RunAsClient
4446
public void testEndpoint() throws URISyntaxException, DeploymentException, IOException, InterruptedException {
4547
final String JSON = "{\"apple\":\"red\",\"banana\":\"yellow\"}";
4648
Session session = connectToServer(MyClient.class);

websocket/encoder/src/test/java/org/javaee7/websocket/encoder/EncoderEndpointTest.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import javax.websocket.WebSocketContainer;
1616

1717
import org.jboss.arquillian.container.test.api.Deployment;
18+
import org.jboss.arquillian.container.test.api.RunAsClient;
1819
import org.jboss.arquillian.junit.Arquillian;
1920
import org.jboss.arquillian.test.api.ArquillianResource;
2021
import org.jboss.shrinkwrap.api.ShrinkWrap;
@@ -36,7 +37,7 @@ public class EncoderEndpointTest {
3637
* Arquillian specific method for creating a file which can be deployed
3738
* while executing the test.
3839
*/
39-
@Deployment(testable = false)
40+
@Deployment
4041
public static WebArchive createDeployment() {
4142
return ShrinkWrap.create(WebArchive.class)
4243
.addClasses(MyEndpoint.class,
@@ -46,6 +47,7 @@ public static WebArchive createDeployment() {
4647
}
4748

4849
@Test
50+
@RunAsClient
4951
public void testEndpointEmptyJSONArray() throws URISyntaxException, DeploymentException, IOException, InterruptedException {
5052
final Session session = connectToServer(MyEndpointClientEmptyJSONArray.class);
5153
assertNotNull(session);
@@ -54,6 +56,7 @@ public void testEndpointEmptyJSONArray() throws URISyntaxException, DeploymentEx
5456
}
5557

5658
@Test
59+
@RunAsClient
5760
public void testEndpointEmptyJSONObject() throws URISyntaxException, DeploymentException, IOException, InterruptedException {
5861
String JSON = "{\"apple\":\"red\",\"banana\":\"yellow\"}";
5962
Session session = connectToServer(MyEndpointClientJSONObject.class);

websocket/endpoint-async/src/test/java/org/javaee7/websocket/endpoint/async/MyAsyncEndpointTest.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import static com.jayway.awaitility.Awaitility.*;
2020
import static org.hamcrest.Matchers.*;
2121
import static org.hamcrest.MatcherAssert.*;
22+
import org.jboss.arquillian.container.test.api.RunAsClient;
2223

2324
/**
2425
*
@@ -32,14 +33,15 @@ public class MyAsyncEndpointTest {
3233
@ArquillianResource
3334
private URL base;
3435

35-
@Deployment(testable = false)
36+
@Deployment
3637
public static WebArchive deploy() throws URISyntaxException {
3738
return ShrinkWrap.create(WebArchive.class)
3839
.addClass(MyAsyncEndpointText.class)
3940
.addClass(MyAsyncEndpointByteBuffer.class);
4041
}
4142

4243
@Test
44+
@RunAsClient
4345
public void shouldReceiveAsyncTextMessage() throws URISyntaxException, IOException, DeploymentException {
4446
MyAsyncEndpointTextClient endpoint = new MyAsyncEndpointTextClient();
4547
Session session = connectToEndpoint(endpoint, "text");
@@ -50,6 +52,7 @@ public void shouldReceiveAsyncTextMessage() throws URISyntaxException, IOExcepti
5052
}
5153

5254
@Test
55+
@RunAsClient
5356
public void shouldReceiveAsyncByteBufferMessage() throws URISyntaxException, IOException, DeploymentException {
5457
final ByteBuffer buffer = ByteBuffer.wrap(TEST_MESSAGE.getBytes());
5558
MyAsyncEndpointByteBufferClient endpoint = new MyAsyncEndpointByteBufferClient();

websocket/endpoint-programmatic/src/test/java/org/javaee7/websocket/endpoint/programmatic/MyEndpointTest.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import javax.websocket.Session;
1313
import javax.websocket.WebSocketContainer;
1414
import org.jboss.arquillian.container.test.api.Deployment;
15+
import org.jboss.arquillian.container.test.api.RunAsClient;
1516
import org.jboss.arquillian.junit.Arquillian;
1617
import org.jboss.arquillian.test.api.ArquillianResource;
1718
import org.jboss.shrinkwrap.api.ShrinkWrap;
@@ -31,7 +32,7 @@ public class MyEndpointTest {
3132
@ArquillianResource
3233
URI base;
3334

34-
@Deployment(testable = false)
35+
@Deployment
3536
public static WebArchive createDeployment() {
3637
return ShrinkWrap.create(WebArchive.class)
3738
.addClasses(MyEndpoint.class,
@@ -41,6 +42,7 @@ public static WebArchive createDeployment() {
4142
}
4243

4344
@Test
45+
@RunAsClient
4446
public void testTextEndpoint() throws URISyntaxException, DeploymentException, IOException, InterruptedException {
4547
MyEndpointTextClient.latch = new CountDownLatch(1);
4648
final String TEXT = "Hello World!";
@@ -56,6 +58,7 @@ public void onMessage(String text) {
5658
}
5759

5860
@Test
61+
@RunAsClient
5962
public void testBinaryEndpoint() throws URISyntaxException, DeploymentException, IOException, InterruptedException {
6063
MyEndpointBinaryClient.latch = new CountDownLatch(1);
6164
final String TEXT = "Hello World!";

websocket/endpoint/src/test/java/org/javaee7/websocket/endpoint/MyEndpointTest.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import javax.websocket.WebSocketContainer;
1818

1919
import org.jboss.arquillian.container.test.api.Deployment;
20+
import org.jboss.arquillian.container.test.api.RunAsClient;
2021
import org.jboss.arquillian.junit.Arquillian;
2122
import org.jboss.arquillian.test.api.ArquillianResource;
2223
import org.jboss.shrinkwrap.api.ShrinkWrap;
@@ -34,7 +35,7 @@ public class MyEndpointTest {
3435
@ArquillianResource
3536
URI base;
3637

37-
@Deployment(testable = false)
38+
@Deployment
3839
public static WebArchive createDeployment() {
3940
return ShrinkWrap.create(WebArchive.class)
4041
.addClasses(MyEndpointText.class,
@@ -48,6 +49,7 @@ public static WebArchive createDeployment() {
4849
}
4950

5051
@Test
52+
@RunAsClient
5153
public void testTextEndpoint() throws URISyntaxException, DeploymentException, IOException, InterruptedException {
5254
MyEndpointTextClient.latch = new CountDownLatch(1);
5355
Session session = connectToServer(MyEndpointTextClient.class, "text");
@@ -57,6 +59,7 @@ public void testTextEndpoint() throws URISyntaxException, DeploymentException, I
5759
}
5860

5961
@Test
62+
@RunAsClient
6063
public void testEndpointByteBuffer() throws URISyntaxException, DeploymentException, IOException, InterruptedException {
6164
MyEndpointByteBufferClient.latch = new CountDownLatch(1);
6265
Session session = connectToServer(MyEndpointByteBufferClient.class, "bytebuffer");
@@ -66,6 +69,7 @@ public void testEndpointByteBuffer() throws URISyntaxException, DeploymentExcept
6669
}
6770

6871
@Test
72+
@RunAsClient
6973
public void testEndpointByteArray() throws DeploymentException, IOException, URISyntaxException, InterruptedException {
7074
MyEndpointByteArrayClient.latch = new CountDownLatch(1);
7175
Session session = connectToServer(MyEndpointByteArrayClient.class, "bytearray");
@@ -76,6 +80,7 @@ public void testEndpointByteArray() throws DeploymentException, IOException, URI
7680
}
7781

7882
@Test
83+
@RunAsClient
7984
public void testEndpointInputStream() throws DeploymentException, IOException, URISyntaxException, InterruptedException {
8085
MyEndpointInputStreamClient.latch = new CountDownLatch(1);
8186
Session session = connectToServer(MyEndpointInputStreamClient.class, "inputstream");

0 commit comments

Comments
 (0)