Home / Function/ testVoidPromiseNotify() — netty Function Reference

testVoidPromiseNotify() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  742d1502_a015_4367_3664_31df4bc96089["testVoidPromiseNotify()"]
  666d912b_4166_a807_ed10_ba12f328a7b2["DefaultChannelPipelineTest"]
  742d1502_a015_4367_3664_31df4bc96089 -->|defined in| 666d912b_4166_a807_ed10_ba12f328a7b2
  a2eed25d_b7ba_1436_1910_39c9b1477519["next()"]
  742d1502_a015_4367_3664_31df4bc96089 -->|calls| a2eed25d_b7ba_1436_1910_39c9b1477519
  19bd3906_4c8c_ae23_6c05_b7a84d367379["shutdownGracefully()"]
  742d1502_a015_4367_3664_31df4bc96089 -->|calls| 19bd3906_4c8c_ae23_6c05_b7a84d367379
  76d0323d_6adb_0c4c_dee1_48f5476bd522["close()"]
  742d1502_a015_4367_3664_31df4bc96089 -->|calls| 76d0323d_6adb_0c4c_dee1_48f5476bd522
  1bb1c1cc_77dd_d360_5aff_fec13914d331["write()"]
  742d1502_a015_4367_3664_31df4bc96089 -->|calls| 1bb1c1cc_77dd_d360_5aff_fec13914d331
  8c52b958_e400_144f_b4f2_e60153ac0d1a["exceptionCaught()"]
  742d1502_a015_4367_3664_31df4bc96089 -->|calls| 8c52b958_e400_144f_b4f2_e60153ac0d1a
  style 742d1502_a015_4367_3664_31df4bc96089 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport/src/test/java/io/netty/channel/DefaultChannelPipelineTest.java lines 1613–1641

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

        EventLoopGroup defaultGroup = new MultiThreadIoEventLoopGroup(1, LocalIoHandler.newFactory());
        EventLoop eventLoop1 = defaultGroup.next();
        final Promise<Throwable> promise = eventLoop1.newPromise();
        final Exception exception = new IllegalArgumentException();
        try {
            eventLoop1.register(pipeline1.channel()).syncUninterruptibly();
            pipeline1.addLast(new ChannelDuplexHandler() {
                @Override
                public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
                    throw exception;
                }

                @Override
                public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
                    promise.setSuccess(cause);
                }
            });
            pipeline1.write("test", pipeline1.voidPromise());
            assertSame(exception, promise.syncUninterruptibly().getNow());
        } finally {
            pipeline1.channel().close().syncUninterruptibly();
            defaultGroup.shutdownGracefully();
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does testVoidPromiseNotify() do?
testVoidPromiseNotify() is a function in the netty codebase, defined in transport/src/test/java/io/netty/channel/DefaultChannelPipelineTest.java.
Where is testVoidPromiseNotify() defined?
testVoidPromiseNotify() is defined in transport/src/test/java/io/netty/channel/DefaultChannelPipelineTest.java at line 1613.
What does testVoidPromiseNotify() call?
testVoidPromiseNotify() calls 5 function(s): close, exceptionCaught, next, shutdownGracefully, write.

Analyze Your Own Codebase

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

Try Supermodel Free