Home / Function/ testFlushFailure() — netty Function Reference

testFlushFailure() — netty Function Reference

Architecture documentation for the testFlushFailure() function in ReentrantChannelTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  19fbe94a_ce47_fc05_828c_8c5b59dd4105["testFlushFailure()"]
  13a11eea_27b7_44b5_a4d5_69eb21dd0e09["ReentrantChannelTest"]
  19fbe94a_ce47_fc05_828c_8c5b59dd4105 -->|defined in| 13a11eea_27b7_44b5_a4d5_69eb21dd0e09
  style 19fbe94a_ce47_fc05_828c_8c5b59dd4105 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport/src/test/java/io/netty/channel/ReentrantChannelTest.java lines 252–290

    @Test
    public void testFlushFailure() throws Exception {

        LocalAddress addr = new LocalAddress("testFlushFailure");

        ServerBootstrap sb = getLocalServerBootstrap();
        sb.bind(addr).sync().channel();

        Bootstrap cb = getLocalClientBootstrap();

        setInterest(Event.WRITE, Event.FLUSH, Event.CLOSE, Event.EXCEPTION);

        Channel clientChannel = cb.connect(addr).sync().channel();

        clientChannel.pipeline().addLast(new ChannelOutboundHandlerAdapter() {

            @Override
            public void flush(ChannelHandlerContext ctx) throws Exception {
                throw new Exception("intentional failure");
            }

            @Override
            public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
                ctx.close();
            }
        });

        try {
            clientChannel.writeAndFlush(createTestBuf(2000)).sync();
            fail();
        } catch (Exception e) {
            // FIXME:  shouldn't this contain the "intentional failure" exception?
            assertThat(e).isInstanceOf(ClosedChannelException.class);
        }

        clientChannel.closeFuture().sync();

        assertLog("WRITE\nCLOSE\n");
    }

Domain

Subdomains

Frequently Asked Questions

What does testFlushFailure() do?
testFlushFailure() is a function in the netty codebase, defined in transport/src/test/java/io/netty/channel/ReentrantChannelTest.java.
Where is testFlushFailure() defined?
testFlushFailure() is defined in transport/src/test/java/io/netty/channel/ReentrantChannelTest.java at line 252.

Analyze Your Own Codebase

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

Try Supermodel Free