Home / Function/ testWebSocket00Response() — netty Function Reference

testWebSocket00Response() — netty Function Reference

Architecture documentation for the testWebSocket00Response() function in HttpClientCodecTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  29f7fe5f_6823_e031_39ef_00ec0207f917["testWebSocket00Response()"]
  c395f8e2_08a9_4e0c_820e_5851189d51c7["HttpClientCodecTest"]
  29f7fe5f_6823_e031_39ef_00ec0207f917 -->|defined in| c395f8e2_08a9_4e0c_820e_5851189d51c7
  style 29f7fe5f_6823_e031_39ef_00ec0207f917 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/test/java/io/netty/handler/codec/http/HttpClientCodecTest.java lines 311–333

    @Test
    public void testWebSocket00Response() {
        byte[] data = ("HTTP/1.1 101 WebSocket Protocol Handshake\r\n" +
                "Upgrade: WebSocket\r\n" +
                "Connection: Upgrade\r\n" +
                "Sec-WebSocket-Origin: http://localhost:8080\r\n" +
                "Sec-WebSocket-Location: ws://localhost/some/path\r\n" +
                "\r\n" +
                "1234567812345678").getBytes();
        EmbeddedChannel ch = new EmbeddedChannel(new HttpClientCodec());
        assertTrue(ch.writeInbound(Unpooled.wrappedBuffer(data)));

        HttpResponse res = ch.readInbound();
        assertSame(HttpVersion.HTTP_1_1, res.protocolVersion());
        assertEquals(HttpResponseStatus.SWITCHING_PROTOCOLS, res.status());
        HttpContent content = ch.readInbound();
        assertEquals(16, content.content().readableBytes());
        content.release();

        assertFalse(ch.finish());

        assertNull(ch.readInbound());
    }

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free