Home / Class/ Http3FrameToHttpObjectCodecTest Class — netty Architecture

Http3FrameToHttpObjectCodecTest Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  0358625f_2420_3fbe_f6d7_5ee2577ca675["Http3FrameToHttpObjectCodecTest"]
  633a59b4_4617_83cc_3010_d0ccdc446fef["Http3FrameToHttpObjectCodecTest.java"]
  0358625f_2420_3fbe_f6d7_5ee2577ca675 -->|defined in| 633a59b4_4617_83cc_3010_d0ccdc446fef
  8f1d13c5_a60b_437a_33d9_8599ca8130e9["testUpgradeEmptyFullResponse()"]
  0358625f_2420_3fbe_f6d7_5ee2577ca675 -->|method| 8f1d13c5_a60b_437a_33d9_8599ca8130e9
  a8887f2a_b406_f54d_ad36_dbd8cabb44fc["encode100ContinueAsHttp2HeadersFrameThatIsNotEndStream()"]
  0358625f_2420_3fbe_f6d7_5ee2577ca675 -->|method| a8887f2a_b406_f54d_ad36_dbd8cabb44fc
  85544a34_b14f_21c4_af51_30f847f6a61f["encodeNonFullHttpResponse100ContinueIsRejected()"]
  0358625f_2420_3fbe_f6d7_5ee2577ca675 -->|method| 85544a34_b14f_21c4_af51_30f847f6a61f
  8611c9aa_07d9_9c24_934f_5d350ef4a8b9["testUpgradeNonEmptyFullResponse()"]
  0358625f_2420_3fbe_f6d7_5ee2577ca675 -->|method| 8611c9aa_07d9_9c24_934f_5d350ef4a8b9
  44fcb0eb_9f30_c9fb_38c2_b7504af78e65["testUpgradeEmptyFullResponseWithTrailers()"]
  0358625f_2420_3fbe_f6d7_5ee2577ca675 -->|method| 44fcb0eb_9f30_c9fb_38c2_b7504af78e65
  fd35c4e2_54de_ce0f_5be3_4d9c8cf3c5a0["testUpgradeNonEmptyFullResponseWithTrailers()"]
  0358625f_2420_3fbe_f6d7_5ee2577ca675 -->|method| fd35c4e2_54de_ce0f_5be3_4d9c8cf3c5a0
  5f5a2632_8da0_896c_82aa_4077b5aaa504["testUpgradeHeaders()"]
  0358625f_2420_3fbe_f6d7_5ee2577ca675 -->|method| 5f5a2632_8da0_896c_82aa_4077b5aaa504
  b472c295_ca01_b20e_06ca_3e3c7f37b903["testUpgradeChunk()"]
  0358625f_2420_3fbe_f6d7_5ee2577ca675 -->|method| b472c295_ca01_b20e_06ca_3e3c7f37b903
  e828c41f_80c6_bb71_9bda_8c0fba8dc0ad["testUpgradeEmptyEnd()"]
  0358625f_2420_3fbe_f6d7_5ee2577ca675 -->|method| e828c41f_80c6_bb71_9bda_8c0fba8dc0ad
  8c578e4a_3c78_aa85_a25f_145f30d27362["testUpgradeDataEnd()"]
  0358625f_2420_3fbe_f6d7_5ee2577ca675 -->|method| 8c578e4a_3c78_aa85_a25f_145f30d27362
  8149f6c7_9e11_319e_4af8_2e49e3a94b1f["testUpgradeDataEndWithTrailers()"]
  0358625f_2420_3fbe_f6d7_5ee2577ca675 -->|method| 8149f6c7_9e11_319e_4af8_2e49e3a94b1f
  60761e7d_020b_0333_b433_54934e240920["testDowngradeHeaders()"]
  0358625f_2420_3fbe_f6d7_5ee2577ca675 -->|method| 60761e7d_020b_0333_b433_54934e240920
  8c718dd6_4460_be26_c690_2cd2f32f16a0["testDowngradeHeadersWithContentLength()"]
  0358625f_2420_3fbe_f6d7_5ee2577ca675 -->|method| 8c718dd6_4460_be26_c690_2cd2f32f16a0

