Home / Class/ WriteTimeoutHandlerTest Class — netty Architecture

WriteTimeoutHandlerTest Class — netty Architecture

Architecture documentation for the WriteTimeoutHandlerTest class in WriteTimeoutHandlerTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  2d2654ec_c4ad_ab49_7241_7291c604482c["WriteTimeoutHandlerTest"]
  20f02685_ce81_bcd0_6644_c082ce9f239b["WriteTimeoutHandlerTest.java"]
  2d2654ec_c4ad_ab49_7241_7291c604482c -->|defined in| 20f02685_ce81_bcd0_6644_c082ce9f239b
  ff42532f_8c3a_3011_1a53_3bd87656fe05["testPromiseUseDifferentExecutor()"]
  2d2654ec_c4ad_ab49_7241_7291c604482c -->|method| ff42532f_8c3a_3011_1a53_3bd87656fe05

Relationship Graph

Source Code

handler/src/test/java/io/netty/handler/timeout/WriteTimeoutHandlerTest.java lines 31–61

public class WriteTimeoutHandlerTest {

    @Test
    public void testPromiseUseDifferentExecutor() throws Exception {
        EventExecutorGroup group1 = new DefaultEventExecutorGroup(1);
        EventExecutorGroup group2 = new DefaultEventExecutorGroup(1);
        EmbeddedChannel channel = new EmbeddedChannel(false, false);
        try {
            channel.pipeline().addLast(group1, new WriteTimeoutHandler(10000));
            final CountDownLatch latch = new CountDownLatch(1);
            channel.pipeline().addLast(group2, new ChannelInboundHandlerAdapter() {
                @Override
                public void channelActive(ChannelHandlerContext ctx) throws Exception {
                    ctx.writeAndFlush("something").addListener(new ChannelFutureListener() {
                        @Override
                        public void operationComplete(ChannelFuture future) throws Exception {
                            latch.countDown();
                        }
                    });
                }
            });

            channel.register();
            latch.await();
            assertTrue(channel.finishAndReleaseAll());
        } finally {
            group1.shutdownGracefully();
            group2.shutdownGracefully();
        }
    }
}

Frequently Asked Questions

What is the WriteTimeoutHandlerTest class?
WriteTimeoutHandlerTest is a class in the netty codebase, defined in handler/src/test/java/io/netty/handler/timeout/WriteTimeoutHandlerTest.java.
Where is WriteTimeoutHandlerTest defined?
WriteTimeoutHandlerTest is defined in handler/src/test/java/io/netty/handler/timeout/WriteTimeoutHandlerTest.java at line 31.

Analyze Your Own Codebase

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

Try Supermodel Free