Home / Class/ StompSubframeDecoderTest Class — netty Architecture

StompSubframeDecoderTest Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  f11558ca_762b_56f8_ed96_df83259d279f["StompSubframeDecoderTest"]
  838cb271_f6d5_a801_6158_0fc340257826["StompSubframeDecoderTest.java"]
  f11558ca_762b_56f8_ed96_df83259d279f -->|defined in| 838cb271_f6d5_a801_6158_0fc340257826
  cc9b833b_c19b_87e6_585d_a0da080982f0["setup()"]
  f11558ca_762b_56f8_ed96_df83259d279f -->|method| cc9b833b_c19b_87e6_585d_a0da080982f0
  28edb266_a6a5_cfd3_0698_60ece7c2a9df["teardown()"]
  f11558ca_762b_56f8_ed96_df83259d279f -->|method| 28edb266_a6a5_cfd3_0698_60ece7c2a9df
  16f03c81_325a_a693_49e3_20d5044f1b9c["testSingleFrameDecoding()"]
  f11558ca_762b_56f8_ed96_df83259d279f -->|method| 16f03c81_325a_a693_49e3_20d5044f1b9c
  5125112b_4c47_df28_c183_de32adf0ff5b["testSingleFrameWithBodyAndContentLength()"]
  f11558ca_762b_56f8_ed96_df83259d279f -->|method| 5125112b_4c47_df28_c183_de32adf0ff5b
  21a0dc19_f603_8697_338f_a69055a7d353["testSingleFrameWithBodyWithoutContentLength()"]
  f11558ca_762b_56f8_ed96_df83259d279f -->|method| 21a0dc19_f603_8697_338f_a69055a7d353
  8a38f173_f06f_5ea0_80ba_82b432785825["testSingleFrameChunked()"]
  f11558ca_762b_56f8_ed96_df83259d279f -->|method| 8a38f173_f06f_5ea0_80ba_82b432785825
  ad77c9dd_22af_9cc4_7b7f_59f35037847a["testMultipleFramesDecoding()"]
  f11558ca_762b_56f8_ed96_df83259d279f -->|method| ad77c9dd_22af_9cc4_7b7f_59f35037847a
  1a9b2e30_bed9_0aac_8948_40cb3438d6b1["testValidateHeadersDecodingDisabled()"]
  f11558ca_762b_56f8_ed96_df83259d279f -->|method| 1a9b2e30_bed9_0aac_8948_40cb3438d6b1
  76e92612_9202_4690_e510_f11aa5c5f32c["testValidateHeadersDecodingEnabled()"]
  f11558ca_762b_56f8_ed96_df83259d279f -->|method| 76e92612_9202_4690_e510_f11aa5c5f32c
  2f4c2197_56bb_6260_593d_b0b573ecaec1["testNotValidFrameWithEmptyHeaderName()"]
  f11558ca_762b_56f8_ed96_df83259d279f -->|method| 2f4c2197_56bb_6260_593d_b0b573ecaec1
  a3cafb7d_ff1a_b76a_6d1b_93d9d8acc53c["testUtf8FrameDecoding()"]
  f11558ca_762b_56f8_ed96_df83259d279f -->|method| a3cafb7d_ff1a_b76a_6d1b_93d9d8acc53c
  8c2355ff_34a1_9264_e0a4_05edecd54da6["testFrameWithContentLengthAndWithoutNullEnding()"]
  f11558ca_762b_56f8_ed96_df83259d279f -->|method| 8c2355ff_34a1_9264_e0a4_05edecd54da6
  cc011fd8_79e8_e0f3_73b7_14dbee87bfa4["testUnescapeHeaders()"]
  f11558ca_762b_56f8_ed96_df83259d279f -->|method| cc011fd8_79e8_e0f3_73b7_14dbee87bfa4

Relationship Graph

Source Code

codec-stomp/src/test/java/io/netty/handler/codec/stomp/StompSubframeDecoderTest.java lines 34–334

public class StompSubframeDecoderTest {

    private EmbeddedChannel channel;

    @BeforeEach
    public void setup() throws Exception {
        channel = new EmbeddedChannel(new StompSubframeDecoder());
    }

    @AfterEach
    public void teardown() throws Exception {
        assertFalse(channel.finish());
    }

    @Test
    public void testSingleFrameDecoding() {
        ByteBuf incoming = Unpooled.buffer();
        incoming.writeBytes(StompTestConstants.CONNECT_FRAME.getBytes());
        channel.writeInbound(incoming);

        StompHeadersSubframe frame = channel.readInbound();
        assertNotNull(frame);
        assertEquals(StompCommand.CONNECT, frame.command());

        StompContentSubframe content = channel.readInbound();
        assertSame(LastStompContentSubframe.EMPTY_LAST_CONTENT, content);
        content.release();

        Object o = channel.readInbound();
        assertNull(o);
    }

    @Test
    public void testSingleFrameWithBodyAndContentLength() {
        ByteBuf incoming = Unpooled.buffer();
        incoming.writeBytes(StompTestConstants.SEND_FRAME_2.getBytes());
        channel.writeInbound(incoming);

        StompHeadersSubframe frame = channel.readInbound();
        assertNotNull(frame);
        assertEquals(StompCommand.SEND, frame.command());

        StompContentSubframe content = channel.readInbound();
        assertTrue(content instanceof LastStompContentSubframe);
        String s = content.content().toString(UTF_8);
        assertEquals("hello, queue a!!!", s);
        content.release();

        assertNull(channel.readInbound());
    }

    @Test
    public void testSingleFrameWithBodyWithoutContentLength() {
        ByteBuf incoming = Unpooled.buffer();
        incoming.writeBytes(StompTestConstants.SEND_FRAME_1.getBytes());
        channel.writeInbound(incoming);

        StompHeadersSubframe frame = channel.readInbound();
        assertNotNull(frame);
        assertEquals(StompCommand.SEND, frame.command());

        StompContentSubframe content = channel.readInbound();
        assertTrue(content instanceof LastStompContentSubframe);
        String s = content.content().toString(UTF_8);
        assertEquals("hello, queue a!", s);
        content.release();

        assertNull(channel.readInbound());
    }

    @Test
    public void testSingleFrameChunked() {
        EmbeddedChannel channel = new EmbeddedChannel(new StompSubframeDecoder(10000, 5));

        ByteBuf incoming = Unpooled.buffer();
        incoming.writeBytes(StompTestConstants.SEND_FRAME_2.getBytes());
        channel.writeInbound(incoming);

        StompHeadersSubframe frame = channel.readInbound();
        assertNotNull(frame);
        assertEquals(StompCommand.SEND, frame.command());

Frequently Asked Questions

What is the StompSubframeDecoderTest class?
StompSubframeDecoderTest is a class in the netty codebase, defined in codec-stomp/src/test/java/io/netty/handler/codec/stomp/StompSubframeDecoderTest.java.
Where is StompSubframeDecoderTest defined?
StompSubframeDecoderTest is defined in codec-stomp/src/test/java/io/netty/handler/codec/stomp/StompSubframeDecoderTest.java at line 34.

Analyze Your Own Codebase

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

Try Supermodel Free