Home / Function/ testCompressThresholdNotCompress() — netty Function Reference

testCompressThresholdNotCompress() — netty Function Reference

Architecture documentation for the testCompressThresholdNotCompress() function in HttpContentCompressorTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  b6d4c198_e557_5d32_1b94_88660b1edc60["testCompressThresholdNotCompress()"]
  32ab04b0_6c83_d4f7_6483_fd304f908331["HttpContentCompressorTest"]
  b6d4c198_e557_5d32_1b94_88660b1edc60 -->|defined in| 32ab04b0_6c83_d4f7_6483_fd304f908331
  style b6d4c198_e557_5d32_1b94_88660b1edc60 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/test/java/io/netty/handler/codec/http/HttpContentCompressorTest.java lines 918–939

    @Test
    public void testCompressThresholdNotCompress() throws Exception {
        EmbeddedChannel ch = new EmbeddedChannel(new HttpContentCompressor(6, 15, 8, 1024));
        assertTrue(ch.writeInbound(newRequest()));

        FullHttpResponse res1023 = new DefaultFullHttpResponse(
                HttpVersion.HTTP_1_1, HttpResponseStatus.OK,
                Unpooled.wrappedBuffer(new byte[1023]));
        assertTrue(ch.writeOutbound(res1023));
        DefaultHttpResponse response1023 = ch.readOutbound();
        assertFalse(response1023.headers().contains(HttpHeaderNames.CONTENT_ENCODING));
        ch.releaseOutbound();

        assertTrue(ch.writeInbound(newRequest()));
        FullHttpResponse res1024 = new DefaultFullHttpResponse(
                HttpVersion.HTTP_1_1, HttpResponseStatus.OK,
                Unpooled.wrappedBuffer(new byte[1024]));
        assertTrue(ch.writeOutbound(res1024));
        DefaultHttpResponse response1024 = ch.readOutbound();
        assertEquals("gzip", response1024.headers().get(HttpHeaderNames.CONTENT_ENCODING));
        assertTrue(ch.finishAndReleaseAll());
    }

Domain

Subdomains

Frequently Asked Questions

What does testCompressThresholdNotCompress() do?
testCompressThresholdNotCompress() is a function in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpContentCompressorTest.java.
Where is testCompressThresholdNotCompress() defined?
testCompressThresholdNotCompress() is defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpContentCompressorTest.java at line 918.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free