Home / Function/ testAddBefore() — netty Function Reference

testAddBefore() — netty Function Reference

Architecture documentation for the testAddBefore() function in DefaultChannelPipelineTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  9964f60c_68fd_2419_4caa_6bb463f9008a["testAddBefore()"]
  666d912b_4166_a807_ed10_ba12f328a7b2["DefaultChannelPipelineTest"]
  9964f60c_68fd_2419_4caa_6bb463f9008a -->|defined in| 666d912b_4166_a807_ed10_ba12f328a7b2
  a2eed25d_b7ba_1436_1910_39c9b1477519["next()"]
  9964f60c_68fd_2419_4caa_6bb463f9008a -->|calls| a2eed25d_b7ba_1436_1910_39c9b1477519
  36fce318_f10e_2b70_4def_d189ac0af1ed["execute()"]
  9964f60c_68fd_2419_4caa_6bb463f9008a -->|calls| 36fce318_f10e_2b70_4def_d189ac0af1ed
  723c6398_de0d_5841_85f0_56f05b469ea2["TestTask()"]
  9964f60c_68fd_2419_4caa_6bb463f9008a -->|calls| 723c6398_de0d_5841_85f0_56f05b469ea2
  19bd3906_4c8c_ae23_6c05_b7a84d367379["shutdownGracefully()"]
  9964f60c_68fd_2419_4caa_6bb463f9008a -->|calls| 19bd3906_4c8c_ae23_6c05_b7a84d367379
  style 9964f60c_68fd_2419_4caa_6bb463f9008a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport/src/test/java/io/netty/channel/DefaultChannelPipelineTest.java lines 1447–1470

    @Test
    @Timeout(value = 3000, unit = TimeUnit.MILLISECONDS)
    public void testAddBefore() throws Throwable {
        ChannelPipeline pipeline1 = new LocalChannel().pipeline();
        ChannelPipeline pipeline2 = new LocalChannel().pipeline();

        EventLoopGroup defaultGroup = new MultiThreadIoEventLoopGroup(2, LocalIoHandler.newFactory());
        try {
            EventLoop eventLoop1 = defaultGroup.next();
            EventLoop eventLoop2 = defaultGroup.next();

            eventLoop1.register(pipeline1.channel()).syncUninterruptibly();
            eventLoop2.register(pipeline2.channel()).syncUninterruptibly();

            CountDownLatch latch = new CountDownLatch(2 * 10);
            for (int i = 0; i < 10; i++) {
                eventLoop1.execute(new TestTask(pipeline2, latch));
                eventLoop2.execute(new TestTask(pipeline1, latch));
            }
            latch.await();
        } finally {
            defaultGroup.shutdownGracefully();
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does testAddBefore() do?
testAddBefore() is a function in the netty codebase, defined in transport/src/test/java/io/netty/channel/DefaultChannelPipelineTest.java.
Where is testAddBefore() defined?
testAddBefore() is defined in transport/src/test/java/io/netty/channel/DefaultChannelPipelineTest.java at line 1447.
What does testAddBefore() call?
testAddBefore() calls 4 function(s): TestTask, execute, next, shutdownGracefully.

Analyze Your Own Codebase

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

Try Supermodel Free