Home / Function/ testMajorVersionNot3() — netty Function Reference

testMajorVersionNot3() — netty Function Reference

Architecture documentation for the testMajorVersionNot3() function in SniHandlerTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  72581b62_3ddc_fa4d_8223_78ba93f28a95["testMajorVersionNot3()"]
  00b45f27_cbf5_af92_430f_7f0426117fa5["SniHandlerTest"]
  72581b62_3ddc_fa4d_8223_78ba93f28a95 -->|defined in| 00b45f27_cbf5_af92_430f_7f0426117fa5
  495097de_5185_3185_66b9_43abc32cf9ab["releaseAll()"]
  72581b62_3ddc_fa4d_8223_78ba93f28a95 -->|calls| 495097de_5185_3185_66b9_43abc32cf9ab
  style 72581b62_3ddc_fa4d_8223_78ba93f28a95 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler/src/test/java/io/netty/handler/ssl/SniHandlerTest.java lines 355–396

    @ParameterizedTest(name = "{index}: sslProvider={0}")
    @MethodSource("data")
    @Timeout(value = 10000, unit = TimeUnit.MILLISECONDS)
    public void testMajorVersionNot3(SslProvider provider) throws Exception {
        SslContext nettyContext = makeSslContext(provider, false);

        try {
            DomainNameMapping<SslContext> mapping = new DomainNameMappingBuilder<SslContext>(nettyContext).build();

            SniHandler handler = new SniHandler(mapping);
            EmbeddedChannel ch = new EmbeddedChannel(handler);

            // invalid
            byte[] message = {22, 2, 0, 0, 0};
            try {
                // Push the handshake message.
                ch.writeInbound(Unpooled.wrappedBuffer(message));
                // TODO(scott): This should fail because the engine should reject zero length records during handshake.
                // See https://github.com/netty/netty/issues/6348.
                // fail();
            } catch (Exception e) {
                // expected
            }

            ch.close();

            // Consume all the outbound data that may be produced by the SSLEngine.
            for (;;) {
                ByteBuf buf = ch.readOutbound();
                if (buf == null) {
                    break;
                }
                buf.release();
            }

            assertFalse(ch.finish());
            assertNull(handler.hostname());
            assertEquals(nettyContext, handler.sslContext());
        } finally {
            releaseAll(nettyContext);
        }
    }

Domain

Subdomains

Calls

Frequently Asked Questions

What does testMajorVersionNot3() do?
testMajorVersionNot3() is a function in the netty codebase, defined in handler/src/test/java/io/netty/handler/ssl/SniHandlerTest.java.
Where is testMajorVersionNot3() defined?
testMajorVersionNot3() is defined in handler/src/test/java/io/netty/handler/ssl/SniHandlerTest.java at line 355.
What does testMajorVersionNot3() call?
testMajorVersionNot3() calls 1 function(s): releaseAll.

Analyze Your Own Codebase

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

Try Supermodel Free