Home / Class/ ByteArrayDecoderTest Class — netty Architecture

ByteArrayDecoderTest Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  6b45786b_ccba_02c0_7a29_645c4b4a2ef8["ByteArrayDecoderTest"]
  767deba6_80c8_e4d7_01cb_a3ffb848197b["ByteArrayDecoderTest.java"]
  6b45786b_ccba_02c0_7a29_645c4b4a2ef8 -->|defined in| 767deba6_80c8_e4d7_01cb_a3ffb848197b
  876d17be_8481_c67e_cfef_f533133611a7["setUp()"]
  6b45786b_ccba_02c0_7a29_645c4b4a2ef8 -->|method| 876d17be_8481_c67e_cfef_f533133611a7
  206e8558_9d94_d87a_41d3_48cae1bab87a["testDecode()"]
  6b45786b_ccba_02c0_7a29_645c4b4a2ef8 -->|method| 206e8558_9d94_d87a_41d3_48cae1bab87a
  34d0be1b_74a5_c844_d789_fbc543dce389["testDecodeEmpty()"]
  6b45786b_ccba_02c0_7a29_645c4b4a2ef8 -->|method| 34d0be1b_74a5_c844_d789_fbc543dce389
  3dd439f0_5bad_774a_603f_d8d9a790d2e2["testDecodeOtherType()"]
  6b45786b_ccba_02c0_7a29_645c4b4a2ef8 -->|method| 3dd439f0_5bad_774a_603f_d8d9a790d2e2

Relationship Graph

Source Code

codec-base/src/test/java/io/netty/handler/codec/bytes/ByteArrayDecoderTest.java lines 29–58

public class ByteArrayDecoderTest {

    private EmbeddedChannel ch;

    @BeforeEach
    public void setUp() {
        ch = new EmbeddedChannel(new ByteArrayDecoder());
    }

    @Test
    public void testDecode() {
        byte[] b = new byte[2048];
        new Random().nextBytes(b);
        ch.writeInbound(wrappedBuffer(b));
        assertArrayEquals(b, ch.readInbound());
    }

    @Test
    public void testDecodeEmpty() {
        ch.writeInbound(EMPTY_BUFFER);
        assertArrayEquals(EmptyArrays.EMPTY_BYTES, ch.readInbound());
    }

    @Test
    public void testDecodeOtherType() {
        String str = "Meep!";
        ch.writeInbound(str);
        assertSame(str, ch.readInbound());
    }
}

Frequently Asked Questions

What is the ByteArrayDecoderTest class?
ByteArrayDecoderTest is a class in the netty codebase, defined in codec-base/src/test/java/io/netty/handler/codec/bytes/ByteArrayDecoderTest.java.
Where is ByteArrayDecoderTest defined?
ByteArrayDecoderTest is defined in codec-base/src/test/java/io/netty/handler/codec/bytes/ByteArrayDecoderTest.java at line 29.

Analyze Your Own Codebase

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

Try Supermodel Free