Home / Function/ testCumulation() — netty Function Reference

testCumulation() — netty Function Reference

Architecture documentation for the testCumulation() function in SslHandlerCoalescingBufferQueueTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  b8c02a7b_e945_ad08_c4fa_749b8952dcd9["testCumulation()"]
  cbda5f3b_9544_c17d_ad05_932a55411e49["SslHandlerCoalescingBufferQueueTest"]
  b8c02a7b_e945_ad08_c4fa_749b8952dcd9 -->|defined in| cbda5f3b_9544_c17d_ad05_932a55411e49
  style b8c02a7b_e945_ad08_c4fa_749b8952dcd9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler/src/test/java/io/netty/handler/ssl/SslHandlerCoalescingBufferQueueTest.java lines 97–133

    @ParameterizedTest
    @EnumSource(CumulationTestScenario.class)
    public void testCumulation(CumulationTestScenario testScenario) {
        EmbeddedChannel channel = new EmbeddedChannel();
        SslHandlerCoalescingBufferQueue queue = new SslHandlerCoalescingBufferQueue(channel, 16, false) {
            @Override
            protected int wrapDataSize() {
                return 128;
            }
        };

        ByteBuf original = testScenario.bufferSupplier.get();
        original.writerIndex(8);
        ByteBuf first = testScenario.bufferWrapper.apply(original);
        first.retain();
        queue.add(first);
        ByteBuf second = Unpooled.copyLong(3);
        queue.add(second);

        ChannelPromise promise = channel.newPromise();
        assertFalse(queue.isEmpty());
        ByteBuf buffer = queue.remove(UnpooledByteBufAllocator.DEFAULT, 128, promise);
        try {
            assertEquals(16, buffer.readableBytes());
            assertEquals(1, buffer.readLong());
            assertEquals(3, buffer.readLong());
        } finally {
            buffer.release();
        }
        assertTrue(queue.isEmpty());
        assertEquals(8, original.writerIndex());
        original.writerIndex(original.capacity());
        assertEquals(2, original.getLong(8));
        first.release();
        assertEquals(0, first.refCnt());
        assertEquals(0, second.refCnt());
    }

Domain

Subdomains

Frequently Asked Questions

What does testCumulation() do?
testCumulation() is a function in the netty codebase, defined in handler/src/test/java/io/netty/handler/ssl/SslHandlerCoalescingBufferQueueTest.java.
Where is testCumulation() defined?
testCumulation() is defined in handler/src/test/java/io/netty/handler/ssl/SslHandlerCoalescingBufferQueueTest.java at line 97.

Analyze Your Own Codebase

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

Try Supermodel Free