Home / Function/ testMessagesSplitBetweenMultipleBuffers() — netty Function Reference

testMessagesSplitBetweenMultipleBuffers() — netty Function Reference

Architecture documentation for the testMessagesSplitBetweenMultipleBuffers() function in HttpRequestDecoderTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  d0f2a62b_b32d_db1d_d818_398e7b5adcbd["testMessagesSplitBetweenMultipleBuffers()"]
  514322d5_436a_d1ac_6240_1f9cf42934a4["HttpRequestDecoderTest"]
  d0f2a62b_b32d_db1d_d818_398e7b5adcbd -->|defined in| 514322d5_436a_d1ac_6240_1f9cf42934a4
  style d0f2a62b_b32d_db1d_d818_398e7b5adcbd fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/test/java/io/netty/handler/codec/http/HttpRequestDecoderTest.java lines 326–355

    @Test
    public void testMessagesSplitBetweenMultipleBuffers() {
        EmbeddedChannel channel = new EmbeddedChannel(new HttpRequestDecoder());
        String crlf = "\r\n";
        String str1 = "GET /some/path HTTP/1.1" + crlf +
                "Host: localhost1" + crlf + crlf +
                "GET /some/other/path HTTP/1.0" + crlf +
                "Hos";
        String str2 = "t: localhost2" + crlf +
                "content-length: 0" + crlf + crlf;
        channel.writeInbound(Unpooled.copiedBuffer(str1, CharsetUtil.US_ASCII));
        HttpRequest req = channel.readInbound();
        assertEquals(HttpVersion.HTTP_1_1, req.protocolVersion());
        assertEquals("/some/path", req.uri());
        assertEquals(1, req.headers().size());
        assertTrue(AsciiString.contentEqualsIgnoreCase("localhost1", req.headers().get(HOST)));
        LastHttpContent cnt = channel.readInbound();
        cnt.release();

        channel.writeInbound(Unpooled.copiedBuffer(str2, CharsetUtil.US_ASCII));
        req = channel.readInbound();
        assertEquals(HttpVersion.HTTP_1_0, req.protocolVersion());
        assertEquals("/some/other/path", req.uri());
        assertEquals(2, req.headers().size());
        assertTrue(AsciiString.contentEqualsIgnoreCase("localhost2", req.headers().get(HOST)));
        assertTrue(AsciiString.contentEqualsIgnoreCase("0", req.headers().get(HttpHeaderNames.CONTENT_LENGTH)));
        cnt = channel.readInbound();
        cnt.release();
        assertFalse(channel.finishAndReleaseAll());
    }

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free