testUpgrade0() — netty Function Reference
Architecture documentation for the testUpgrade0() function in WebSocketServerHandshaker13Test.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 9b413e61_113c_d4ee_061a_59cd3c3e3003["testUpgrade0()"] b3c12c47_d3a9_1bed_608c_a4b3745e9ee9["WebSocketServerHandshaker13Test"] 9b413e61_113c_d4ee_061a_59cd3c3e3003 -->|defined in| b3c12c47_d3a9_1bed_608c_a4b3745e9ee9 6bd3fdb0_79e7_8d7b_ab53_b73429c54634["testPerformOpeningHandshake0()"] 6bd3fdb0_79e7_8d7b_ab53_b73429c54634 -->|calls| 9b413e61_113c_d4ee_061a_59cd3c3e3003 db76d3df_c369_afe2_c78b_74447024f363["testCloseReason0()"] db76d3df_c369_afe2_c78b_74447024f363 -->|calls| 9b413e61_113c_d4ee_061a_59cd3c3e3003 style 9b413e61_113c_d4ee_061a_59cd3c3e3003 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
codec-http/src/test/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshaker13Test.java lines 195–224
private static void testUpgrade0(EmbeddedChannel ch, WebSocketServerHandshaker13 handshaker) {
FullHttpRequest req = new DefaultFullHttpRequest(HTTP_1_1, HttpMethod.GET, "/chat");
req.headers().set(HttpHeaderNames.HOST, "server.example.com");
req.headers().set(HttpHeaderNames.UPGRADE, HttpHeaderValues.WEBSOCKET);
req.headers().set(HttpHeaderNames.CONNECTION, "Upgrade");
req.headers().set(HttpHeaderNames.SEC_WEBSOCKET_KEY, "dGhlIHNhbXBsZSBub25jZQ==");
req.headers().set(HttpHeaderNames.SEC_WEBSOCKET_ORIGIN, "http://example.com");
req.headers().set(HttpHeaderNames.SEC_WEBSOCKET_PROTOCOL, "chat, superchat");
req.headers().set(HttpHeaderNames.SEC_WEBSOCKET_VERSION, "13");
handshaker.handshake(ch, req);
ByteBuf resBuf = ch.readOutbound();
EmbeddedChannel ch2 = new EmbeddedChannel(new HttpResponseDecoder());
ch2.writeInbound(resBuf);
HttpResponse res = ch2.readInbound();
assertEquals(
"s3pPLMBiTxaQ9kYGzzhZRbK+xOo=", res.headers().get(HttpHeaderNames.SEC_WEBSOCKET_ACCEPT));
Iterator<String> subProtocols = handshaker.subprotocols().iterator();
if (subProtocols.hasNext()) {
assertEquals(subProtocols.next(),
res.headers().get(HttpHeaderNames.SEC_WEBSOCKET_PROTOCOL));
} else {
assertNull(res.headers().get(HttpHeaderNames.SEC_WEBSOCKET_PROTOCOL));
}
ReferenceCountUtil.release(res);
req.release();
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does testUpgrade0() do?
testUpgrade0() is a function in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshaker13Test.java.
Where is testUpgrade0() defined?
testUpgrade0() is defined in codec-http/src/test/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshaker13Test.java at line 195.
What calls testUpgrade0()?
testUpgrade0() is called by 2 function(s): testCloseReason0, testPerformOpeningHandshake0.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free