Home / Function/ streamClosedErrorTranslatedToClosedChannelExceptionOnWrites() — netty Function Reference

streamClosedErrorTranslatedToClosedChannelExceptionOnWrites() — netty Function Reference

Architecture documentation for the streamClosedErrorTranslatedToClosedChannelExceptionOnWrites() function in Http2MultiplexTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  cc6e1be2_02c4_ff15_3d5a_285e8946b302["streamClosedErrorTranslatedToClosedChannelExceptionOnWrites()"]
  4745ff96_ed57_3bd8_9861_4b786d0b6e09["Http2MultiplexTest"]
  cc6e1be2_02c4_ff15_3d5a_285e8946b302 -->|defined in| 4745ff96_ed57_3bd8_9861_4b786d0b6e09
  b9b63893_76d6_8a34_cbb9_a71b8eeaf1c2["flush()"]
  cc6e1be2_02c4_ff15_3d5a_285e8946b302 -->|calls| b9b63893_76d6_8a34_cbb9_a71b8eeaf1c2
  style cc6e1be2_02c4_ff15_3d5a_285e8946b302 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/test/java/io/netty/handler/codec/http2/Http2MultiplexTest.java lines 875–908

    @Test
    public void streamClosedErrorTranslatedToClosedChannelExceptionOnWrites() throws Exception {
        LastInboundHandler inboundHandler = new LastInboundHandler();

        final Http2StreamChannel childChannel = newOutboundStream(inboundHandler);
        assertTrue(childChannel.isActive());

        Http2Headers headers = new DefaultHttp2Headers();
        when(frameWriter.writeHeaders(eqCodecCtx(), anyInt(),
                eq(headers), anyInt(), anyBoolean(),
                any(ChannelPromise.class))).thenAnswer(new Answer<ChannelFuture>() {
            @Override
            public ChannelFuture answer(InvocationOnMock invocationOnMock) {
                return ((ChannelPromise) invocationOnMock.getArgument(5)).setFailure(
                        new StreamException(childChannel.stream().id(), Http2Error.STREAM_CLOSED, "Stream Closed"));
            }
        });
        final ChannelFuture future = childChannel.writeAndFlush(
                new DefaultHttp2HeadersFrame(new DefaultHttp2Headers()));

        parentChannel.flush();

        assertFalse(childChannel.isActive());
        assertFalse(childChannel.isOpen());

        inboundHandler.checkException();

        assertThrows(ClosedChannelException.class, new Executable() {
            @Override
            public void execute() {
                future.syncUninterruptibly();
            }
        });
    }

Domain

Subdomains

Calls

Frequently Asked Questions

What does streamClosedErrorTranslatedToClosedChannelExceptionOnWrites() do?
streamClosedErrorTranslatedToClosedChannelExceptionOnWrites() is a function in the netty codebase, defined in codec-http2/src/test/java/io/netty/handler/codec/http2/Http2MultiplexTest.java.
Where is streamClosedErrorTranslatedToClosedChannelExceptionOnWrites() defined?
streamClosedErrorTranslatedToClosedChannelExceptionOnWrites() is defined in codec-http2/src/test/java/io/netty/handler/codec/http2/Http2MultiplexTest.java at line 875.
What does streamClosedErrorTranslatedToClosedChannelExceptionOnWrites() call?
streamClosedErrorTranslatedToClosedChannelExceptionOnWrites() calls 1 function(s): flush.

Analyze Your Own Codebase

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

Try Supermodel Free