Home / Class/ StompSubframeAggregatorTest Class — netty Architecture

StompSubframeAggregatorTest Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  515cb9ca_06ef_9a6b_e66b_7e043c0973ff["StompSubframeAggregatorTest"]
  1fed19ce_b5e8_bfa1_daf1_99c8a69cc934["StompSubframeAggregatorTest.java"]
  515cb9ca_06ef_9a6b_e66b_7e043c0973ff -->|defined in| 1fed19ce_b5e8_bfa1_daf1_99c8a69cc934
  93e911bb_b0fe_cdcc_db88_93bf63bb590d["setup()"]
  515cb9ca_06ef_9a6b_e66b_7e043c0973ff -->|method| 93e911bb_b0fe_cdcc_db88_93bf63bb590d
  071ae51e_7051_a673_352f_c49732d51424["teardown()"]
  515cb9ca_06ef_9a6b_e66b_7e043c0973ff -->|method| 071ae51e_7051_a673_352f_c49732d51424
  4b66478c_1398_25fd_cdf7_e19edca00d0e["testSingleFrameDecoding()"]
  515cb9ca_06ef_9a6b_e66b_7e043c0973ff -->|method| 4b66478c_1398_25fd_cdf7_e19edca00d0e
  da05bf9b_6c71_f167_4336_983e067fb8c8["testSingleFrameWithBodyAndContentLength()"]
  515cb9ca_06ef_9a6b_e66b_7e043c0973ff -->|method| da05bf9b_6c71_f167_4336_983e067fb8c8
  8c19dda8_0895_b05e_4cbb_1feb0353656a["testSingleFrameWithBodyAndNoContentLength()"]
  515cb9ca_06ef_9a6b_e66b_7e043c0973ff -->|method| 8c19dda8_0895_b05e_4cbb_1feb0353656a
  e0c2151b_6525_b5e2_6443_ca3f318d4ecf["testSingleFrameWithSplitBodyAndNoContentLength()"]
  515cb9ca_06ef_9a6b_e66b_7e043c0973ff -->|method| e0c2151b_6525_b5e2_6443_ca3f318d4ecf
  e4f95fa5_f612_7dd9_67f6_1675ad017934["testSingleFrameChunked()"]
  515cb9ca_06ef_9a6b_e66b_7e043c0973ff -->|method| e4f95fa5_f612_7dd9_67f6_1675ad017934
  17e3b3b0_9b2c_341d_f516_3a3f2198119b["testMultipleFramesDecoding()"]
  515cb9ca_06ef_9a6b_e66b_7e043c0973ff -->|method| 17e3b3b0_9b2c_341d_f516_3a3f2198119b
  15d383f2_ea1e_8850_9f12_850ad3577b59["testTooLongFrameException()"]
  515cb9ca_06ef_9a6b_e66b_7e043c0973ff -->|method| 15d383f2_ea1e_8850_9f12_850ad3577b59

Relationship Graph

Source Code

codec-stomp/src/test/java/io/netty/handler/codec/stomp/StompSubframeAggregatorTest.java lines 34–158

public class StompSubframeAggregatorTest {

    private EmbeddedChannel channel;

    @BeforeEach
    public void setup() {
        channel = new EmbeddedChannel(new StompSubframeDecoder(), new StompSubframeAggregator(100000));
    }

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

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

        StompFrame frame = channel.readInbound();
        frame.release();

        assertNull(channel.readInbound());
    }

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

        StompFrame frame = channel.readInbound();
        assertNotNull(frame);
        assertEquals(StompCommand.SEND, frame.command());
        assertEquals("hello, queue a!!!", frame.content().toString(CharsetUtil.UTF_8));
        frame.release();

        assertNull(channel.readInbound());
    }

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

        StompFrame frame = channel.readInbound();
        assertNotNull(frame);
        assertEquals(StompCommand.SEND, frame.command());
        assertEquals("body", frame.content().toString(CharsetUtil.UTF_8));
        frame.release();

        assertNull(channel.readInbound());
    }

    @Test
    public void testSingleFrameWithSplitBodyAndNoContentLength() {
        for (int n = 0; n < StompTestConstants.SEND_FRAMES_3.length; ++n) {
            ByteBuf incoming = Unpooled.buffer();
            incoming.writeBytes(StompTestConstants.SEND_FRAMES_3[n].getBytes());
            channel.writeInbound(incoming);
            channel.flush();
        }

        StompFrame frame = channel.readInbound();
        assertNotNull(frame);
        assertEquals(StompCommand.SEND, frame.command());
        assertEquals("first part of body\nsecond part of body", frame.content().toString(CharsetUtil.UTF_8));
        frame.release();

        assertNull(channel.readInbound());
    }

    @Test
    public void testSingleFrameChunked() {
        EmbeddedChannel channel = new EmbeddedChannel(
                new StompSubframeDecoder(10000, 5), new StompSubframeAggregator(100000));
        ByteBuf incoming = Unpooled.buffer();
        incoming.writeBytes(StompTestConstants.SEND_FRAME_2.getBytes());
        channel.writeInbound(incoming);

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free