Relationship Graph

Source Code

codec-http3/src/test/java/io/netty/handler/codec/http3/Http3FrameToHttpObjectCodecTest.java lines 93–1086

public class Http3FrameToHttpObjectCodecTest {

    @Test
    public void testUpgradeEmptyFullResponse() {
        EmbeddedQuicStreamChannel ch = new EmbeddedQuicStreamChannel(new Http3FrameToHttpObjectCodec(true));
        assertTrue(ch.writeOutbound(new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK)));

        Http3HeadersFrame headersFrame = ch.readOutbound();
        assertThat(headersFrame.headers().status().toString(), is("200"));
        assertTrue(ch.isOutputShutdown());

        assertFalse(ch.finish());
    }

    @Test
    public void encode100ContinueAsHttp2HeadersFrameThatIsNotEndStream() {
        EmbeddedQuicStreamChannel ch = new EmbeddedQuicStreamChannel(new Http3FrameToHttpObjectCodec(true));
        assertTrue(ch.writeOutbound(new DefaultFullHttpResponse(
                HttpVersion.HTTP_1_1, HttpResponseStatus.CONTINUE)));

        Http3HeadersFrame headersFrame = ch.readOutbound();
        assertThat(headersFrame.headers().status().toString(), is("100"));
        assertFalse(ch.isOutputShutdown());

        assertThat(ch.readOutbound(), is(nullValue()));
        assertFalse(ch.finish());
    }

    @Test
    public void encodeNonFullHttpResponse100ContinueIsRejected() {
        EmbeddedQuicStreamChannel ch = new EmbeddedQuicStreamChannel(new Http3FrameToHttpObjectCodec(true));
        assertThrows(EncoderException.class, () -> ch.writeOutbound(new DefaultHttpResponse(
                HttpVersion.HTTP_1_1, HttpResponseStatus.CONTINUE)));
        ch.finishAndReleaseAll();
    }

    @Test
    public void testUpgradeNonEmptyFullResponse() {
        EmbeddedQuicStreamChannel ch = new EmbeddedQuicStreamChannel(new Http3FrameToHttpObjectCodec(true));
        ByteBuf hello = Unpooled.copiedBuffer("hello world", CharsetUtil.UTF_8);
        assertTrue(ch.writeOutbound(new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK, hello)));

        Http3HeadersFrame headersFrame = ch.readOutbound();
        assertThat(headersFrame.headers().status().toString(), is("200"));

        Http3DataFrame dataFrame = ch.readOutbound();
        try {
            assertThat(dataFrame.content().toString(CharsetUtil.UTF_8), is("hello world"));
        } finally {
            dataFrame.release();
        }

        assertTrue(ch.isOutputShutdown());
        assertFalse(ch.finish());
    }

    @Test
    public void testUpgradeEmptyFullResponseWithTrailers() {
        EmbeddedQuicStreamChannel ch = new EmbeddedQuicStreamChannel(new Http3FrameToHttpObjectCodec(true));
        FullHttpResponse response = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK);
        HttpHeaders trailers = response.trailingHeaders();
        trailers.set("key", "value");
        assertTrue(ch.writeOutbound(response));

        Http3HeadersFrame headersFrame = ch.readOutbound();
        assertThat(headersFrame.headers().status().toString(), is("200"));

        Http3HeadersFrame trailersFrame = ch.readOutbound();
        assertThat(trailersFrame.headers().get("key").toString(), is("value"));
        assertTrue(ch.isOutputShutdown());

        assertFalse(ch.finish());
    }

    @Test
    public void testUpgradeNonEmptyFullResponseWithTrailers() {
        EmbeddedQuicStreamChannel ch = new EmbeddedQuicStreamChannel(new Http3FrameToHttpObjectCodec(true));
        ByteBuf hello = Unpooled.copiedBuffer("hello world", CharsetUtil.UTF_8);
        FullHttpResponse response = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK, hello);
        HttpHeaders trailers = response.trailingHeaders();
        trailers.set("key", "value");

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free