Home / Function/ testEmptyContents() — netty Function Reference

testEmptyContents() — netty Function Reference

Architecture documentation for the testEmptyContents() function in HttpRequestEncoderTest.java from the netty codebase.

Function java Buffer Allocators calls 1 called by 4

Entity Profile

Dependency Diagram

graph TD
  ca6aa875_f918_0e38_8559_e3f565ec0e70["testEmptyContents()"]
  fcb9abc3_d47c_ca31_1af5_a7b8b31112c3["HttpRequestEncoderTest"]
  ca6aa875_f918_0e38_8559_e3f565ec0e70 -->|defined in| fcb9abc3_d47c_ca31_1af5_a7b8b31112c3
  1673ea61_acf9_6202_8245_ed5d448c80b0["testEmptyContentsChunked()"]
  1673ea61_acf9_6202_8245_ed5d448c80b0 -->|calls| ca6aa875_f918_0e38_8559_e3f565ec0e70
  e8ea47d6_babd_2f56_93a1_78bf70240191["testEmptyContentsChunkedWithTrailers()"]
  e8ea47d6_babd_2f56_93a1_78bf70240191 -->|calls| ca6aa875_f918_0e38_8559_e3f565ec0e70
  19628d7d_9483_a452_c47c_230e8a4c162b["testEmptyContentsNotChunked()"]
  19628d7d_9483_a452_c47c_230e8a4c162b -->|calls| ca6aa875_f918_0e38_8559_e3f565ec0e70
  d3895e15_de41_03fb_dce7_a4bf120eaa7d["testEmptyContentNotsChunkedWithTrailers()"]
  d3895e15_de41_03fb_dce7_a4bf120eaa7d -->|calls| ca6aa875_f918_0e38_8559_e3f565ec0e70
  ef6ea20f_1d89_e7fb_ed43_ea8b34830807["release()"]
  ca6aa875_f918_0e38_8559_e3f565ec0e70 -->|calls| ef6ea20f_1d89_e7fb_ed43_ea8b34830807
  style ca6aa875_f918_0e38_8559_e3f565ec0e70 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/test/java/io/netty/handler/codec/http/HttpRequestEncoderTest.java lines 311–340

    private void testEmptyContents(boolean chunked, boolean trailers) throws Exception {
        HttpRequestEncoder encoder = new HttpRequestEncoder();
        EmbeddedChannel channel = new EmbeddedChannel(encoder);
        HttpRequest request = new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.POST, "/");
        if (chunked) {
            HttpUtil.setTransferEncodingChunked(request, true);
        }
        assertTrue(channel.writeOutbound(request));

        ByteBuf contentBuffer = Unpooled.buffer();
        assertTrue(channel.writeOutbound(new DefaultHttpContent(contentBuffer)));

        ByteBuf lastContentBuffer = Unpooled.buffer();
        LastHttpContent last = new DefaultLastHttpContent(lastContentBuffer);
        if (trailers) {
            last.trailingHeaders().set("X-Netty-Test", "true");
        }
        assertTrue(channel.writeOutbound(last));

        // Ensure we only produce ByteBuf instances.
        ByteBuf head = channel.readOutbound();
        assertTrue(head.release());

        ByteBuf content = channel.readOutbound();
        content.release();

        ByteBuf lastContent = channel.readOutbound();
        lastContent.release();
        assertFalse(channel.finish());
    }

Domain

Subdomains

Calls

Frequently Asked Questions

What does testEmptyContents() do?
testEmptyContents() is a function in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpRequestEncoderTest.java.
Where is testEmptyContents() defined?
testEmptyContents() is defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpRequestEncoderTest.java at line 311.
What does testEmptyContents() call?
testEmptyContents() calls 1 function(s): release.
What calls testEmptyContents()?
testEmptyContents() is called by 4 function(s): testEmptyContentNotsChunkedWithTrailers, testEmptyContentsChunked, testEmptyContentsChunkedWithTrailers, testEmptyContentsNotChunked.

Analyze Your Own Codebase

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

Try Supermodel Free