Home / Function/ testRequestDecompression() — netty Function Reference

testRequestDecompression() — netty Function Reference

Architecture documentation for the testRequestDecompression() function in HttpContentDecoderTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  1ec7860b_6469_b9a4_5f54_aa51e2515103["testRequestDecompression()"]
  ea4ec426_b689_ab52_a554_7959aed6c709["HttpContentDecoderTest"]
  1ec7860b_6469_b9a4_5f54_aa51e2515103 -->|defined in| ea4ec426_b689_ab52_a554_7959aed6c709
  e1fd631d_8d14_d190_2463_40108ec003a4["assertHasInboundMessages()"]
  1ec7860b_6469_b9a4_5f54_aa51e2515103 -->|calls| e1fd631d_8d14_d190_2463_40108ec003a4
  465668ef_fec3_d4d9_164f_24dc020645ba["assertHasOutboundMessages()"]
  1ec7860b_6469_b9a4_5f54_aa51e2515103 -->|calls| 465668ef_fec3_d4d9_164f_24dc020645ba
  style 1ec7860b_6469_b9a4_5f54_aa51e2515103 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/test/java/io/netty/handler/codec/http/HttpContentDecoderTest.java lines 87–112

    @Test
    public void testRequestDecompression() {
        // baseline test: request decoder, content decompressor && request aggregator work as expected
        HttpRequestDecoder decoder = new HttpRequestDecoder();
        HttpContentDecoder decompressor = new HttpContentDecompressor(0);
        HttpObjectAggregator aggregator = new HttpObjectAggregator(1024);
        EmbeddedChannel channel = new EmbeddedChannel(decoder, decompressor, aggregator);

        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));

        Object o = channel.readInbound();
        assertInstanceOf(FullHttpRequest.class, o);
        FullHttpRequest req = (FullHttpRequest) o;
        assertEquals(HELLO_WORLD.length(), req.headers().getInt(HttpHeaderNames.CONTENT_LENGTH).intValue());
        assertEquals(HELLO_WORLD, req.content().toString(CharsetUtil.US_ASCII));
        req.release();

        assertHasInboundMessages(channel, false);
        assertHasOutboundMessages(channel, false);
        assertFalse(channel.finish()); // assert that no messages are left in channel
    }

Domain

Subdomains

Frequently Asked Questions

What does testRequestDecompression() do?
testRequestDecompression() is a function in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpContentDecoderTest.java.
Where is testRequestDecompression() defined?
testRequestDecompression() is defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpContentDecoderTest.java at line 87.
What does testRequestDecompression() call?
testRequestDecompression() 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