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