Home / Class/ AbstractHttp3FrameTypeValidationHandlerTest Class — netty Architecture

AbstractHttp3FrameTypeValidationHandlerTest Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  31f14ae0_7748_87a0_a9e5_5f2bdd8e1c2e["AbstractHttp3FrameTypeValidationHandlerTest"]
  e9dca609_fffe_077a_9245_138fc89219a6["AbstractHttp3FrameTypeValidationHandlerTest.java"]
  31f14ae0_7748_87a0_a9e5_5f2bdd8e1c2e -->|defined in| e9dca609_fffe_077a_9245_138fc89219a6
  80f5678c_fbde_2815_3d81_5faa4e69ea8e["ChannelHandler()"]
  31f14ae0_7748_87a0_a9e5_5f2bdd8e1c2e -->|method| 80f5678c_fbde_2815_3d81_5faa4e69ea8e
  8ae272ad_e5c5_65d7_1d45_37e20121d0ca["newValidFrames()"]
  31f14ae0_7748_87a0_a9e5_5f2bdd8e1c2e -->|method| 8ae272ad_e5c5_65d7_1d45_37e20121d0ca
  af49657f_fa1b_8dcf_8ea3_07838f93e061["newInvalidFrames()"]
  31f14ae0_7748_87a0_a9e5_5f2bdd8e1c2e -->|method| af49657f_fa1b_8dcf_8ea3_07838f93e061
  def44f40_6197_9c72_e82b_7d7d6ca60f06["AbstractHttp3FrameTypeValidationHandlerTest()"]
  31f14ae0_7748_87a0_a9e5_5f2bdd8e1c2e -->|method| def44f40_6197_9c72_e82b_7d7d6ca60f06
  3a7a3359_9a75_d491_2de3_7cc75d568653["data()"]
  31f14ae0_7748_87a0_a9e5_5f2bdd8e1c2e -->|method| 3a7a3359_9a75_d491_2de3_7cc75d568653
  66d22a34_2aa1_c0de_9f06_f8a33ee659e3["setUp()"]
  31f14ae0_7748_87a0_a9e5_5f2bdd8e1c2e -->|method| 66d22a34_2aa1_c0de_9f06_f8a33ee659e3
  886f16e1_85e7_c713_25a0_5f06776b8d70["tearDown()"]
  31f14ae0_7748_87a0_a9e5_5f2bdd8e1c2e -->|method| 886f16e1_85e7_c713_25a0_5f06776b8d70
  d8f03a99_e4c2_0a9b_97e3_851becb08ed1["testValidTypeInbound()"]
  31f14ae0_7748_87a0_a9e5_5f2bdd8e1c2e -->|method| d8f03a99_e4c2_0a9b_97e3_851becb08ed1
  d6e9c5ed_54c9_bdaa_abca_3914100e28a4["afterSettingsFrameRead()"]
  31f14ae0_7748_87a0_a9e5_5f2bdd8e1c2e -->|method| d6e9c5ed_54c9_bdaa_abca_3914100e28a4
  da93f4ee_4626_e558_cc5e_08ed25712141["testValidTypeOutbound()"]
  31f14ae0_7748_87a0_a9e5_5f2bdd8e1c2e -->|method| da93f4ee_4626_e558_cc5e_08ed25712141
  3e957452_58be_8d15_2746_a43bf66a77a8["testInvalidTypeInbound()"]
  31f14ae0_7748_87a0_a9e5_5f2bdd8e1c2e -->|method| 3e957452_58be_8d15_2746_a43bf66a77a8
  6d8a71f4_ec15_6e3d_c91b_0b5b2fcd311a["Http3ErrorCode()"]
  31f14ae0_7748_87a0_a9e5_5f2bdd8e1c2e -->|method| 6d8a71f4_ec15_6e3d_c91b_0b5b2fcd311a
  1e065c07_a748_7704_05ab_298e5e97c716["testInvalidTypeOutbound()"]
  31f14ae0_7748_87a0_a9e5_5f2bdd8e1c2e -->|method| 1e065c07_a748_7704_05ab_298e5e97c716

