Home / Function/ testGetResolverFailed() — netty Function Reference

testGetResolverFailed() — netty Function Reference

Architecture documentation for the testGetResolverFailed() function in BootstrapTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  0f23ddf0_4b99_680e_2632_bb1dc24a3193["testGetResolverFailed()"]
  7a7606db_8d2a_bfe0_9993_4aaa8e0a6e42["BootstrapTest"]
  0f23ddf0_4b99_680e_2632_bb1dc24a3193 -->|defined in| 7a7606db_8d2a_bfe0_9993_4aaa8e0a6e42
  307a3e78_e035_c6f3_8243_597f5c05a3af["newResolver()"]
  0f23ddf0_4b99_680e_2632_bb1dc24a3193 -->|calls| 307a3e78_e035_c6f3_8243_597f5c05a3af
  style 0f23ddf0_4b99_680e_2632_bb1dc24a3193 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport/src/test/java/io/netty/bootstrap/BootstrapTest.java lines 392–423

    @Test
    public void testGetResolverFailed() throws Exception {
        class TestException extends RuntimeException { }

        final Bootstrap bootstrapA = new Bootstrap();
        bootstrapA.group(groupA);
        bootstrapA.channel(LocalChannel.class);

        bootstrapA.resolver(new AddressResolverGroup<SocketAddress>() {
            @Override
            protected AddressResolver<SocketAddress> newResolver(EventExecutor executor) {
                throw new TestException();
            }
        });
        bootstrapA.handler(dummyHandler);

        final ServerBootstrap bootstrapB = new ServerBootstrap();
        bootstrapB.group(groupB);
        bootstrapB.channel(LocalServerChannel.class);
        bootstrapB.childHandler(dummyHandler);
        SocketAddress localAddress = bootstrapB.bind(LocalAddress.ANY).sync().channel().localAddress();

        // Connect to the server using the asynchronous resolver.
        ChannelFuture connectFuture = bootstrapA.connect(localAddress);

        // Should fail with the IllegalStateException.
        assertTrue(connectFuture.await(10000));
        assertInstanceOf(IllegalStateException.class, connectFuture.cause());
        assertInstanceOf(TestException.class, connectFuture.cause().getCause());
        connectFuture.channel().closeFuture().await(10000);
        assertFalse(connectFuture.channel().isOpen());
    }

Domain

Subdomains

Frequently Asked Questions

What does testGetResolverFailed() do?
testGetResolverFailed() is a function in the netty codebase, defined in transport/src/test/java/io/netty/bootstrap/BootstrapTest.java.
Where is testGetResolverFailed() defined?
testGetResolverFailed() is defined in transport/src/test/java/io/netty/bootstrap/BootstrapTest.java at line 392.
What does testGetResolverFailed() call?
testGetResolverFailed() calls 1 function(s): newResolver.

Analyze Your Own Codebase

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

Try Supermodel Free