Skip to content

Commit f61f065

Browse files
committed
Fixing the tests
1 parent e8bd4d7 commit f61f065

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

websocket/endpoint-programmatic/src/main/java/org/javaee7/websocket/endpoint/programmatic/MyEndpointBinaryClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
@ClientEndpoint
1515
public class MyEndpointBinaryClient {
16-
public static CountDownLatch latch= new CountDownLatch(2);
16+
public static CountDownLatch latch;
1717
public static byte[] response;
1818

1919
@OnOpen

websocket/endpoint-programmatic/src/main/java/org/javaee7/websocket/endpoint/programmatic/MyEndpointTextClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
@ClientEndpoint
1414
public class MyEndpointTextClient {
15-
public static CountDownLatch latch= new CountDownLatch(2);
15+
public static CountDownLatch latch;
1616
public static byte[] response;
1717

1818
@OnOpen

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import java.net.URI;
55
import java.net.URISyntaxException;
66
import java.nio.ByteBuffer;
7+
import java.util.concurrent.CountDownLatch;
78
import java.util.concurrent.TimeUnit;
89
import javax.websocket.ContainerProvider;
910
import javax.websocket.DeploymentException;
@@ -41,6 +42,7 @@ public static WebArchive createDeployment() {
4142

4243
@Test
4344
public void testTextEndpoint() throws URISyntaxException, DeploymentException, IOException, InterruptedException {
45+
MyEndpointTextClient.latch = new CountDownLatch(1);
4446
final String TEXT = "Hello World!";
4547
Session session = connectToServer(MyEndpointTextClient.class);
4648
assertNotNull(session);
@@ -55,6 +57,7 @@ public void onMessage(String text) {
5557

5658
@Test
5759
public void testBinaryEndpoint() throws URISyntaxException, DeploymentException, IOException, InterruptedException {
60+
MyEndpointBinaryClient.latch = new CountDownLatch(1);
5861
final String TEXT = "Hello World!";
5962
Session session = connectToServer(MyEndpointBinaryClient.class);
6063
assertNotNull(session);

0 commit comments

Comments
 (0)