Home / Function/ testExplicitCloseFrameSentWhenClientChannelClosed() — netty Function Reference

testExplicitCloseFrameSentWhenClientChannelClosed() — netty Function Reference

Architecture documentation for the testExplicitCloseFrameSentWhenClientChannelClosed() function in WebSocketServerProtocolHandlerTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  0b110db9_e397_adf7_0f58_62b2949fea29["testExplicitCloseFrameSentWhenClientChannelClosed()"]
  7afc952d_7109_096b_f81d_bf3293e37581["WebSocketServerProtocolHandlerTest"]
  0b110db9_e397_adf7_0f58_62b2949fea29 -->|defined in| 7afc952d_7109_096b_f81d_bf3293e37581
  style 0b110db9_e397_adf7_0f58_62b2949fea29 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/test/java/io/netty/handler/codec/http/websocketx/WebSocketServerProtocolHandlerTest.java lines 353–377

    @Test
    public void testExplicitCloseFrameSentWhenClientChannelClosed() throws Exception {
        WebSocketCloseStatus closeStatus = WebSocketCloseStatus.INVALID_PAYLOAD_DATA;
        EmbeddedChannel client = createClient();
        EmbeddedChannel server = createServer();

        assertFalse(server.writeInbound(client.<ByteBuf>readOutbound()));
        assertFalse(client.writeInbound(server.<ByteBuf>readOutbound()));

        // When client channel closed with explicit close-frame
        assertTrue(client.writeOutbound(new CloseWebSocketFrame(closeStatus)));
        client.close();

        // Then client receives provided close-frame
        assertFalse(server.writeInbound(client.<ByteBuf>readOutbound()));
        assertFalse(client.isOpen());
        assertFalse(server.isOpen());

        CloseWebSocketFrame closeMessage = decode(server.<ByteBuf>readOutbound(), CloseWebSocketFrame.class);
        assertEquals(closeMessage.statusCode(), closeStatus.code());
        closeMessage.release();

        assertFalse(client.finishAndReleaseAll());
        assertFalse(server.finishAndReleaseAll());
    }

Domain

Subdomains

Frequently Asked Questions

What does testExplicitCloseFrameSentWhenClientChannelClosed() do?
testExplicitCloseFrameSentWhenClientChannelClosed() is a function in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/http/websocketx/WebSocketServerProtocolHandlerTest.java.
Where is testExplicitCloseFrameSentWhenClientChannelClosed() defined?
testExplicitCloseFrameSentWhenClientChannelClosed() is defined in codec-http/src/test/java/io/netty/handler/codec/http/websocketx/WebSocketServerProtocolHandlerTest.java at line 353.

Analyze Your Own Codebase

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

Try Supermodel Free