Search in sources :

Example 16 with SendResult

use of javax.websocket.SendResult in project atmosphere by Atmosphere.

the class JSR356WebSocketTest method test_semaphore_is_released_in_case_of_successful_write.

@Test(timeOut = 1000)
public void test_semaphore_is_released_in_case_of_successful_write() throws Exception {
    mockWriteResult(new SendResult());
    webSocket.write("Hello");
    webSocket.write("Hello");
    verify(asyncRemoteEndpoint, times(2)).sendText(eq("Hello"), any(SendHandler.class));
}
Also used : SendHandler(javax.websocket.SendHandler) SendResult(javax.websocket.SendResult) Test(org.testng.annotations.Test)

Aggregations

SendResult (javax.websocket.SendResult)16 IOException (java.io.IOException)7 SendHandler (javax.websocket.SendHandler)7 ByteBuffer (java.nio.ByteBuffer)5 URI (java.net.URI)4 Session (javax.websocket.Session)4 Test (org.junit.Test)4 ServerWebSocketContainer (io.undertow.websockets.jsr.ServerWebSocketContainer)2 UndertowSession (io.undertow.websockets.jsr.UndertowSession)2 AnnotatedClientEndpoint (io.undertow.websockets.jsr.test.annotated.AnnotatedClientEndpoint)2 FrameChecker (io.undertow.websockets.utils.FrameChecker)2 WebSocketTestClient (io.undertow.websockets.utils.WebSocketTestClient)2 SocketTimeoutException (java.net.SocketTimeoutException)2 CountDownLatch (java.util.concurrent.CountDownLatch)2 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)2 AtomicReference (java.util.concurrent.atomic.AtomicReference)2 ClientEndpointConfig (javax.websocket.ClientEndpointConfig)2 EncodeException (javax.websocket.EncodeException)2 Encoder (javax.websocket.Encoder)2 Endpoint (javax.websocket.Endpoint)2