testResponseWithContentLength() — netty Function Reference
Architecture documentation for the testResponseWithContentLength() function in HttpResponseDecoderTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 208849f2_3150_4685_3ead_4868cae83fdf["testResponseWithContentLength()"] 90546a8c_51c4_a9dc_b6e8_695d29269596["HttpResponseDecoderTest"] 208849f2_3150_4685_3ead_4868cae83fdf -->|defined in| 90546a8c_51c4_a9dc_b6e8_695d29269596 style 208849f2_3150_4685_3ead_4868cae83fdf fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
codec-http/src/test/java/io/netty/handler/codec/http/HttpResponseDecoderTest.java lines 668–699
@Test
public void testResponseWithContentLength() {
EmbeddedChannel ch = new EmbeddedChannel(new HttpResponseDecoder());
ch.writeInbound(Unpooled.copiedBuffer(
"HTTP/1.1 200 OK\r\n" +
"Content-Length: 10\r\n" +
"\r\n", CharsetUtil.US_ASCII));
byte[] data = new byte[10];
for (int i = 0; i < data.length; i++) {
data[i] = (byte) i;
}
ch.writeInbound(Unpooled.copiedBuffer(data, 0, data.length / 2));
ch.writeInbound(Unpooled.copiedBuffer(data, 5, data.length / 2));
HttpResponse res = ch.readInbound();
assertSame(HttpVersion.HTTP_1_1, res.protocolVersion());
assertEquals(HttpResponseStatus.OK, res.status());
HttpContent firstContent = ch.readInbound();
assertEquals(5, firstContent.content().readableBytes());
assertEquals(Unpooled.copiedBuffer(data, 0, 5), firstContent.content());
firstContent.release();
LastHttpContent lastContent = ch.readInbound();
assertEquals(5, lastContent.content().readableBytes());
assertEquals(Unpooled.copiedBuffer(data, 5, 5), lastContent.content());
lastContent.release();
assertFalse(ch.finish());
assertNull(ch.readInbound());
}
Domain
Subdomains
Source
Frequently Asked Questions
What does testResponseWithContentLength() do?
testResponseWithContentLength() is a function in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpResponseDecoderTest.java.
Where is testResponseWithContentLength() defined?
testResponseWithContentLength() is defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpResponseDecoderTest.java at line 668.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free