Home / Function/ testUnfinishedChunkedHttpRequestIsLastFlag() — netty Function Reference

testUnfinishedChunkedHttpRequestIsLastFlag() — netty Function Reference

Architecture documentation for the testUnfinishedChunkedHttpRequestIsLastFlag() function in HttpServerCodecTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  abdadbbe_406f_1f8c_7839_ccce79f4a683["testUnfinishedChunkedHttpRequestIsLastFlag()"]
  b6cdc8d3_b482_5921_941d_6401914d1c4f["HttpServerCodecTest"]
  abdadbbe_406f_1f8c_7839_ccce79f4a683 -->|defined in| b6cdc8d3_b482_5921_941d_6401914d1c4f
  style abdadbbe_406f_1f8c_7839_ccce79f4a683 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/test/java/io/netty/handler/codec/http/HttpServerCodecTest.java lines 35–69

    @Test
    public void testUnfinishedChunkedHttpRequestIsLastFlag() throws Exception {

        int maxChunkSize = 2000;
        HttpServerCodec httpServerCodec = new HttpServerCodec(1000, 1000, maxChunkSize);
        EmbeddedChannel decoderEmbedder = new EmbeddedChannel(httpServerCodec);

        int totalContentLength = maxChunkSize * 5;
        decoderEmbedder.writeInbound(Unpooled.copiedBuffer(
                "PUT /test HTTP/1.1\r\n" +
                "Content-Length: " + totalContentLength + "\r\n" +
                "\r\n", CharsetUtil.UTF_8));

        int offeredContentLength = (int) (maxChunkSize * 2.5);
        decoderEmbedder.writeInbound(prepareDataChunk(offeredContentLength));
        decoderEmbedder.finish();

        HttpMessage httpMessage = decoderEmbedder.readInbound();
        assertNotNull(httpMessage);

        boolean empty = true;
        int totalBytesPolled = 0;
        for (;;) {
            HttpContent httpChunk = decoderEmbedder.readInbound();
            if (httpChunk == null) {
                break;
            }
            empty = false;
            totalBytesPolled += httpChunk.content().readableBytes();
            assertFalse(httpChunk instanceof LastHttpContent);
            httpChunk.release();
        }
        assertFalse(empty);
        assertEquals(offeredContentLength, totalBytesPolled);
    }

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free