Home / Class/ Http2ConnectionHandlerTest Class — netty Architecture

Http2ConnectionHandlerTest Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  e8b32c7d_fa9d_422b_0744_82047ac00ea5["Http2ConnectionHandlerTest"]
  a1219978_13b6_74a0_afc0_73bac643f394["Http2ConnectionHandlerTest.java"]
  e8b32c7d_fa9d_422b_0744_82047ac00ea5 -->|defined in| a1219978_13b6_74a0_afc0_73bac643f394
  d619fd62_4eef_a509_bb09_2d2a26cb03e8["setup()"]
  e8b32c7d_fa9d_422b_0744_82047ac00ea5 -->|method| d619fd62_4eef_a509_bb09_2d2a26cb03e8
  d1aa5270_a417_3704_208e_7b72625b5457["Http2ConnectionHandler()"]
  e8b32c7d_fa9d_422b_0744_82047ac00ea5 -->|method| d1aa5270_a417_3704_208e_7b72625b5457
  b1920867_f990_cbc8_4787_49f1bdc1d9cb["tearDown()"]
  e8b32c7d_fa9d_422b_0744_82047ac00ea5 -->|method| b1920867_f990_cbc8_4787_49f1bdc1d9cb
  c5a9f62e_825c_b772_69fc_0251a0e8ce83["onHttpServerUpgradeWithoutHandlerAdded()"]
  e8b32c7d_fa9d_422b_0744_82047ac00ea5 -->|method| c5a9f62e_825c_b772_69fc_0251a0e8ce83
  30b11561_1e74_1df1_1098_fe2701c27d0c["onHttpClientUpgradeWithoutHandlerAdded()"]
  e8b32c7d_fa9d_422b_0744_82047ac00ea5 -->|method| 30b11561_1e74_1df1_1098_fe2701c27d0c
  5b447a7c_7a71_561b_e05f_0a8a83177755["clientShouldveSentPrefaceAndSettingsFrameWhenUserEventIsTriggered()"]
  e8b32c7d_fa9d_422b_0744_82047ac00ea5 -->|method| 5b447a7c_7a71_561b_e05f_0a8a83177755
  848ed973_073f_3b56_cd7b_e18f5599b684["clientShouldSendClientPrefaceStringWhenActive()"]
  e8b32c7d_fa9d_422b_0744_82047ac00ea5 -->|method| 848ed973_073f_3b56_cd7b_e18f5599b684
  4ee16949_4483_af66_1444_6f7a290370fd["serverShouldNotSendClientPrefaceStringWhenActive()"]
  e8b32c7d_fa9d_422b_0744_82047ac00ea5 -->|method| 4ee16949_4483_af66_1444_6f7a290370fd
  332cc398_8ef7_c5a0_bc84_bddf4ad764da["serverReceivingInvalidClientPrefaceStringShouldHandleException()"]
  e8b32c7d_fa9d_422b_0744_82047ac00ea5 -->|method| 332cc398_8ef7_c5a0_bc84_bddf4ad764da
  21524ab0_3899_a914_6cfd_be04addd57ee["serverReceivingInvalidClientSettingsAfterPrefaceShouldHandleException()"]
  e8b32c7d_fa9d_422b_0744_82047ac00ea5 -->|method| 21524ab0_3899_a914_6cfd_be04addd57ee
  35d6cb51_1db7_a0ec_b5a7_76a2d21a37c8["serverReceivingHttp1ClientPrefaceStringShouldIncludePreface()"]
  e8b32c7d_fa9d_422b_0744_82047ac00ea5 -->|method| 35d6cb51_1db7_a0ec_b5a7_76a2d21a37c8
  cd250a00_a859_dca2_e74e_bd24b53d5105["serverReceivingClientPrefaceStringFollowedByNonSettingsShouldHandleException()"]
  e8b32c7d_fa9d_422b_0744_82047ac00ea5 -->|method| cd250a00_a859_dca2_e74e_bd24b53d5105
  6f203dbf_8e83_e8b2_9c28_18086d052df9["serverReceivingValidClientPrefaceStringShouldContinueReadingFrames()"]
  e8b32c7d_fa9d_422b_0744_82047ac00ea5 -->|method| 6f203dbf_8e83_e8b2_9c28_18086d052df9

Relationship Graph

Source Code

codec-http2/src/test/java/io/netty/handler/codec/http2/Http2ConnectionHandlerTest.java lines 90–896

public class Http2ConnectionHandlerTest {
    private static final int STREAM_ID = 1;
    private static final int NON_EXISTANT_STREAM_ID = 13;

    private Http2ConnectionHandler handler;
    private ChannelPromise promise;
    private ChannelPromise voidPromise;

    @Mock
    private Http2Connection connection;

    @Mock
    private Http2RemoteFlowController remoteFlow;

    @Mock
    private Http2LocalFlowController localFlow;

    @Mock
    private Http2Connection.Endpoint<Http2RemoteFlowController> remote;

    @Mock
    private Http2RemoteFlowController remoteFlowController;

    @Mock
    private Http2Connection.Endpoint<Http2LocalFlowController> local;

    @Mock
    private Http2LocalFlowController localFlowController;

    @Mock
    private ChannelHandlerContext ctx;

    @Mock
    private EventExecutor executor;

    @Mock
    private Channel channel;

    @Mock
    private ChannelPipeline pipeline;

    @Mock
    private ChannelFuture future;

    @Mock
    private Http2Stream stream;

    @Mock
    private Http2ConnectionDecoder decoder;

    @Mock
    private Http2ConnectionEncoder encoder;

    @Mock
    private Http2FrameWriter frameWriter;

    private String goAwayDebugCap;

    @SuppressWarnings("unchecked")
    @BeforeEach
    public void setup() throws Exception {
        MockitoAnnotations.initMocks(this);

        promise = new DefaultChannelPromise(channel, ImmediateEventExecutor.INSTANCE);
        voidPromise = new DefaultChannelPromise(channel, ImmediateEventExecutor.INSTANCE);

        when(channel.metadata()).thenReturn(new ChannelMetadata(false));
        DefaultChannelConfig config = new DefaultChannelConfig(channel);
        when(channel.config()).thenReturn(config);

        Throwable fakeException = new RuntimeException("Fake exception");
        when(encoder.connection()).thenReturn(connection);
        when(decoder.connection()).thenReturn(connection);
        when(encoder.frameWriter()).thenReturn(frameWriter);
        when(encoder.flowController()).thenReturn(remoteFlow);
        when(decoder.flowController()).thenReturn(localFlow);
        doAnswer(new Answer<ChannelFuture>() {
            @Override
            public ChannelFuture answer(InvocationOnMock invocation) throws Throwable {
                ByteBuf buf = invocation.getArgument(3);
                goAwayDebugCap = buf.toString(UTF_8);

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free