@Test
public void testTextEndpoint() throws URISyntaxException, DeploymentException, IOException, InterruptedException {
MyEndpointTextClient.latch = new CountDownLatch(1);
final String TEXT = "Hello World!";
Session session = connectToServer(MyEndpointTextClient.class);
assertNotNull(session);
session.addMessageHandler(new MessageHandler.Whole<String>() {
@Override
public void onMessage(String text) {
assertEquals(TEXT, text);
}
});
assertTrue(MyEndpointTextClient.latch.await(2, TimeUnit.SECONDS));
}