Home / Function/ setUp() — netty Function Reference

setUp() — netty Function Reference

Architecture documentation for the setUp() function in Http2MultiplexCodecBuilderTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  ab467e32_50d5_0c66_6d96_7b56389f6927["setUp()"]
  6f38501f_37dc_377c_36b1_15b1a68d236c["Http2MultiplexCodecBuilderTest"]
  ab467e32_50d5_0c66_6d96_7b56389f6927 -->|defined in| 6f38501f_37dc_377c_36b1_15b1a68d236c
  583999e0_4556_7b1d_173e_48f553c4b7ec["channelActive()"]
  ab467e32_50d5_0c66_6d96_7b56389f6927 -->|calls| 583999e0_4556_7b1d_173e_48f553c4b7ec
  427c0ea6_3eee_0246_284f_cea6c2bfb14f["channelInactive()"]
  ab467e32_50d5_0c66_6d96_7b56389f6927 -->|calls| 427c0ea6_3eee_0246_284f_cea6c2bfb14f
  style ab467e32_50d5_0c66_6d96_7b56389f6927 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/test/java/io/netty/handler/codec/http2/Http2MultiplexCodecBuilderTest.java lines 68–124

    @BeforeEach
    public void setUp() throws InterruptedException {
        final CountDownLatch serverChannelLatch = new CountDownLatch(1);
        LocalAddress serverAddress = new LocalAddress(getClass());
        serverLastInboundHandler = new SharableLastInboundHandler();
        ServerBootstrap sb = new ServerBootstrap()
                .channel(LocalServerChannel.class)
                .group(group)
                .childHandler(new ChannelInitializer<Channel>() {
                    @Override
                    protected void initChannel(Channel ch) throws Exception {
                        serverConnectedChannel = ch;
                        ch.pipeline().addLast(new Http2MultiplexCodecBuilder(true, new ChannelInitializer<Channel>() {

                            @Override
                            protected void initChannel(Channel ch) throws Exception {
                                ch.pipeline().addLast(new ChannelInboundHandlerAdapter() {
                                    private boolean writable;

                                    @Override
                                    public void channelActive(ChannelHandlerContext ctx) throws Exception {
                                        writable |= ctx.channel().isWritable();
                                        super.channelActive(ctx);
                                    }

                                    @Override
                                    public void channelWritabilityChanged(ChannelHandlerContext ctx) throws Exception {
                                        writable |= ctx.channel().isWritable();
                                        super.channelWritabilityChanged(ctx);
                                    }

                                    @Override
                                    public void channelInactive(ChannelHandlerContext ctx) throws Exception {
                                        assertTrue(writable);
                                        super.channelInactive(ctx);
                                    }
                                });
                                ch.pipeline().addLast(serverLastInboundHandler);
                            }
                        }).build());
                        serverChannelLatch.countDown();
                    }
                });
        serverChannel = sb.bind(serverAddress).sync().channel();

        Bootstrap cb = new Bootstrap()
                .channel(LocalChannel.class)
                .group(group)
                .handler(new Http2MultiplexCodecBuilder(false, new ChannelInitializer<Channel>() {
                    @Override
                    protected void initChannel(Channel ch) throws Exception {
                        fail("Should not be called for outbound streams");
                    }
                }).build());
        clientChannel = cb.connect(serverAddress).sync().channel();
        assertTrue(serverChannelLatch.await(5, SECONDS));
    }

Domain

Subdomains

Frequently Asked Questions

What does setUp() do?
setUp() is a function in the netty codebase, defined in codec-http2/src/test/java/io/netty/handler/codec/http2/Http2MultiplexCodecBuilderTest.java.
Where is setUp() defined?
setUp() is defined in codec-http2/src/test/java/io/netty/handler/codec/http2/Http2MultiplexCodecBuilderTest.java at line 68.
What does setUp() call?
setUp() calls 2 function(s): channelActive, channelInactive.

Analyze Your Own Codebase

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

Try Supermodel Free