Home / Function/ testClosedChannelExceptionCarryIOException() — netty Function Reference

testClosedChannelExceptionCarryIOException() — netty Function Reference

Architecture documentation for the testClosedChannelExceptionCarryIOException() function in AbstractChannelTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  d995674a_eb16_206d_4092_cae0cc9b4cea["testClosedChannelExceptionCarryIOException()"]
  63f919c7_8527_59bf_45a5_f49840c141ac["AbstractChannelTest"]
  d995674a_eb16_206d_4092_cae0cc9b4cea -->|defined in| 63f919c7_8527_59bf_45a5_f49840c141ac
  d4f5c0aa_d142_d540_e56d_49a5ff92416f["TestChannel()"]
  d995674a_eb16_206d_4092_cae0cc9b4cea -->|calls| d4f5c0aa_d142_d540_e56d_49a5ff92416f
  0a1b892e_a01b_a111_1e6a_20955d65ca83["AbstractUnsafe()"]
  d995674a_eb16_206d_4092_cae0cc9b4cea -->|calls| 0a1b892e_a01b_a111_1e6a_20955d65ca83
  2664c558_38a8_9899_1058_d41519c0f504["doClose()"]
  d995674a_eb16_206d_4092_cae0cc9b4cea -->|calls| 2664c558_38a8_9899_1058_d41519c0f504
  5e04863d_70a8_293e_e794_c8049ebae5c5["doWrite()"]
  d995674a_eb16_206d_4092_cae0cc9b4cea -->|calls| 5e04863d_70a8_293e_e794_c8049ebae5c5
  a8bdc280_38ff_e5b7_5b38_37035dab56a7["isOpen()"]
  d995674a_eb16_206d_4092_cae0cc9b4cea -->|calls| a8bdc280_38ff_e5b7_5b38_37035dab56a7
  34102fba_c5f6_131a_97d6_8cbd0b1a1a44["isActive()"]
  d995674a_eb16_206d_4092_cae0cc9b4cea -->|calls| 34102fba_c5f6_131a_97d6_8cbd0b1a1a44
  9225cd8f_6728_b060_f06a_6f6e2e5381c9["registerChannel()"]
  d995674a_eb16_206d_4092_cae0cc9b4cea -->|calls| 9225cd8f_6728_b060_f06a_6f6e2e5381c9
  f81463a5_0fdf_2b9b_b736_b430f541ed43["assertClosedChannelException()"]
  d995674a_eb16_206d_4092_cae0cc9b4cea -->|calls| f81463a5_0fdf_2b9b_b736_b430f541ed43
  style d995674a_eb16_206d_4092_cae0cc9b4cea fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport/src/test/java/io/netty/channel/AbstractChannelTest.java lines 113–167

    @Test
    public void testClosedChannelExceptionCarryIOException() throws Exception {
        final IOException ioException = new IOException();
        final Channel channel = new TestChannel() {
            private boolean open = true;
            private boolean active;

            @Override
            protected AbstractUnsafe newUnsafe() {
                return new AbstractUnsafe() {
                    @Override
                    public void connect(
                            SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise) {
                        active = true;
                        promise.setSuccess();
                    }
                };
            }

            @Override
            protected void doClose()  {
                active = false;
                open = false;
            }

            @Override
            protected void doWrite(ChannelOutboundBuffer in) throws Exception {
                throw ioException;
            }

            @Override
            public boolean isOpen() {
                return open;
            }

            @Override
            public boolean isActive() {
                return active;
            }
        };

        EventLoop loop = new DefaultEventLoop();
        try {
            registerChannel(loop, channel);
            channel.connect(new InetSocketAddress(NetUtil.LOCALHOST, 8888)).sync();
            assertSame(ioException, channel.writeAndFlush("").await().cause());

            assertClosedChannelException(channel.writeAndFlush(""), ioException);
            assertClosedChannelException(channel.write(""), ioException);
            assertClosedChannelException(channel.bind(new InetSocketAddress(NetUtil.LOCALHOST, 8888)), ioException);
        } finally {
            channel.close();
            loop.shutdownGracefully();
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does testClosedChannelExceptionCarryIOException() do?
testClosedChannelExceptionCarryIOException() is a function in the netty codebase, defined in transport/src/test/java/io/netty/channel/AbstractChannelTest.java.
Where is testClosedChannelExceptionCarryIOException() defined?
testClosedChannelExceptionCarryIOException() is defined in transport/src/test/java/io/netty/channel/AbstractChannelTest.java at line 113.
What does testClosedChannelExceptionCarryIOException() call?
testClosedChannelExceptionCarryIOException() calls 8 function(s): AbstractUnsafe, TestChannel, assertClosedChannelException, doClose, doWrite, isActive, isOpen, registerChannel.

Analyze Your Own Codebase

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

Try Supermodel Free