Home / Class/ Http2MaxRstFrameListenerTest Class — netty Architecture

Http2MaxRstFrameListenerTest Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  6a7eeddd_d388_257d_4d94_20d125b2339f["Http2MaxRstFrameListenerTest"]
  8522347f_1698_b53b_2bc5_2bc9c38349e8["Http2MaxRstFrameListenerTest.java"]
  6a7eeddd_d388_257d_4d94_20d125b2339f -->|defined in| 8522347f_1698_b53b_2bc5_2bc9c38349e8
  b58534aa_cf0c_5f41_5ae2_31b744c5fcc4["setUp()"]
  6a7eeddd_d388_257d_4d94_20d125b2339f -->|method| b58534aa_cf0c_5f41_5ae2_31b744c5fcc4
  51a5dde7_64a3_35fe_e82b_cd4228a0959f["testMaxRstFramesReached()"]
  6a7eeddd_d388_257d_4d94_20d125b2339f -->|method| 51a5dde7_64a3_35fe_e82b_cd4228a0959f
  3e5da83b_5448_35c0_cfdf_22e40400b99d["testRstFrames()"]
  6a7eeddd_d388_257d_4d94_20d125b2339f -->|method| 3e5da83b_5448_35c0_cfdf_22e40400b99d

Relationship Graph

Source Code

codec-http2/src/test/java/io/netty/handler/codec/http2/Http2MaxRstFrameListenerTest.java lines 31–68

public class Http2MaxRstFrameListenerTest {

    @Mock
    private Http2FrameListener frameListener;
    @Mock
    private ChannelHandlerContext ctx;

    private Http2MaxRstFrameListener listener;

    @BeforeEach
    public void setUp() {
        initMocks(this);
    }

    @Test
    public void testMaxRstFramesReached() throws Http2Exception {
        listener = new Http2MaxRstFrameListener(frameListener, 1, 10);
        listener.onRstStreamRead(ctx, 1, Http2Error.STREAM_CLOSED.code());

        Http2Exception ex = assertThrows(Http2Exception.class, new Executable() {
            @Override
            public void execute() throws Throwable {
                listener.onRstStreamRead(ctx, 2, Http2Error.STREAM_CLOSED.code());
            }
        });
        assertEquals(Http2Error.ENHANCE_YOUR_CALM, ex.error());
        verify(frameListener, times(1)).onRstStreamRead(eq(ctx), anyInt(), eq(Http2Error.STREAM_CLOSED.code()));
    }

    @Test
    public void testRstFrames() throws Exception {
        listener = new Http2MaxRstFrameListener(frameListener, 1, 1);
        listener.onRstStreamRead(ctx, 1, Http2Error.STREAM_CLOSED.code());
        Thread.sleep(1100);
        listener.onRstStreamRead(ctx, 1, Http2Error.STREAM_CLOSED.code());
        verify(frameListener, times(2)).onRstStreamRead(eq(ctx), anyInt(), eq(Http2Error.STREAM_CLOSED.code()));
    }
}

Frequently Asked Questions

What is the Http2MaxRstFrameListenerTest class?
Http2MaxRstFrameListenerTest is a class in the netty codebase, defined in codec-http2/src/test/java/io/netty/handler/codec/http2/Http2MaxRstFrameListenerTest.java.
Where is Http2MaxRstFrameListenerTest defined?
Http2MaxRstFrameListenerTest is defined in codec-http2/src/test/java/io/netty/handler/codec/http2/Http2MaxRstFrameListenerTest.java at line 31.

Analyze Your Own Codebase

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

Try Supermodel Free