Home / Function/ testMaxAllocation() — netty Function Reference

testMaxAllocation() — netty Function Reference

Architecture documentation for the testMaxAllocation() function in ZlibTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  a4bf5eb7_63e6_027b_3882_0b69dea11417["testMaxAllocation()"]
  7036d690_c470_1931_3ca2_5fffb656bebb["ZlibTest"]
  a4bf5eb7_63e6_027b_3882_0b69dea11417 -->|defined in| 7036d690_c470_1931_3ca2_5fffb656bebb
  b4882686_ed02_4fb8_dc30_f56b2f5f3260["TestByteBufAllocator()"]
  a4bf5eb7_63e6_027b_3882_0b69dea11417 -->|calls| b4882686_ed02_4fb8_dc30_f56b2f5f3260
  a207362b_c62a_5bcf_feb2_0145149ee1af["deflate()"]
  a4bf5eb7_63e6_027b_3882_0b69dea11417 -->|calls| a207362b_c62a_5bcf_feb2_0145149ee1af
  cdfad5d4_ebf7_7515_1b3b_23c3d5af6fe9["getMaxAllocation()"]
  a4bf5eb7_63e6_027b_3882_0b69dea11417 -->|calls| cdfad5d4_ebf7_7515_1b3b_23c3d5af6fe9
  style a4bf5eb7_63e6_027b_3882_0b69dea11417 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-compression/src/test/java/io/netty/handler/codec/compression/ZlibTest.java lines 411–429

    @Test
    public void testMaxAllocation() throws Exception {
        int maxAllocation = 1024;
        ZlibDecoder decoder = createDecoder(ZlibWrapper.ZLIB, maxAllocation);
        final EmbeddedChannel chDecoder = new EmbeddedChannel(decoder);
        TestByteBufAllocator alloc = new TestByteBufAllocator(chDecoder.alloc());
        chDecoder.config().setAllocator(alloc);

        DecompressionException e = assertThrows(DecompressionException.class, new Executable() {
            @Override
            public void execute() throws Throwable {
                chDecoder.writeInbound(Unpooled.wrappedBuffer(deflate(BYTES_LARGE)));
            }
        });
        assertTrue(e.getMessage().startsWith("Decompression buffer has reached maximum size"));
        assertEquals(maxAllocation, alloc.getMaxAllocation());
        assertTrue(decoder.isClosed());
        assertFalse(chDecoder.finish());
    }

Domain

Subdomains

Frequently Asked Questions

What does testMaxAllocation() do?
testMaxAllocation() is a function in the netty codebase, defined in codec-compression/src/test/java/io/netty/handler/codec/compression/ZlibTest.java.
Where is testMaxAllocation() defined?
testMaxAllocation() is defined in codec-compression/src/test/java/io/netty/handler/codec/compression/ZlibTest.java at line 411.
What does testMaxAllocation() call?
testMaxAllocation() calls 3 function(s): TestByteBufAllocator, deflate, getMaxAllocation.

Analyze Your Own Codebase

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

Try Supermodel Free