Home / Function/ testSplitContent() — netty Function Reference

testSplitContent() — netty Function Reference

Architecture documentation for the testSplitContent() function in HttpContentEncoderTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  a711fd23_c773_fc6a_dcc6_319f8cc94234["testSplitContent()"]
  992a26d3_2083_aeb8_4785_63c545814355["HttpContentEncoderTest"]
  a711fd23_c773_fc6a_dcc6_319f8cc94234 -->|defined in| 992a26d3_2083_aeb8_4785_63c545814355
  0a866c5b_d089_2acd_5353_fc5ee08af6b5["assertEncodedResponse()"]
  a711fd23_c773_fc6a_dcc6_319f8cc94234 -->|calls| 0a866c5b_d089_2acd_5353_fc5ee08af6b5
  style a711fd23_c773_fc6a_dcc6_319f8cc94234 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/test/java/io/netty/handler/codec/http/HttpContentEncoderTest.java lines 59–90

    @Test
    public void testSplitContent() throws Exception {
        EmbeddedChannel ch = new EmbeddedChannel(new TestEncoder());
        ch.writeInbound(new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/"));

        ch.writeOutbound(new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK));
        ch.writeOutbound(new DefaultHttpContent(Unpooled.wrappedBuffer(new byte[3])));
        ch.writeOutbound(new DefaultHttpContent(Unpooled.wrappedBuffer(new byte[2])));
        ch.writeOutbound(new DefaultLastHttpContent(Unpooled.wrappedBuffer(new byte[1])));

        assertEncodedResponse(ch);

        HttpContent chunk;
        chunk = ch.readOutbound();
        assertEquals("3", chunk.content().toString(CharsetUtil.US_ASCII));
        chunk.release();

        chunk = ch.readOutbound();
        assertEquals("2", chunk.content().toString(CharsetUtil.US_ASCII));
        chunk.release();

        chunk = ch.readOutbound();
        assertEquals("1", chunk.content().toString(CharsetUtil.US_ASCII));
        chunk.release();

        chunk = ch.readOutbound();
        assertFalse(chunk.content().isReadable());
        assertInstanceOf(LastHttpContent.class, chunk);
        chunk.release();

        assertNull(ch.readOutbound());
    }

Domain

Subdomains

Frequently Asked Questions

What does testSplitContent() do?
testSplitContent() is a function in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpContentEncoderTest.java.
Where is testSplitContent() defined?
testSplitContent() is defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpContentEncoderTest.java at line 59.
What does testSplitContent() call?
testSplitContent() calls 1 function(s): assertEncodedResponse.

Analyze Your Own Codebase

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

Try Supermodel Free