Home / Function/ testFlushViaReadComplete() — netty Function Reference

testFlushViaReadComplete() — netty Function Reference

Architecture documentation for the testFlushViaReadComplete() function in FlushConsolidationHandlerTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  e91e336e_4543_0051_f542_1750fb9b48c8["testFlushViaReadComplete()"]
  4ef52a0d_d145_a738_5ebe_4e1ee02cb2ca["FlushConsolidationHandlerTest"]
  e91e336e_4543_0051_f542_1750fb9b48c8 -->|defined in| 4ef52a0d_d145_a738_5ebe_4e1ee02cb2ca
  style e91e336e_4543_0051_f542_1750fb9b48c8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler/src/test/java/io/netty/handler/flush/FlushConsolidationHandlerTest.java lines 74–99

    @Test
    public void testFlushViaReadComplete() {
        final AtomicInteger flushCount = new AtomicInteger();
        EmbeddedChannel channel = newChannel(flushCount, false);
        // Flush should go through as there is no read loop in progress.
        channel.flush();
        channel.runPendingTasks();
        assertEquals(1, flushCount.get());

        // Simulate read loop;
        channel.pipeline().fireChannelRead(1L);
        assertEquals(1, flushCount.get());
        channel.pipeline().fireChannelRead(2L);
        assertEquals(1, flushCount.get());
        assertNull(channel.readOutbound());
        channel.pipeline().fireChannelReadComplete();
        assertEquals(2, flushCount.get());
        // Now flush again as the read loop is complete.
        channel.flush();
        channel.runPendingTasks();
        assertEquals(3, flushCount.get());
        assertEquals(1L, (Long) channel.readOutbound());
        assertEquals(2L, (Long) channel.readOutbound());
        assertNull(channel.readOutbound());
        assertFalse(channel.finish());
    }

Domain

Subdomains

Frequently Asked Questions

What does testFlushViaReadComplete() do?
testFlushViaReadComplete() is a function in the netty codebase, defined in handler/src/test/java/io/netty/handler/flush/FlushConsolidationHandlerTest.java.
Where is testFlushViaReadComplete() defined?
testFlushViaReadComplete() is defined in handler/src/test/java/io/netty/handler/flush/FlushConsolidationHandlerTest.java at line 74.

Analyze Your Own Codebase

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

Try Supermodel Free