testHandshakeSuccess0() — netty Function Reference
Architecture documentation for the testHandshakeSuccess0() function in ApplicationProtocolNegotiationHandlerTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 50b8bb54_1471_d7ba_771d_3f6a997c9300["testHandshakeSuccess0()"] 6a59c536_b4df_055a_02c9_49ed1745fd53["ApplicationProtocolNegotiationHandlerTest"] 50b8bb54_1471_d7ba_771d_3f6a997c9300 -->|defined in| 6a59c536_b4df_055a_02c9_49ed1745fd53 85025863_6068_fc53_cdb6_4b7cbb569925["testHandshakeSuccess()"] 85025863_6068_fc53_cdb6_4b7cbb569925 -->|calls| 50b8bb54_1471_d7ba_771d_3f6a997c9300 2f68ab88_f51a_2a42_93b5_8b3c8210f66c["testHandshakeSuccessWithSslHandlerAddedLater()"] 2f68ab88_f51a_2a42_93b5_8b3c8210f66c -->|calls| 50b8bb54_1471_d7ba_771d_3f6a997c9300 style 50b8bb54_1471_d7ba_771d_3f6a997c9300 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
handler/src/test/java/io/netty/handler/ssl/ApplicationProtocolNegotiationHandlerTest.java lines 101–132
private static void testHandshakeSuccess0(boolean addLater) throws NoSuchAlgorithmException {
final AtomicBoolean configureCalled = new AtomicBoolean(false);
ChannelHandler alpnHandler = new ApplicationProtocolNegotiationHandler(ApplicationProtocolNames.HTTP_1_1) {
@Override
protected void configurePipeline(ChannelHandlerContext ctx, String protocol) {
configureCalled.set(true);
assertEquals(ApplicationProtocolNames.HTTP_1_1, protocol);
}
};
SSLEngine engine = SSLContext.getDefault().createSSLEngine();
// This test is mocked/simulated and doesn't go through full TLS handshake. Currently only JDK SSLEngineImpl
// client mode will generate a close_notify.
engine.setUseClientMode(true);
EmbeddedChannel channel = new EmbeddedChannel();
if (addLater) {
channel.pipeline().addLast(alpnHandler);
channel.pipeline().addFirst(new SslHandler(engine));
} else {
channel.pipeline().addLast(new SslHandler(engine));
channel.pipeline().addLast(alpnHandler);
}
channel.pipeline().fireUserEventTriggered(SslHandshakeCompletionEvent.SUCCESS);
assertNull(channel.pipeline().context(alpnHandler));
// Should produce the close_notify messages
channel.releaseOutbound();
channel.close();
assertCloseNotify((ByteBuf) channel.readOutbound());
channel.finishAndReleaseAll();
assertTrue(configureCalled.get());
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does testHandshakeSuccess0() do?
testHandshakeSuccess0() is a function in the netty codebase, defined in handler/src/test/java/io/netty/handler/ssl/ApplicationProtocolNegotiationHandlerTest.java.
Where is testHandshakeSuccess0() defined?
testHandshakeSuccess0() is defined in handler/src/test/java/io/netty/handler/ssl/ApplicationProtocolNegotiationHandlerTest.java at line 101.
What calls testHandshakeSuccess0()?
testHandshakeSuccess0() is called by 2 function(s): testHandshakeSuccess, testHandshakeSuccessWithSslHandlerAddedLater.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free