Home / Class/ ReplayingDecoderByteBufTest Class — netty Architecture

ReplayingDecoderByteBufTest Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  ef895588_b14f_ef47_4065_265c5001cad2["ReplayingDecoderByteBufTest"]
  a76ef716_d5d7_32f8_6626_eae3c1e2c8a9["ReplayingDecoderByteBufTest.java"]
  ef895588_b14f_ef47_4065_265c5001cad2 -->|defined in| a76ef716_d5d7_32f8_6626_eae3c1e2c8a9
  8b0d5954_dfe1_a3e4_d446_a9c92d4eb457["testGetUnsignedByte()"]
  ef895588_b14f_ef47_4065_265c5001cad2 -->|method| 8b0d5954_dfe1_a3e4_d446_a9c92d4eb457
  d7234ecc_e373_72c0_46af_f6d4a1839aae["testGetByte()"]
  ef895588_b14f_ef47_4065_265c5001cad2 -->|method| d7234ecc_e373_72c0_46af_f6d4a1839aae
  3eed34b8_8ee5_3b7b_d977_0335344e7dd7["testGetBoolean()"]
  ef895588_b14f_ef47_4065_265c5001cad2 -->|method| 3eed34b8_8ee5_3b7b_d977_0335344e7dd7
  a53a5951_db25_2003_4607_7027e716fa22["testRetainedSlice()"]
  ef895588_b14f_ef47_4065_265c5001cad2 -->|method| a53a5951_db25_2003_4607_7027e716fa22

Relationship Graph

Source Code

codec-base/src/test/java/io/netty/handler/codec/ReplayingDecoderByteBufTest.java lines 27–129

public class ReplayingDecoderByteBufTest {

    /**
     * See https://github.com/netty/netty/issues/445
     */
    @Test
    public void testGetUnsignedByte() {
        ByteBuf buf = Unpooled.copiedBuffer("TestBuffer", CharsetUtil.ISO_8859_1);
        ReplayingDecoderByteBuf buffer = new ReplayingDecoderByteBuf(buf);

        boolean error;
        int i = 0;
        try {
            for (;;) {
                buffer.getUnsignedByte(i);
                i++;
            }
        } catch (Signal e) {
            error = true;
        }

        assertTrue(error);
        assertEquals(10, i);

        buf.release();
    }

    /**
     * See https://github.com/netty/netty/issues/445
     */
    @Test
    public void testGetByte() {
        ByteBuf buf = Unpooled.copiedBuffer("TestBuffer", CharsetUtil.ISO_8859_1);
        ReplayingDecoderByteBuf buffer = new ReplayingDecoderByteBuf(buf);

        boolean error;
        int i = 0;
        try {
            for (;;) {
                buffer.getByte(i);
                i++;
            }
        } catch (Signal e) {
            error = true;
        }

        assertTrue(error);
        assertEquals(10, i);

        buf.release();
    }

    /**
     * See https://github.com/netty/netty/issues/445
     */
    @Test
    public void testGetBoolean() {
        ByteBuf buf = Unpooled.buffer(10);
        while (buf.isWritable()) {
            buf.writeBoolean(true);
        }
        ReplayingDecoderByteBuf buffer = new ReplayingDecoderByteBuf(buf);

        boolean error;
        int i = 0;
        try {
            for (;;) {
                buffer.getBoolean(i);
                i++;
            }
        } catch (Signal e) {
            error = true;
        }

        assertTrue(error);
        assertEquals(10, i);

        buf.release();
    }

    // See https://github.com/netty/netty/issues/13455

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free