Home / Class/ Http2ConnectionRoundtripTest Class — netty Architecture

Http2ConnectionRoundtripTest Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  0d6189e8_c033_39ff_d087_9019351440fe["Http2ConnectionRoundtripTest"]
  8fd5f586_87b4_a024_0d46_4446f7598e5b["Http2ConnectionRoundtripTest.java"]
  0d6189e8_c033_39ff_d087_9019351440fe -->|defined in| 8fd5f586_87b4_a024_0d46_4446f7598e5b
  2d30a7cc_c97e_341f_dc17_6ebc435d434e["setup()"]
  0d6189e8_c033_39ff_d087_9019351440fe -->|method| 2d30a7cc_c97e_341f_dc17_6ebc435d434e
  d1e34b61_e24e_593b_e44a_f1adf275d59f["teardown()"]
  0d6189e8_c033_39ff_d087_9019351440fe -->|method| d1e34b61_e24e_593b_e44a_f1adf275d59f
  3ddf6044_f390_440e_808b_1a2bcf271f19["inflightFrameAfterStreamResetShouldNotMakeConnectionUnusable()"]
  0d6189e8_c033_39ff_d087_9019351440fe -->|method| 3ddf6044_f390_440e_808b_1a2bcf271f19
  bcc1b7fc_dfe6_0e61_18a5_ee61d86850af["headersWithEndStreamShouldNotSendError()"]
  0d6189e8_c033_39ff_d087_9019351440fe -->|method| bcc1b7fc_dfe6_0e61_18a5_ee61d86850af
  e115b447_6cad_967b_30a3_5a0da892beed["encodeViolatesMaxHeaderListSizeCanStillUseConnection()"]
  0d6189e8_c033_39ff_d087_9019351440fe -->|method| e115b447_6cad_967b_30a3_5a0da892beed
  f54d388f_d30d_8bd4_0f10_a022a29e39de["testSettingsAckIsSentBeforeUsingFlowControl()"]
  0d6189e8_c033_39ff_d087_9019351440fe -->|method| f54d388f_d30d_8bd4_0f10_a022a29e39de
  56d480f2_e781_ea14_217f_5e069e89de61["priorityUsingHigherValuedStreamIdDoesNotPreventUsingLowerStreamId()"]
  0d6189e8_c033_39ff_d087_9019351440fe -->|method| 56d480f2_e781_ea14_217f_5e069e89de61
  dde7be9c_363c_7ad0_e348_fa60e9ac1705["headersUsingHigherValuedStreamIdPreventsUsingLowerStreamId()"]
  0d6189e8_c033_39ff_d087_9019351440fe -->|method| dde7be9c_363c_7ad0_e348_fa60e9ac1705
  8975d416_be2b_5967_efb0_c5e70ccff14c["headersWriteForPeerStreamWhichWasResetShouldNotGoAway()"]
  0d6189e8_c033_39ff_d087_9019351440fe -->|method| 8975d416_be2b_5967_efb0_c5e70ccff14c
  8d8c4f92_bb67_e117_1fa5_19301fa22d7d["http2ExceptionInPipelineShouldCloseConnection()"]
  0d6189e8_c033_39ff_d087_9019351440fe -->|method| 8d8c4f92_bb67_e117_1fa5_19301fa22d7d
  5734273e_861e_c30a_06c0_7cf9dd33f4e6["listenerExceptionShouldCloseConnection()"]
  0d6189e8_c033_39ff_d087_9019351440fe -->|method| 5734273e_861e_c30a_06c0_7cf9dd33f4e6
  8440f97d_48a5_3f77_b9e1_1c2cd2b88260["writeOfEmptyReleasedBufferSingleBufferQueuedInFlowControllerShouldFail()"]
  0d6189e8_c033_39ff_d087_9019351440fe -->|method| 8440f97d_48a5_3f77_b9e1_1c2cd2b88260
  4dd98bbd_c20f_5ffe_f1ca_a77836fc434f["writeOfEmptyReleasedBufferSingleBufferTrailersQueuedInFlowControllerShouldFail()"]
  0d6189e8_c033_39ff_d087_9019351440fe -->|method| 4dd98bbd_c20f_5ffe_f1ca_a77836fc434f

Relationship Graph

Source Code

codec-http2/src/test/java/io/netty/handler/codec/http2/Http2ConnectionRoundtripTest.java lines 92–1288

public class Http2ConnectionRoundtripTest {

    private static final long DEFAULT_AWAIT_TIMEOUT_SECONDS = 15;

    @Mock
    private Http2FrameListener clientListener;

    @Mock
    private Http2FrameListener serverListener;

    private Http2ConnectionHandler http2Client;
    private Http2ConnectionHandler http2Server;
    private ServerBootstrap sb;
    private Bootstrap cb;
    private Channel serverChannel;
    private volatile Channel serverConnectedChannel;
    private Channel clientChannel;
    private FrameCountDown serverFrameCountDown;
    private CountDownLatch requestLatch;
    private CountDownLatch serverSettingsAckLatch;
    private CountDownLatch dataLatch;
    private CountDownLatch trailersLatch;
    private CountDownLatch goAwayLatch;

    @BeforeEach
    public void setup() throws Exception {
        MockitoAnnotations.initMocks(this);
        mockFlowControl(clientListener);
        mockFlowControl(serverListener);
    }

    @AfterEach
    public void teardown() throws Exception {
        if (clientChannel != null) {
            clientChannel.close().syncUninterruptibly();
            clientChannel = null;
        }
        if (serverChannel != null) {
            serverChannel.close().syncUninterruptibly();
            serverChannel = null;
        }
        final Channel serverConnectedChannel = this.serverConnectedChannel;
        if (serverConnectedChannel != null) {
            serverConnectedChannel.close().syncUninterruptibly();
            this.serverConnectedChannel = null;
        }
        Future<?> serverGroup = sb.config().group().shutdownGracefully(0, 5, SECONDS);
        Future<?> serverChildGroup = sb.config().childGroup().shutdownGracefully(0, 5, SECONDS);
        Future<?> clientGroup = cb.config().group().shutdownGracefully(0, 5, SECONDS);
        serverGroup.syncUninterruptibly();
        serverChildGroup.syncUninterruptibly();
        clientGroup.syncUninterruptibly();
    }

    @Test
    public void inflightFrameAfterStreamResetShouldNotMakeConnectionUnusable() throws Exception {
        final CountDownLatch latch = new CountDownLatch(1);
        doAnswer(new Answer<Void>() {
            @Override
            public Void answer(InvocationOnMock invocationOnMock) throws Throwable {
                ChannelHandlerContext ctx = invocationOnMock.getArgument(0);
                http2Server.encoder().writeHeaders(ctx,
                        (Integer) invocationOnMock.getArgument(1),
                        (Http2Headers) invocationOnMock.getArgument(2),
                        0,
                        false,
                        ctx.newPromise());
                http2Server.flush(ctx);
                return null;
            }
        }).when(serverListener).onHeadersRead(any(ChannelHandlerContext.class), anyInt(), any(Http2Headers.class),
                anyInt(), anyShort(), anyBoolean(), anyInt(), anyBoolean());

        doAnswer(new Answer<Void>() {
            @Override
            public Void answer(InvocationOnMock invocationOnMock) throws Throwable {
                latch.countDown();
                return null;
            }
        }).when(clientListener).onHeadersRead(any(ChannelHandlerContext.class), eq(5), any(Http2Headers.class),
                anyInt(), anyShort(), anyBoolean(), anyInt(), anyBoolean());

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free