Home / Function/ testDecoderNoClientContext() — netty Function Reference

testDecoderNoClientContext() — netty Function Reference

Architecture documentation for the testDecoderNoClientContext() function in PerMessageDeflateClientExtensionHandshakerTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  9b3bc35a_22be_61bb_9245_f213e240b9ef["testDecoderNoClientContext()"]
  96c9ad65_49f4_dedc_4a3d_ff783cf8c162["PerMessageDeflateClientExtensionHandshakerTest"]
  9b3bc35a_22be_61bb_9245_f213e240b9ef -->|defined in| 96c9ad65_49f4_dedc_4a3d_ff783cf8c162
  style 9b3bc35a_22be_61bb_9245_f213e240b9ef fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/test/java/io/netty/handler/codec/http/websocketx/extensions/compression/PerMessageDeflateClientExtensionHandshakerTest.java lines 190–245

    @Test
    public void testDecoderNoClientContext() {
        PerMessageDeflateClientExtensionHandshaker handshaker =
                new PerMessageDeflateClientExtensionHandshaker(6, true, MAX_WINDOW_SIZE, true, false, 0);

        byte[] firstPayload = new byte[] {
                76, -50, -53, 10, -62, 48, 20, 4, -48, 95, 41, 89, -37, 36, 77, 90, 31, -39, 41, -72, 112, 33, -120, 20,
                20, 119, -79, 70, 123, -95, 121, -48, 92, -116, 80, -6, -17, -58, -99, -37, -31, 12, 51, 19, 1, -9, -12,
                68, -111, -117, 25, 58, 111, 77, -127, -66, -64, -34, 20, 59, -64, -29, -2, 90, -100, -115, 30, 16, 114,
                -68, 61, 29, 40, 89, -112, -73, 25, 35, 120, -105, -67, -32, -43, -70, -84, 120, -55, 69, 43, -124, 106,
                -92, 18, -110, 114, -50, 111, 25, -3, 10, 17, -75, 13, 127, -84, 106, 90, -66, 84, -75, 84, 53, -89,
                -75, 92, -3, -40, -61, 119, 49, -117, 30, 49, 68, -59, 88, 74, -119, -34, 1, -83, -7, -48, 124, -124,
                -23, 16, 88, -118, 121, 54, -53, 1, 44, 32, 81, 19, 25, -115, -43, -32, -64, -67, -120, -110, -101, 121,
                -2, 2
        };

        byte[] secondPayload = new byte[] {
                -86, 86, 42, 46, 77, 78, 78, 45, 6, 26, 83, 82, 84, -102, -86, 3, -28, 38, 21, 39, 23, 101, 38, -91, 2,
                -51, -51, 47, 74, 73, 45, 114, -54, -49, -49, -10, 49, -78, -118, 112, 10, 9, 13, 118, 1, -102, 84,
                -108, 90, 88, 10, 116, 27, -56, -84, 124, -112, -13, 16, 26, 116, -108, 18, -117, -46, -127, 6, 69, 99,
                -45, 24, 91, 91, 11, 0
        };

        Map<String, String> parameters =  Collections.singletonMap(CLIENT_NO_CONTEXT, null);

        WebSocketClientExtension extension = handshaker.handshakeExtension(
                new WebSocketExtensionData(PERMESSAGE_DEFLATE_EXTENSION, parameters));
        assertNotNull(extension);

        EmbeddedChannel decoderChannel = new EmbeddedChannel(extension.newExtensionDecoder());
        assertTrue(
                decoderChannel.writeInbound(new TextWebSocketFrame(true, RSV1, Unpooled.copiedBuffer(firstPayload))));
        TextWebSocketFrame firstFrameDecompressed = decoderChannel.readInbound();
        assertTrue(
                decoderChannel.writeInbound(new TextWebSocketFrame(true, RSV1, Unpooled.copiedBuffer(secondPayload))));
        TextWebSocketFrame secondFrameDecompressed = decoderChannel.readInbound();

        assertNotNull(firstFrameDecompressed);
        assertNotNull(firstFrameDecompressed.content());
        assertTrue(firstFrameDecompressed instanceof TextWebSocketFrame);
        assertEquals(firstFrameDecompressed.text(),
                     "{\"info\":\"Welcome to the BitMEX Realtime API.\",\"version\"" +
                     ":\"2018-10-02T22:53:23.000Z\",\"timestamp\":\"2018-10-15T06:43:40.437Z\"," +
                     "\"docs\":\"https://www.bitmex.com/app/wsAPI\",\"limit\":{\"remaining\":39}}");
        assertTrue(firstFrameDecompressed.release());

        assertNotNull(secondFrameDecompressed);
        assertNotNull(secondFrameDecompressed.content());
        assertTrue(secondFrameDecompressed instanceof TextWebSocketFrame);
        assertEquals(secondFrameDecompressed.text(),
                     "{\"success\":true,\"subscribe\":\"orderBookL2:XBTUSD\"," +
                     "\"request\":{\"op\":\"subscribe\",\"args\":[\"orderBookL2:XBTUSD\"]}}");
        assertTrue(secondFrameDecompressed.release());

        assertFalse(decoderChannel.finish());
    }

Domain

Subdomains

Frequently Asked Questions

What does testDecoderNoClientContext() do?
testDecoderNoClientContext() is a function in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/http/websocketx/extensions/compression/PerMessageDeflateClientExtensionHandshakerTest.java.
Where is testDecoderNoClientContext() defined?
testDecoderNoClientContext() is defined in codec-http/src/test/java/io/netty/handler/codec/http/websocketx/extensions/compression/PerMessageDeflateClientExtensionHandshakerTest.java at line 190.

Analyze Your Own Codebase

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

Try Supermodel Free