Relationship Graph

Source Code

codec-http3/src/test/java/io/netty/handler/codec/http3/AbstractHttp3FrameTypeValidationHandlerTest.java lines 43–185

public abstract class AbstractHttp3FrameTypeValidationHandlerTest<T extends Http3Frame> {

    private final QuicStreamType defaultStreamType;
    private final boolean isOutbound;
    private final boolean isInbound;
    protected EmbeddedQuicChannel parent;
    protected QpackAttributes qpackAttributes;

    protected abstract ChannelHandler newHandler(boolean server);

    protected abstract List<T> newValidFrames();

    protected abstract List<Http3Frame> newInvalidFrames();

    protected AbstractHttp3FrameTypeValidationHandlerTest(QuicStreamType defaultStreamType,
                                                          boolean isInbound, boolean isOutbound) {
        this.defaultStreamType = defaultStreamType;
        this.isInbound = isInbound;
        this.isOutbound = isOutbound;
    }

    static Collection<Boolean> data() {
        return Arrays.asList(true, false);
    }

    protected void setUp(boolean server) {
        parent = new EmbeddedQuicChannel(server);
        qpackAttributes = new QpackAttributes(parent, false);
        setQpackAttributes(parent, qpackAttributes);
    }

    @AfterEach
    public void tearDown() {
        if (parent != null) {
            final QpackAttributes qpackAttributes = getQpackAttributes(parent);
            assertNotNull(qpackAttributes);
            if (qpackAttributes.decoderStreamAvailable()) {
                assertFalse(((EmbeddedQuicStreamChannel) qpackAttributes.decoderStream()).finish());
            }
            if (qpackAttributes.encoderStreamAvailable()) {
                assertFalse(((EmbeddedQuicStreamChannel) qpackAttributes.encoderStream()).finish());
            }
            assertFalse(parent.finish());
        }
    }

    @ParameterizedTest(name = "{index}: server = {0}")
    @MethodSource("data")
    public void testValidTypeInbound(boolean server) throws Exception {
        assumeTrue(isInbound);
        setUp(server);
        final EmbeddedQuicStreamChannel channel = newStream(defaultStreamType, newHandler(server));
        List<T> validFrames = newValidFrames();
        for (T valid : validFrames) {
            assertTrue(channel.writeInbound(valid));
            T read = channel.readInbound();
            assertFrameSame(valid, read);
            if (valid instanceof Http3SettingsFrame) {
                afterSettingsFrameRead((Http3SettingsFrame) valid);
            }
        }
        assertFalse(channel.finish());
    }

    protected void afterSettingsFrameRead(Http3SettingsFrame settingsFrame) {
    }

    @ParameterizedTest(name = "{index}: server = {0}")
    @MethodSource("data")
    public void testValidTypeOutbound(boolean server) throws Exception {
        assumeTrue(isOutbound);
        setUp(server);
        final EmbeddedQuicStreamChannel channel = newStream(defaultStreamType, newHandler(server));
        List<T> validFrames = newValidFrames();
        for (T valid : validFrames) {
            assertTrue(channel.writeOutbound(valid));
            T read = channel.readOutbound();
            assertFrameSame(valid, read);
        }
        assertFalse(channel.finish());
    }

Frequently Asked Questions

What is the AbstractHttp3FrameTypeValidationHandlerTest class?
AbstractHttp3FrameTypeValidationHandlerTest is a class in the netty codebase, defined in codec-http3/src/test/java/io/netty/handler/codec/http3/AbstractHttp3FrameTypeValidationHandlerTest.java.
Where is AbstractHttp3FrameTypeValidationHandlerTest defined?
AbstractHttp3FrameTypeValidationHandlerTest is defined in codec-http3/src/test/java/io/netty/handler/codec/http3/AbstractHttp3FrameTypeValidationHandlerTest.java at line 43.

Analyze Your Own Codebase

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

Try Supermodel Free