Home / Function/ testNoSslHandshakeEventWhenNoHandshake() — netty Function Reference

testNoSslHandshakeEventWhenNoHandshake() — netty Function Reference

Architecture documentation for the testNoSslHandshakeEventWhenNoHandshake() function in SslHandlerTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  3a22f0f6_3628_287f_0969_0c79725f6f43["testNoSslHandshakeEventWhenNoHandshake()"]
  adaf7dc7_94e2_152f_ffdb_453fdaa4f25e["SslHandlerTest"]
  3a22f0f6_3628_287f_0969_0c79725f6f43 -->|defined in| adaf7dc7_94e2_152f_ffdb_453fdaa4f25e
  0fd148d9_de21_9e3d_3bde_be07148f32de["userEventTriggered()"]
  3a22f0f6_3628_287f_0969_0c79725f6f43 -->|calls| 0fd148d9_de21_9e3d_3bde_be07148f32de
  style 3a22f0f6_3628_287f_0969_0c79725f6f43 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler/src/test/java/io/netty/handler/ssl/SslHandlerTest.java lines 171–208

    @Test
    public void testNoSslHandshakeEventWhenNoHandshake() throws Exception {
        final AtomicBoolean inActive = new AtomicBoolean(false);

        SSLEngine engine = SSLContext.getDefault().createSSLEngine();
        EmbeddedChannel ch = new EmbeddedChannel(
                DefaultChannelId.newInstance(), false, false, new ChannelInboundHandlerAdapter() {
            @Override
            public void channelActive(ChannelHandlerContext ctx) throws Exception {
                // Not forward the event to the SslHandler but just close the Channel.
                ctx.close();
            }
        }, new SslHandler(engine) {
            @Override
            public void handlerAdded(ChannelHandlerContext ctx) throws Exception {
                // We want to override what Channel.isActive() will return as otherwise it will
                // return true and so trigger an handshake.
                inActive.set(true);
                super.handlerAdded(ctx);
                inActive.set(false);
            }
        }, new ChannelInboundHandlerAdapter() {
            @Override
            public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
                if (evt instanceof SslHandshakeCompletionEvent) {
                    throw (Exception) ((SslHandshakeCompletionEvent) evt).cause();
                }
            }
        }) {
            @Override
            public boolean isActive() {
                return !inActive.get() && super.isActive();
            }
        };

        ch.register();
        assertFalse(ch.finishAndReleaseAll());
    }

Domain

Subdomains

Frequently Asked Questions

What does testNoSslHandshakeEventWhenNoHandshake() do?
testNoSslHandshakeEventWhenNoHandshake() is a function in the netty codebase, defined in handler/src/test/java/io/netty/handler/ssl/SslHandlerTest.java.
Where is testNoSslHandshakeEventWhenNoHandshake() defined?
testNoSslHandshakeEventWhenNoHandshake() is defined in handler/src/test/java/io/netty/handler/ssl/SslHandlerTest.java at line 171.
What does testNoSslHandshakeEventWhenNoHandshake() call?
testNoSslHandshakeEventWhenNoHandshake() calls 1 function(s): userEventTriggered.

Analyze Your Own Codebase

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

Try Supermodel Free