testRequestContentLength1() — netty Function Reference
Architecture documentation for the testRequestContentLength1() function in HttpContentDecoderTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 2dadfa25_1d74_bc86_1845_cb3feb358694["testRequestContentLength1()"] ea4ec426_b689_ab52_a554_7959aed6c709["HttpContentDecoderTest"] 2dadfa25_1d74_bc86_1845_cb3feb358694 -->|defined in| ea4ec426_b689_ab52_a554_7959aed6c709 e1fd631d_8d14_d190_2463_40108ec003a4["assertHasInboundMessages()"] 2dadfa25_1d74_bc86_1845_cb3feb358694 -->|calls| e1fd631d_8d14_d190_2463_40108ec003a4 465668ef_fec3_d4d9_164f_24dc020645ba["assertHasOutboundMessages()"] 2dadfa25_1d74_bc86_1845_cb3feb358694 -->|calls| 465668ef_fec3_d4d9_164f_24dc020645ba style 2dadfa25_1d74_bc86_1845_cb3feb358694 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
codec-http/src/test/java/io/netty/handler/codec/http/HttpContentDecoderTest.java lines 509–537
@Test
public void testRequestContentLength1() {
// case 1: test that ContentDecompressor either sets the correct Content-Length header
// or removes it completely (handlers down the chain must rely on LastHttpContent object)
// force content to be in more than one chunk (5 bytes/chunk)
HttpRequestDecoder decoder = new HttpRequestDecoder(4096, 4096, 5);
HttpContentDecoder decompressor = new HttpContentDecompressor(0);
EmbeddedChannel channel = new EmbeddedChannel(decoder, decompressor);
String headers = "POST / HTTP/1.1\r\n" +
"Content-Length: " + GZ_HELLO_WORLD.length + "\r\n" +
"Content-Encoding: gzip\r\n" +
"\r\n";
ByteBuf buf = Unpooled.copiedBuffer(headers.getBytes(CharsetUtil.US_ASCII), GZ_HELLO_WORLD);
assertTrue(channel.writeInbound(buf));
Queue<Object> req = channel.inboundMessages();
assertTrue(req.size() >= 1);
Object o = req.peek();
assertInstanceOf(HttpRequest.class, o);
HttpRequest r = (HttpRequest) o;
String v = r.headers().get(HttpHeaderNames.CONTENT_LENGTH);
Long value = v == null ? null : Long.parseLong(v);
assertTrue(value == null || value.longValue() == HELLO_WORLD.length());
assertHasInboundMessages(channel, true);
assertHasOutboundMessages(channel, false);
assertFalse(channel.finish());
}
Domain
Subdomains
Source
Frequently Asked Questions
What does testRequestContentLength1() do?
testRequestContentLength1() is a function in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpContentDecoderTest.java.
Where is testRequestContentLength1() defined?
testRequestContentLength1() is defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpContentDecoderTest.java at line 509.
What does testRequestContentLength1() call?
testRequestContentLength1() calls 2 function(s): assertHasInboundMessages, assertHasOutboundMessages.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free