@Test(timeOut = 60000) public void sendPongMessage() throws Exception { try (AsyncHttpClient c = asyncHttpClient()) { getWebSocket(c).sendPongFrame("PONG".getBytes()).get(10, TimeUnit.SECONDS); } }
@Test(timeOut = 60000, expectedExceptions = ExecutionException.class) public void sendPongMessageExpectFailure() throws Exception { try (AsyncHttpClient c = asyncHttpClient()) { CountDownLatch closeLatch = new CountDownLatch(1); WebSocket websocket = getWebSocket(c, closeLatch); websocket.sendCloseFrame(); closeLatch.await(1, TimeUnit.SECONDS); websocket.sendPongFrame("PONG".getBytes()).get(1, TimeUnit.SECONDS); } }