DefaultHttp2FrameReaderTest Class — netty Architecture
Architecture documentation for the DefaultHttp2FrameReaderTest class in DefaultHttp2FrameReaderTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 66b2f0cc_bce5_f8e1_a7ee_93cd2a101951["DefaultHttp2FrameReaderTest"] 38fd2c04_0ef8_c389_0772_56b24251cffe["DefaultHttp2FrameReaderTest.java"] 66b2f0cc_bce5_f8e1_a7ee_93cd2a101951 -->|defined in| 38fd2c04_0ef8_c389_0772_56b24251cffe c9b22ea7_fcef_6735_2c2e_d04928b1e948["setUp()"] 66b2f0cc_bce5_f8e1_a7ee_93cd2a101951 -->|method| c9b22ea7_fcef_6735_2c2e_d04928b1e948 77d726cd_0a18_7500_a16c_e07ef9567cde["tearDown()"] 66b2f0cc_bce5_f8e1_a7ee_93cd2a101951 -->|method| 77d726cd_0a18_7500_a16c_e07ef9567cde b9465947_bdea_365c_4553_5407d21d3f86["readHeaderFrame()"] 66b2f0cc_bce5_f8e1_a7ee_93cd2a101951 -->|method| b9465947_bdea_365c_4553_5407d21d3f86 7fc7afea_f2c6_89e9_3db4_f270f03730bc["readHeaderFrameAndContinuationFrame()"] 66b2f0cc_bce5_f8e1_a7ee_93cd2a101951 -->|method| 7fc7afea_f2c6_89e9_3db4_f270f03730bc e6117d95_346f_f79a_1933_6780a97986ff["readUnknownFrame()"] 66b2f0cc_bce5_f8e1_a7ee_93cd2a101951 -->|method| e6117d95_346f_f79a_1933_6780a97986ff 3c43812b_c9ac_7613_f6b3_27f6f6a1c8f8["failedWhenUnknownFrameInMiddleOfHeaderBlock()"] 66b2f0cc_bce5_f8e1_a7ee_93cd2a101951 -->|method| 3c43812b_c9ac_7613_f6b3_27f6f6a1c8f8 0c665d82_cdd5_509d_5ddf_6fd13e9dbe58["failedWhenContinuationFrameStreamIdMismatch()"] 66b2f0cc_bce5_f8e1_a7ee_93cd2a101951 -->|method| 0c665d82_cdd5_509d_5ddf_6fd13e9dbe58 1f496cb9_65be_6ed2_bf3d_9fb0752c643b["failedWhenContinuationFrameNotFollowHeaderFrame()"] 66b2f0cc_bce5_f8e1_a7ee_93cd2a101951 -->|method| 1f496cb9_65be_6ed2_bf3d_9fb0752c643b c1d45121_b1c3_6954_ae47_564a1698f4c1["failedWhenHeaderFrameDependsOnItself()"] 66b2f0cc_bce5_f8e1_a7ee_93cd2a101951 -->|method| c1d45121_b1c3_6954_ae47_564a1698f4c1 0ba8343d_d6f0_62d7_939a_ce435409b2e2["failedHeadersValidationThrowsConnectionError()"] 66b2f0cc_bce5_f8e1_a7ee_93cd2a101951 -->|method| 0ba8343d_d6f0_62d7_939a_ce435409b2e2 e4e6264a_b94e_de45_e29e_c6026f5f028b["readHeaderAndData()"] 66b2f0cc_bce5_f8e1_a7ee_93cd2a101951 -->|method| e4e6264a_b94e_de45_e29e_c6026f5f028b bd59f8bd_3bf0_f96b_af38_8ac6fc4487e7["failedWhenDataFrameNotAssociateWithStream()"] 66b2f0cc_bce5_f8e1_a7ee_93cd2a101951 -->|method| bd59f8bd_3bf0_f96b_af38_8ac6fc4487e7 8644e35e_fde6_f682_c33a_14d4387ca5b7["readPriorityFrame()"] 66b2f0cc_bce5_f8e1_a7ee_93cd2a101951 -->|method| 8644e35e_fde6_f682_c33a_14d4387ca5b7
Relationship Graph
Source Code
codec-http2/src/test/java/io/netty/handler/codec/http2/DefaultHttp2FrameReaderTest.java lines 40–540
public class DefaultHttp2FrameReaderTest {
@Mock
private Http2FrameListener listener;
@Mock
private ChannelHandlerContext ctx;
private DefaultHttp2FrameReader frameReader;
// Used to generate frame
private HpackEncoder hpackEncoder;
@BeforeEach
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
when(ctx.alloc()).thenReturn(UnpooledByteBufAllocator.DEFAULT);
frameReader = new DefaultHttp2FrameReader();
hpackEncoder = new HpackEncoder();
}
@AfterEach
public void tearDown() {
frameReader.close();
}
@Test
public void readHeaderFrame() throws Http2Exception {
final int streamId = 1;
ByteBuf input = Unpooled.buffer();
try {
Http2Headers headers = new DefaultHttp2Headers()
.authority("foo")
.method("get")
.path("/")
.scheme("https");
Http2Flags flags = new Http2Flags().endOfHeaders(true).endOfStream(true);
writeHeaderFrame(input, streamId, headers, flags);
frameReader.readFrame(ctx, input, listener);
verify(listener).onHeadersRead(ctx, 1, headers, 0, true);
} finally {
input.release();
}
}
@Test
public void readHeaderFrameAndContinuationFrame() throws Http2Exception {
final int streamId = 1;
ByteBuf input = Unpooled.buffer();
try {
Http2Headers headers = new DefaultHttp2Headers()
.authority("foo")
.method("get")
.path("/")
.scheme("https");
writeHeaderFrame(input, streamId, headers,
new Http2Flags().endOfHeaders(false).endOfStream(true));
writeContinuationFrame(input, streamId, new DefaultHttp2Headers().add("foo", "bar"),
new Http2Flags().endOfHeaders(true));
frameReader.readFrame(ctx, input, listener);
verify(listener).onHeadersRead(ctx, 1, headers.add("foo", "bar"), 0, true);
} finally {
input.release();
}
}
@Test
public void readUnknownFrame() throws Http2Exception {
ByteBuf input = Unpooled.buffer();
ByteBuf payload = Unpooled.buffer();
try {
payload.writeByte(1);
writeFrameHeader(input, payload.readableBytes(), (byte) 0xff, new Http2Flags(), 0);
input.writeBytes(payload);
Source
Frequently Asked Questions
What is the DefaultHttp2FrameReaderTest class?
DefaultHttp2FrameReaderTest is a class in the netty codebase, defined in codec-http2/src/test/java/io/netty/handler/codec/http2/DefaultHttp2FrameReaderTest.java.
Where is DefaultHttp2FrameReaderTest defined?
DefaultHttp2FrameReaderTest is defined in codec-http2/src/test/java/io/netty/handler/codec/http2/DefaultHttp2FrameReaderTest.java at line 40.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free