testClosureWithoutContentLength2() — netty Function Reference
Architecture documentation for the testClosureWithoutContentLength2() function in HttpResponseDecoderTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 1adad348_9748_1739_c0c7_446d4bac41ba["testClosureWithoutContentLength2()"] 90546a8c_51c4_a9dc_b6e8_695d29269596["HttpResponseDecoderTest"] 1adad348_9748_1739_c0c7_446d4bac41ba -->|defined in| 90546a8c_51c4_a9dc_b6e8_695d29269596 style 1adad348_9748_1739_c0c7_446d4bac41ba fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
codec-http/src/test/java/io/netty/handler/codec/http/HttpResponseDecoderTest.java lines 415–445
@Test
public void testClosureWithoutContentLength2() throws Exception {
EmbeddedChannel ch = new EmbeddedChannel(new HttpResponseDecoder());
// Write the partial response.
ch.writeInbound(Unpooled.copiedBuffer("HTTP/1.1 200 OK\r\n\r\n12345678", CharsetUtil.US_ASCII));
// Read the response headers.
HttpResponse res = ch.readInbound();
assertSame(HttpVersion.HTTP_1_1, res.protocolVersion());
assertEquals(HttpResponseStatus.OK, res.status());
// Read the partial content.
HttpContent content = ch.readInbound();
assertEquals("12345678", content.content().toString(CharsetUtil.US_ASCII));
assertThat(content).isNotInstanceOf(LastHttpContent.class);
content.release();
assertNull(ch.readInbound());
// Close the connection.
assertTrue(ch.finish());
// The decoder should still produce the last content.
LastHttpContent lastContent = ch.readInbound();
assertFalse(lastContent.content().isReadable());
lastContent.release();
// But nothing more.
assertNull(ch.readInbound());
}
Domain
Subdomains
Source
Frequently Asked Questions
What does testClosureWithoutContentLength2() do?
testClosureWithoutContentLength2() is a function in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpResponseDecoderTest.java.
Where is testClosureWithoutContentLength2() defined?
testClosureWithoutContentLength2() is defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpResponseDecoderTest.java at line 415.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free