Home / Function/ testDiscardTooLongFrame1() — netty Function Reference

testDiscardTooLongFrame1() — netty Function Reference

Architecture documentation for the testDiscardTooLongFrame1() function in LengthFieldBasedFrameDecoderTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  f0634da7_fb20_22a8_ac4e_d13ba085dfb7["testDiscardTooLongFrame1()"]
  645e888b_6989_fcf9_84fb_51b374370d95["LengthFieldBasedFrameDecoderTest"]
  f0634da7_fb20_22a8_ac4e_d13ba085dfb7 -->|defined in| 645e888b_6989_fcf9_84fb_51b374370d95
  style f0634da7_fb20_22a8_ac4e_d13ba085dfb7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-base/src/test/java/io/netty/handler/codec/LengthFieldBasedFrameDecoderTest.java lines 30–56

    @Test
    public void testDiscardTooLongFrame1() {
        ByteBuf buf = Unpooled.buffer();
        buf.writeInt(32);
        for (int i = 0; i < 32; i++) {
            buf.writeByte(i);
        }
        buf.writeInt(1);
        buf.writeByte('a');
        EmbeddedChannel channel = new EmbeddedChannel(new LengthFieldBasedFrameDecoder(16, 0, 4));
        try {
            channel.writeInbound(buf);
            fail();
        } catch (TooLongFrameException e) {
            // expected
        }
        assertTrue(channel.finish());

        ByteBuf b = channel.readInbound();
        assertEquals(5, b.readableBytes());
        assertEquals(1, b.readInt());
        assertEquals('a', b.readByte());
        b.release();

        assertNull(channel.readInbound());
        channel.finish();
    }

Domain

Subdomains

Frequently Asked Questions

What does testDiscardTooLongFrame1() do?
testDiscardTooLongFrame1() is a function in the netty codebase, defined in codec-base/src/test/java/io/netty/handler/codec/LengthFieldBasedFrameDecoderTest.java.
Where is testDiscardTooLongFrame1() defined?
testDiscardTooLongFrame1() is defined in codec-base/src/test/java/io/netty/handler/codec/LengthFieldBasedFrameDecoderTest.java at line 30.

Analyze Your Own Codebase

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

Try Supermodel Free