@Test
public void testConnect() throws URISyntaxException, DeploymentException, IOException, InterruptedException {
ChatClientEndpoint1.latch = new CountDownLatch(1);
final Session session1 = connectToServer(ChatClientEndpoint1.class);
assertNotNull(session1);
assertTrue(ChatClientEndpoint1.latch.await(2, TimeUnit.SECONDS));
assertEquals(ChatClientEndpoint1.TEXT, ChatClientEndpoint1.response);
ChatClientEndpoint1.latch = new CountDownLatch(1);
ChatClientEndpoint2.latch = new CountDownLatch(1);
final Session session2 = connectToServer(ChatClientEndpoint2.class);
assertNotNull(session2);
assertTrue(ChatClientEndpoint1.latch.await(2, TimeUnit.SECONDS));
assertTrue(ChatClientEndpoint2.latch.await(2, TimeUnit.SECONDS));
assertEquals(ChatClientEndpoint2.TEXT, ChatClientEndpoint1.response);
assertEquals(ChatClientEndpoint2.TEXT, ChatClientEndpoint2.response);
}