Home / Function/ testHandshakeFutureIsNotifiedOnChannelClose() — netty Function Reference

testHandshakeFutureIsNotifiedOnChannelClose() — netty Function Reference

Architecture documentation for the testHandshakeFutureIsNotifiedOnChannelClose() function in WebSocketHandshakeHandOverTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  a67d0487_9937_f01a_860c_76b3effb9bb7["testHandshakeFutureIsNotifiedOnChannelClose()"]
  f9cd3101_4b2b_a61c_41fe_b9876a6a0902["WebSocketHandshakeHandOverTest"]
  a67d0487_9937_f01a_860c_76b3effb9bb7 -->|defined in| f9cd3101_4b2b_a61c_41fe_b9876a6a0902
  8e12a079_6d1e_af18_a1a8_3016f84016ff["transferAllDataWithMerge()"]
  a67d0487_9937_f01a_860c_76b3effb9bb7 -->|calls| 8e12a079_6d1e_af18_a1a8_3016f84016ff
  style a67d0487_9937_f01a_860c_76b3effb9bb7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/test/java/io/netty/handler/codec/http/websocketx/WebSocketHandshakeHandOverTest.java lines 201–229

    @Test
    public void testHandshakeFutureIsNotifiedOnChannelClose() throws Exception {
        EmbeddedChannel clientChannel = createClientChannel(null);
        EmbeddedChannel serverChannel = createServerChannel(null);

        try {
            // Start handshake from client to server but don't complete the handshake for the purpose of this test.
            transferAllDataWithMerge(clientChannel, serverChannel);

            final WebSocketClientProtocolHandler clientWsHandler =
                    clientChannel.pipeline().get(WebSocketClientProtocolHandler.class);
            final WebSocketClientProtocolHandshakeHandler clientWsHandshakeHandler =
                    clientChannel.pipeline().get(WebSocketClientProtocolHandshakeHandler.class);

            final ChannelHandlerContext ctx = clientChannel.pipeline().context(WebSocketClientProtocolHandler.class);

            // Close the channel while the handshake is in progress. The channel could be closed before the handshake is
            // complete due to a number of varied reasons. To reproduce the test scenario for this test case,
            // we would manually close the channel.
            clientWsHandler.close(ctx, ctx.newPromise());

            // At this stage handshake is incomplete but the handshake future should be completed exceptionally since
            // channel is closed.
            assertTrue(clientWsHandshakeHandler.getHandshakeFuture().isDone());
        } finally {
            serverChannel.finishAndReleaseAll();
            clientChannel.finishAndReleaseAll();
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does testHandshakeFutureIsNotifiedOnChannelClose() do?
testHandshakeFutureIsNotifiedOnChannelClose() is a function in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/http/websocketx/WebSocketHandshakeHandOverTest.java.
Where is testHandshakeFutureIsNotifiedOnChannelClose() defined?
testHandshakeFutureIsNotifiedOnChannelClose() is defined in codec-http/src/test/java/io/netty/handler/codec/http/websocketx/WebSocketHandshakeHandOverTest.java at line 201.
What does testHandshakeFutureIsNotifiedOnChannelClose() call?
testHandshakeFutureIsNotifiedOnChannelClose() calls 1 function(s): transferAllDataWithMerge.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free