Home / Function/ testUpgrade() — netty Function Reference

testUpgrade() — netty Function Reference

Architecture documentation for the testUpgrade() function in Http2ClientUpgradeCodecTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  841a489a_2b43_8386_4324_5135b611f75b["testUpgrade()"]
  6a7cc45f_da6d_114a_431c_4c918d4aed61["Http2ClientUpgradeCodecTest"]
  841a489a_2b43_8386_4324_5135b611f75b -->|defined in| 6a7cc45f_da6d_114a_431c_4c918d4aed61
  23697de5_1395_bc7d_c1f7_1512b84d6e7f["testUpgradeToHttp2ConnectionHandler()"]
  23697de5_1395_bc7d_c1f7_1512b84d6e7f -->|calls| 841a489a_2b43_8386_4324_5135b611f75b
  94cf2f90_a330_e104_ce0c_aa7e3708d5c6["testUpgradeToHttp2FrameCodec()"]
  94cf2f90_a330_e104_ce0c_aa7e3708d5c6 -->|calls| 841a489a_2b43_8386_4324_5135b611f75b
  e0a973db_9ce6_02ce_54a6_011f4da02e0b["testUpgradeToHttp2MultiplexCodec()"]
  e0a973db_9ce6_02ce_54a6_011f4da02e0b -->|calls| 841a489a_2b43_8386_4324_5135b611f75b
  4c53ef62_a0fe_543d_f1ae_34bad6b90abb["testUpgradeToHttp2FrameCodecWithMultiplexer()"]
  4c53ef62_a0fe_543d_f1ae_34bad6b90abb -->|calls| 841a489a_2b43_8386_4324_5135b611f75b
  style 841a489a_2b43_8386_4324_5135b611f75b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/test/java/io/netty/handler/codec/http2/Http2ClientUpgradeCodecTest.java lines 55–82

    private static void testUpgrade(Http2ConnectionHandler handler, Http2MultiplexHandler multiplexer)
            throws Exception {
        FullHttpRequest request = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.OPTIONS, "*");

        EmbeddedChannel channel = new EmbeddedChannel(new ChannelInboundHandlerAdapter());
        ChannelHandlerContext ctx = channel.pipeline().firstContext();

        Http2ClientUpgradeCodec codec;

        if (multiplexer == null) {
            codec = new Http2ClientUpgradeCodec("connectionHandler", handler);
        } else {
            codec = new Http2ClientUpgradeCodec("connectionHandler", handler, multiplexer);
        }

        codec.setUpgradeHeaders(ctx, request);
        // Flush the channel to ensure we write out all buffered data
        channel.flush();

        codec.upgradeTo(ctx, null);
        assertNotNull(channel.pipeline().get("connectionHandler"));

        if (multiplexer != null) {
            assertNotNull(channel.pipeline().get(Http2MultiplexHandler.class));
        }

        assertTrue(channel.finishAndReleaseAll());
    }

Domain

Subdomains

Frequently Asked Questions

What does testUpgrade() do?
testUpgrade() is a function in the netty codebase, defined in codec-http2/src/test/java/io/netty/handler/codec/http2/Http2ClientUpgradeCodecTest.java.
Where is testUpgrade() defined?
testUpgrade() is defined in codec-http2/src/test/java/io/netty/handler/codec/http2/Http2ClientUpgradeCodecTest.java at line 55.
What calls testUpgrade()?
testUpgrade() is called by 4 function(s): testUpgradeToHttp2ConnectionHandler, testUpgradeToHttp2FrameCodec, testUpgradeToHttp2FrameCodecWithMultiplexer, testUpgradeToHttp2MultiplexCodec.

Analyze Your Own Codebase

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

Try Supermodel Free