Home / Class/ SpdyFrameCodecTest Class — netty Architecture

SpdyFrameCodecTest Class — netty Architecture

Architecture documentation for the SpdyFrameCodecTest class in SpdyFrameCodecTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  1ad92d84_b4de_7e27_0722_9e65bbb5aa45["SpdyFrameCodecTest"]
  0b708b77_23da_c7d5_15b3_0cd4b098d0cf["SpdyFrameCodecTest.java"]
  1ad92d84_b4de_7e27_0722_9e65bbb5aa45 -->|defined in| 0b708b77_23da_c7d5_15b3_0cd4b098d0cf
  757f413c_9c68_ff8e_44ec_006b60351bd1["testDecodeUnknownFrame()"]
  1ad92d84_b4de_7e27_0722_9e65bbb5aa45 -->|method| 757f413c_9c68_ff8e_44ec_006b60351bd1
  e03770de_140e_0280_3bb7_96b29fdc76d0["testEncodeUnknownFrame()"]
  1ad92d84_b4de_7e27_0722_9e65bbb5aa45 -->|method| e03770de_140e_0280_3bb7_96b29fdc76d0

Relationship Graph

Source Code

codec-http/src/test/java/io/netty/handler/codec/spdy/SpdyFrameCodecTest.java lines 26–78

public class SpdyFrameCodecTest {
    private final SpdyFrameCodec codec = new SpdyFrameCodec(
            SpdyVersion.SPDY_3_1, 8192, 16384, 6, 15, 8, true, true) {
        @Override
        protected boolean isValidUnknownFrameHeader(final int streamId,
                                                    final int type,
                                                    final byte flags,
                                                    final int length) {
            return true;
        }
    };
    private final EmbeddedChannel channel = new EmbeddedChannel(
        codec
    );

    @Test
    public void testDecodeUnknownFrame() {
        final SpdyFrameEncoder encoder = new SpdyFrameEncoder(SpdyVersion.SPDY_3_1);
        final ByteBuf buf = encoder.encodeUnknownFrame(
            UnpooledByteBufAllocator.DEFAULT,
            200,
            (byte) 13,
            Unpooled.wrappedBuffer("Hello, world!".getBytes(CharsetUtil.UTF_8)));
        channel.writeInbound(buf);
        SpdyUnknownFrame frame = channel.readInbound();
        Assertions.assertNotNull(frame);
        Assertions.assertEquals(200, frame.frameType());
        Assertions.assertEquals((byte) 13, frame.flags());
        ByteBuf data = frame.content();
        Assertions.assertEquals("Hello, world!", data.toString(CharsetUtil.UTF_8));
        data.release();
    }

    @Test
    public void testEncodeUnknownFrame() {
        final SpdyUnknownFrame spdyUnknownFrame = new DefaultSpdyUnknownFrame(
            200,
            (byte) 13,
            Unpooled.wrappedBuffer("Hello, world!".getBytes(CharsetUtil.UTF_8)));
        channel.writeOutbound(spdyUnknownFrame);
        ByteBuf buf = channel.readOutbound();
        Assertions.assertNotNull(buf);
        channel.writeInbound(buf);
        SpdyUnknownFrame frame = channel.readInbound();
        Assertions.assertNotNull(frame);
        Assertions.assertEquals(200, frame.frameType());
        Assertions.assertEquals((byte) 13, frame.flags());
        ByteBuf data = frame.content();
        Assertions.assertEquals("Hello, world!", data.toString(CharsetUtil.UTF_8));
        data.release();
    }

}

Frequently Asked Questions

What is the SpdyFrameCodecTest class?
SpdyFrameCodecTest is a class in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/spdy/SpdyFrameCodecTest.java.
Where is SpdyFrameCodecTest defined?
SpdyFrameCodecTest is defined in codec-http/src/test/java/io/netty/handler/codec/spdy/SpdyFrameCodecTest.java at line 26.

Analyze Your Own Codebase

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

Try Supermodel Free