Home / Function/ testCloseWhileAggregating() — netty Function Reference

testCloseWhileAggregating() — netty Function Reference

Architecture documentation for the testCloseWhileAggregating() function in MessageAggregatorTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  adbc63eb_c346_8c90_2bb6_a167bc89fec1["testCloseWhileAggregating()"]
  bc4d585e_177f_3839_a8b4_bd1e1daabdff["MessageAggregatorTest"]
  adbc63eb_c346_8c90_2bb6_a167bc89fec1 -->|defined in| bc4d585e_177f_3839_a8b4_bd1e1daabdff
  515f1e49_9898_f599_cf1c_071b2388ed95["TestMessage()"]
  adbc63eb_c346_8c90_2bb6_a167bc89fec1 -->|calls| 515f1e49_9898_f599_cf1c_071b2388ed95
  style adbc63eb_c346_8c90_2bb6_a167bc89fec1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-base/src/test/java/io/netty/handler/codec/MessageAggregatorTest.java lines 98–120

    @Test
    public void testCloseWhileAggregating() throws Exception {
        ReadCounter counter = new ReadCounter();
        ByteBufHolder first = new TestMessage(Unpooled.copiedBuffer("first", CharsetUtil.US_ASCII));

        MockMessageAggregator agg = spy(MockMessageAggregator.class);
        when(agg.isStartMessage(first)).thenReturn(true);
        when(agg.isLastContentMessage(first)).thenReturn(false);

        final EmbeddedChannel embedded = new EmbeddedChannel(counter, agg);
        embedded.config().setAutoRead(false);

        assertFalse(embedded.writeInbound(first));

        assertEquals(2, counter.value);
        assertThrows(PrematureChannelClosureException.class, new Executable() {
            @Override
            public void execute() {
                embedded.finish();
            }
        });
        assertEquals(0, first.refCnt());
    }

Domain

Subdomains

Frequently Asked Questions

What does testCloseWhileAggregating() do?
testCloseWhileAggregating() is a function in the netty codebase, defined in codec-base/src/test/java/io/netty/handler/codec/MessageAggregatorTest.java.
Where is testCloseWhileAggregating() defined?
testCloseWhileAggregating() is defined in codec-base/src/test/java/io/netty/handler/codec/MessageAggregatorTest.java at line 98.
What does testCloseWhileAggregating() call?
testCloseWhileAggregating() calls 1 function(s): TestMessage.

Analyze Your Own Codebase

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

Try Supermodel Free