Home / Function/ connectionErrorForWriterException() — netty Function Reference

connectionErrorForWriterException() — netty Function Reference

Architecture documentation for the connectionErrorForWriterException() function in UniformStreamByteDistributorTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  05bc5ac6_f8e9_6aad_fa1a_e73aa259238b["connectionErrorForWriterException()"]
  c9ed8a9b_20d0_d85d_3ba2_4bce8a2cb72f["UniformStreamByteDistributorTest"]
  05bc5ac6_f8e9_6aad_fa1a_e73aa259238b -->|defined in| c9ed8a9b_20d0_d85d_3ba2_4bce8a2cb72f
  874cc0a8_d364_ef65_d3c3_16d61b243e73["initState()"]
  05bc5ac6_f8e9_6aad_fa1a_e73aa259238b -->|calls| 874cc0a8_d364_ef65_d3c3_16d61b243e73
  25e52e77_a9b5_a8d2_5680_6ca6e99dc744["write()"]
  05bc5ac6_f8e9_6aad_fa1a_e73aa259238b -->|calls| 25e52e77_a9b5_a8d2_5680_6ca6e99dc744
  82fd38f9_f111_4681_d6b7_0b1347efd00c["verifyWrite()"]
  05bc5ac6_f8e9_6aad_fa1a_e73aa259238b -->|calls| 82fd38f9_f111_4681_d6b7_0b1347efd00c
  style 05bc5ac6_f8e9_6aad_fa1a_e73aa259238b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/test/java/io/netty/handler/codec/http2/UniformStreamByteDistributorTest.java lines 124–155

    @Test
    public void connectionErrorForWriterException() throws Http2Exception {
        initState(STREAM_A, 1, true);
        initState(STREAM_B, 2, true);
        initState(STREAM_C, 3, true);
        initState(STREAM_D, 4, true);

        Exception fakeException = new RuntimeException("Fake exception");
        doThrow(fakeException).when(writer).write(same(stream(STREAM_C)), eq(3));

        Http2Exception e =  assertThrows(Http2Exception.class, new Executable() {
            @Override
            public void execute() throws Throwable {
                write(10);
            }
        });
        assertFalse(Http2Exception.isStreamError(e));
        assertEquals(Http2Error.INTERNAL_ERROR, e.error());
        assertSame(fakeException, e.getCause());

        verifyWrite(atMost(1), STREAM_A, 1);
        verifyWrite(atMost(1), STREAM_B, 2);
        verifyWrite(STREAM_C, 3);
        verifyWrite(atMost(1), STREAM_D, 4);

        doNothing().when(writer).write(same(stream(STREAM_C)), eq(3));
        write(10);
        verifyWrite(STREAM_A, 1);
        verifyWrite(STREAM_B, 2);
        verifyWrite(STREAM_C, 3);
        verifyWrite(STREAM_D, 4);
    }

Domain

Subdomains

Frequently Asked Questions

What does connectionErrorForWriterException() do?
connectionErrorForWriterException() is a function in the netty codebase, defined in codec-http2/src/test/java/io/netty/handler/codec/http2/UniformStreamByteDistributorTest.java.
Where is connectionErrorForWriterException() defined?
connectionErrorForWriterException() is defined in codec-http2/src/test/java/io/netty/handler/codec/http2/UniformStreamByteDistributorTest.java at line 124.
What does connectionErrorForWriterException() call?
connectionErrorForWriterException() calls 3 function(s): initState, verifyWrite, write.

Analyze Your Own Codebase

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

Try Supermodel Free