Home / Function/ testStatusResetContentTransferContentLength0() — netty Function Reference

testStatusResetContentTransferContentLength0() — netty Function Reference

Architecture documentation for the testStatusResetContentTransferContentLength0() function in HttpResponseEncoderTest.java from the netty codebase.

Function java Buffer Allocators calls 1 called by 2

Entity Profile

Dependency Diagram

graph TD
  4fca1c82_1e4f_bdd6_d4dc_23a403f0664f["testStatusResetContentTransferContentLength0()"]
  9235a1ad_cba8_50c2_25b1_57ce61f5b623["HttpResponseEncoderTest"]
  4fca1c82_1e4f_bdd6_d4dc_23a403f0664f -->|defined in| 9235a1ad_cba8_50c2_25b1_57ce61f5b623
  4109b1c8_bc6f_1df6_23eb_23c7c853eba7["testStatusResetContentTransferContentLength()"]
  4109b1c8_bc6f_1df6_23eb_23c7c853eba7 -->|calls| 4fca1c82_1e4f_bdd6_d4dc_23a403f0664f
  1149fd42_0284_1bac_8ff0_097eb333ee9a["testStatusResetContentTransferEncoding()"]
  1149fd42_0284_1bac_8ff0_097eb333ee9a -->|calls| 4fca1c82_1e4f_bdd6_d4dc_23a403f0664f
  dc0150e4_fa1e_faa8_3643_9c1860fad9ee["release()"]
  4fca1c82_1e4f_bdd6_d4dc_23a403f0664f -->|calls| dc0150e4_fa1e_faa8_3643_9c1860fad9ee
  style 4fca1c82_1e4f_bdd6_d4dc_23a403f0664f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/test/java/io/netty/handler/codec/http/HttpResponseEncoderTest.java lines 369–401

    private static void testStatusResetContentTransferContentLength0(CharSequence headerName, ByteBuf content) {
        EmbeddedChannel channel = new EmbeddedChannel(new HttpResponseEncoder());

        HttpResponse response = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.RESET_CONTENT);
        if (HttpHeaderNames.CONTENT_LENGTH.contentEqualsIgnoreCase(headerName)) {
            response.headers().set(HttpHeaderNames.CONTENT_LENGTH, content.readableBytes());
        } else {
            response.headers().set(HttpHeaderNames.TRANSFER_ENCODING, HttpHeaderValues.CHUNKED);
        }

        assertTrue(channel.writeOutbound(response));
        assertTrue(channel.writeOutbound(new DefaultHttpContent(content)));
        assertTrue(channel.writeOutbound(LastHttpContent.EMPTY_LAST_CONTENT));

        StringBuilder responseText = new StringBuilder();
        responseText.append(HttpVersion.HTTP_1_1).append(' ')
                .append(HttpResponseStatus.RESET_CONTENT).append("\r\n");
        responseText.append(HttpHeaderNames.CONTENT_LENGTH).append(": 0\r\n");
        responseText.append("\r\n");

        StringBuilder written = new StringBuilder();
        for (;;) {
            ByteBuf buffer = channel.readOutbound();
            if (buffer == null) {
                break;
            }
            written.append(buffer.toString(CharsetUtil.US_ASCII));
            buffer.release();
        }

        assertEquals(responseText.toString(), written.toString());
        assertFalse(channel.finish());
    }

Domain

Subdomains

Calls

Frequently Asked Questions

What does testStatusResetContentTransferContentLength0() do?
testStatusResetContentTransferContentLength0() is a function in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpResponseEncoderTest.java.
Where is testStatusResetContentTransferContentLength0() defined?
testStatusResetContentTransferContentLength0() is defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpResponseEncoderTest.java at line 369.
What does testStatusResetContentTransferContentLength0() call?
testStatusResetContentTransferContentLength0() calls 1 function(s): release.
What calls testStatusResetContentTransferContentLength0()?
testStatusResetContentTransferContentLength0() is called by 2 function(s): testStatusResetContentTransferContentLength, testStatusResetContentTransferEncoding.

Analyze Your Own Codebase

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

Try Supermodel Free