Home / Class/ Http2MultiplexTransportTest Class — netty Architecture

Http2MultiplexTransportTest Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  91fc51f7_5bfd_40ef_a0e8_b98c3ed99f48["Http2MultiplexTransportTest"]
  93eaa879_d304_f987_514e_e595eaef7e78["Http2MultiplexTransportTest.java"]
  91fc51f7_5bfd_40ef_a0e8_b98c3ed99f48 -->|defined in| 93eaa879_d304_f987_514e_e595eaef7e78
  4db31022_99f6_9316_d5f2_2f35bdaaf0c0["setup()"]
  91fc51f7_5bfd_40ef_a0e8_b98c3ed99f48 -->|method| 4db31022_99f6_9316_d5f2_2f35bdaaf0c0
  0ced8a4c_0040_d4fe_c6fa_dd9adaf110ba["teardown()"]
  91fc51f7_5bfd_40ef_a0e8_b98c3ed99f48 -->|method| 0ced8a4c_0040_d4fe_c6fa_dd9adaf110ba
  fd9d7fc2_4335_351c_a33d_a3adef22e58d["asyncSettingsAckWithMultiplexCodec()"]
  91fc51f7_5bfd_40ef_a0e8_b98c3ed99f48 -->|method| fd9d7fc2_4335_351c_a33d_a3adef22e58d
  1183eb2a_52be_6c73_c0e1_52805101568d["asyncSettingsAckWithMultiplexHandler()"]
  91fc51f7_5bfd_40ef_a0e8_b98c3ed99f48 -->|method| 1183eb2a_52be_6c73_c0e1_52805101568d
  244a9744_7e18_7250_b37b_f6158f673bd7["asyncSettingsAck0()"]
  91fc51f7_5bfd_40ef_a0e8_b98c3ed99f48 -->|method| 244a9744_7e18_7250_b37b_f6158f673bd7
  6c6962d0_e341_4a30_fb29_8ef81f526f7a["testFlushNotDiscarded()"]
  91fc51f7_5bfd_40ef_a0e8_b98c3ed99f48 -->|method| 6c6962d0_e341_4a30_fb29_8ef81f526f7a
  b8991c48_b56d_1f3b_c33e_4da5d0e56e06["testSSLExceptionOpenSslTLSv12()"]
  91fc51f7_5bfd_40ef_a0e8_b98c3ed99f48 -->|method| b8991c48_b56d_1f3b_c33e_4da5d0e56e06
  aa95ef06_6088_80e8_d008_c5e803938303["testSSLExceptionOpenSslTLSv13()"]
  91fc51f7_5bfd_40ef_a0e8_b98c3ed99f48 -->|method| aa95ef06_6088_80e8_d008_c5e803938303
  e51af82b_2969_7e41_c0c3_a0fb70fe6d8c["testSSLExceptionJDKTLSv12()"]
  91fc51f7_5bfd_40ef_a0e8_b98c3ed99f48 -->|method| e51af82b_2969_7e41_c0c3_a0fb70fe6d8c
  43a2ca8a_a489_851f_99e3_e742b53e3ddb["testSSLExceptionJDKTLSv13()"]
  91fc51f7_5bfd_40ef_a0e8_b98c3ed99f48 -->|method| 43a2ca8a_a489_851f_99e3_e742b53e3ddb
  9be33b96_22b1_5673_9a2d_308c712e297b["testSslException()"]
  91fc51f7_5bfd_40ef_a0e8_b98c3ed99f48 -->|method| 9be33b96_22b1_5673_9a2d_308c712e297b
  70168125_b740_c3ee_4136_86d4c01273b9["testFireChannelReadAfterHandshakeSuccess_JDK()"]
  91fc51f7_5bfd_40ef_a0e8_b98c3ed99f48 -->|method| 70168125_b740_c3ee_4136_86d4c01273b9
  7b0dd5ce_b3ab_2a4f_a73b_76ed669595f2["testFireChannelReadAfterHandshakeSuccess_OPENSSL()"]
  91fc51f7_5bfd_40ef_a0e8_b98c3ed99f48 -->|method| 7b0dd5ce_b3ab_2a4f_a73b_76ed669595f2

Relationship Graph

Source Code

codec-http2/src/test/java/io/netty/handler/codec/http2/Http2MultiplexTransportTest.java lines 98–863

public class Http2MultiplexTransportTest {
    private static final ChannelHandler DISCARD_HANDLER = new ChannelInboundHandlerAdapter() {

        @Override
        public boolean isSharable() {
            return true;
        }

        @Override
        public void channelRead(ChannelHandlerContext ctx, Object msg) {
            ReferenceCountUtil.release(msg);
        }

        @Override
        public void userEventTriggered(ChannelHandlerContext ctx, Object evt) {
            ReferenceCountUtil.release(evt);
        }
    };

    private EventLoopGroup eventLoopGroup;
    private Channel clientChannel;
    private Channel serverChannel;
    private Channel serverConnectedChannel;

    private static final class MultiplexInboundStream extends ChannelInboundHandlerAdapter {
        ChannelFuture responseFuture;
        final AtomicInteger handlerInactivatedFlushed;
        final AtomicInteger handleInactivatedNotFlushed;
        final CountDownLatch latchHandlerInactive;
        static final String LARGE_STRING = generateLargeString(10240);

        MultiplexInboundStream(AtomicInteger handleInactivatedFlushed,
                               AtomicInteger handleInactivatedNotFlushed, CountDownLatch latchHandlerInactive) {
            this.handlerInactivatedFlushed = handleInactivatedFlushed;
            this.handleInactivatedNotFlushed = handleInactivatedNotFlushed;
            this.latchHandlerInactive = latchHandlerInactive;
        }

        @Override
        public void channelRead(final ChannelHandlerContext ctx, Object msg) {
            if (msg instanceof Http2HeadersFrame && ((Http2HeadersFrame) msg).isEndStream()) {
                ByteBuf response = Unpooled.copiedBuffer(LARGE_STRING, CharsetUtil.US_ASCII);
                responseFuture = ctx.writeAndFlush(new DefaultHttp2DataFrame(response, true));
            }
            ReferenceCountUtil.release(msg);
        }

        @Override
        public void channelInactive(ChannelHandlerContext ctx) throws Exception {
            if (responseFuture.isSuccess()) {
                handlerInactivatedFlushed.incrementAndGet();
            } else {
                handleInactivatedNotFlushed.incrementAndGet();
            }
            latchHandlerInactive.countDown();
            ctx.fireChannelInactive();
        }

        private static String generateLargeString(int sizeInBytes) {
            StringBuilder sb = new StringBuilder(sizeInBytes);
            for (int i = 0; i < sizeInBytes; i++) {
                sb.append('X');
            }
            return sb.toString();
        }
    }

    @BeforeEach
    public void setup() {
        eventLoopGroup = new MultiThreadIoEventLoopGroup(NioIoHandler.newFactory());
    }

    @AfterEach
    public void teardown() {
        if (clientChannel != null) {
            clientChannel.close();
        }
        if (serverChannel != null) {
            serverChannel.close();
        }
        if (serverConnectedChannel != null) {

Frequently Asked Questions

What is the Http2MultiplexTransportTest class?
Http2MultiplexTransportTest is a class in the netty codebase, defined in codec-http2/src/test/java/io/netty/handler/codec/http2/Http2MultiplexTransportTest.java.
Where is Http2MultiplexTransportTest defined?
Http2MultiplexTransportTest is defined in codec-http2/src/test/java/io/netty/handler/codec/http2/Http2MultiplexTransportTest.java at line 98.

Analyze Your Own Codebase

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

Try Supermodel Free