Home / Function/ largeDataFrameShouldMatch() — netty Function Reference

largeDataFrameShouldMatch() — netty Function Reference

Architecture documentation for the largeDataFrameShouldMatch() function in Http2FrameRoundtripTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  243c1c92_d039_1775_0586_dd3e7b77cb19["largeDataFrameShouldMatch()"]
  900e14d5_99d5_0a22_aeb4_72af4ffe3fca["Http2FrameRoundtripTest"]
  243c1c92_d039_1775_0586_dd3e7b77cb19 -->|defined in| 900e14d5_99d5_0a22_aeb4_72af4ffe3fca
  2ccb6e24_01de_9d82_8893_0e095430f4da["readFrames()"]
  243c1c92_d039_1775_0586_dd3e7b77cb19 -->|calls| 2ccb6e24_01de_9d82_8893_0e095430f4da
  style 243c1c92_d039_1775_0586_dd3e7b77cb19 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/test/java/io/netty/handler/codec/http2/Http2FrameRoundtripTest.java lines 169–205

    @Test
    public void largeDataFrameShouldMatch() throws Exception {
        // Create a large message to force chunking.
        final ByteBuf originalData = data(1024 * 1024);
        final int originalPadding = 100;
        final boolean endOfStream = true;

        writer.writeData(ctx, STREAM_ID, originalData.slice(), originalPadding,
                endOfStream, ctx.newPromise());
        readFrames();

        // Verify that at least one frame was sent with eos=false and exactly one with eos=true.
        verify(listener, atLeastOnce()).onDataRead(eq(ctx), eq(STREAM_ID), any(ByteBuf.class),
                anyInt(), eq(false));
        verify(listener).onDataRead(eq(ctx), eq(STREAM_ID), any(ByteBuf.class),
                anyInt(), eq(true));

        // Capture the read data and padding.
        ArgumentCaptor<ByteBuf> dataCaptor = ArgumentCaptor.forClass(ByteBuf.class);
        ArgumentCaptor<Integer> paddingCaptor = ArgumentCaptor.forClass(Integer.class);
        verify(listener, atLeastOnce()).onDataRead(eq(ctx), eq(STREAM_ID), dataCaptor.capture(),
                paddingCaptor.capture(), anyBoolean());

        // Make sure the data matches the original.
        for (ByteBuf chunk : dataCaptor.getAllValues()) {
            ByteBuf originalChunk = originalData.readSlice(chunk.readableBytes());
            assertEquals(originalChunk, chunk);
        }
        assertFalse(originalData.isReadable());

        // Make sure the padding matches the original.
        int totalReadPadding = 0;
        for (int framePadding : paddingCaptor.getAllValues()) {
            totalReadPadding += framePadding;
        }
        assertEquals(originalPadding, totalReadPadding);
    }

Domain

Subdomains

Calls

Frequently Asked Questions

What does largeDataFrameShouldMatch() do?
largeDataFrameShouldMatch() is a function in the netty codebase, defined in codec-http2/src/test/java/io/netty/handler/codec/http2/Http2FrameRoundtripTest.java.
Where is largeDataFrameShouldMatch() defined?
largeDataFrameShouldMatch() is defined in codec-http2/src/test/java/io/netty/handler/codec/http2/Http2FrameRoundtripTest.java at line 169.
What does largeDataFrameShouldMatch() call?
largeDataFrameShouldMatch() calls 1 function(s): readFrames.

Analyze Your Own Codebase

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

Try Supermodel Free