Home / Function/ testWriteListenerInvokedAfterChannelClosedAndInputNotFullyConsumed() — netty Function Reference

testWriteListenerInvokedAfterChannelClosedAndInputNotFullyConsumed() — netty Function Reference

Architecture documentation for the testWriteListenerInvokedAfterChannelClosedAndInputNotFullyConsumed() function in ChunkedWriteHandlerTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  0388590f_b1d6_7637_0041_bea173105904["testWriteListenerInvokedAfterChannelClosedAndInputNotFullyConsumed()"]
  56a5cec9_e7c0_8a2d_a9b0_56df2226f2bb["ChunkedWriteHandlerTest"]
  0388590f_b1d6_7637_0041_bea173105904 -->|defined in| 56a5cec9_e7c0_8a2d_a9b0_56df2226f2bb
  5a87f9ac_5ede_1dc1_7d58_9144f33b262c["TestChunkedInput()"]
  0388590f_b1d6_7637_0041_bea173105904 -->|calls| 5a87f9ac_5ede_1dc1_7d58_9144f33b262c
  6abd9734_226e_eb7a_6ea3_c933dfb7e8bf["isClosed()"]
  0388590f_b1d6_7637_0041_bea173105904 -->|calls| 6abd9734_226e_eb7a_6ea3_c933dfb7e8bf
  5b3c7cbd_194c_150b_fe10_1fdfe7748566["close()"]
  0388590f_b1d6_7637_0041_bea173105904 -->|calls| 5b3c7cbd_194c_150b_fe10_1fdfe7748566
  style 0388590f_b1d6_7637_0041_bea173105904 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler/src/test/java/io/netty/handler/stream/ChunkedWriteHandlerTest.java lines 623–644

    @Test
    public void testWriteListenerInvokedAfterChannelClosedAndInputNotFullyConsumed() throws Exception {
        // use non-empty input which has endOfInput = false
        final TestChunkedInput input = new TestChunkedInput(42);
        EmbeddedChannel ch = new EmbeddedChannel(new ChunkedWriteHandler());

        final AtomicBoolean inputClosedWhenListenerInvoked = new AtomicBoolean();
        final CountDownLatch listenerInvoked = new CountDownLatch(1);

        ChannelFuture writeFuture = ch.write(input);
        writeFuture.addListener(future -> {
            inputClosedWhenListenerInvoked.set(input.isClosed());
            listenerInvoked.countDown();
        });
        ch.close(); // close channel to make handler discard the input on subsequent flush
        ch.flush();

        assertTrue(listenerInvoked.await(10, SECONDS));
        assertFalse(writeFuture.isSuccess());
        assertTrue(inputClosedWhenListenerInvoked.get());
        assertFalse(ch.finish());
    }

Domain

Subdomains

Frequently Asked Questions

What does testWriteListenerInvokedAfterChannelClosedAndInputNotFullyConsumed() do?
testWriteListenerInvokedAfterChannelClosedAndInputNotFullyConsumed() is a function in the netty codebase, defined in handler/src/test/java/io/netty/handler/stream/ChunkedWriteHandlerTest.java.
Where is testWriteListenerInvokedAfterChannelClosedAndInputNotFullyConsumed() defined?
testWriteListenerInvokedAfterChannelClosedAndInputNotFullyConsumed() is defined in handler/src/test/java/io/netty/handler/stream/ChunkedWriteHandlerTest.java at line 623.
What does testWriteListenerInvokedAfterChannelClosedAndInputNotFullyConsumed() call?
testWriteListenerInvokedAfterChannelClosedAndInputNotFullyConsumed() calls 3 function(s): TestChunkedInput, close, isClosed.

Analyze Your Own Codebase

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

Try Supermodel Free