Home / Function/ writeMultipleRstFramesForSameStream() — netty Function Reference

writeMultipleRstFramesForSameStream() — netty Function Reference

Architecture documentation for the writeMultipleRstFramesForSameStream() function in Http2ConnectionHandlerTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  6788b450_279b_9393_11d1_60d697c45180["writeMultipleRstFramesForSameStream()"]
  e8b32c7d_fa9d_422b_0744_82047ac00ea5["Http2ConnectionHandlerTest"]
  6788b450_279b_9393_11d1_60d697c45180 -->|defined in| e8b32c7d_fa9d_422b_0744_82047ac00ea5
  style 6788b450_279b_9393_11d1_60d697c45180 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/test/java/io/netty/handler/codec/http2/Http2ConnectionHandlerTest.java lines 827–865

    @Test
    public void writeMultipleRstFramesForSameStream() throws Exception {
        handler = newHandler();
        when(stream.id()).thenReturn(STREAM_ID);

        final AtomicBoolean resetSent = new AtomicBoolean();
        when(stream.resetSent()).then(new Answer<Http2Stream>() {
            @Override
            public Http2Stream answer(InvocationOnMock invocationOnMock) {
                resetSent.set(true);
                return stream;
            }
        });
        when(stream.isResetSent()).then(new Answer<Boolean>() {
            @Override
            public Boolean answer(InvocationOnMock invocationOnMock) {
                return resetSent.get();
            }
        });
        when(frameWriter.writeRstStream(eq(ctx), eq(STREAM_ID), anyLong(), any(ChannelPromise.class)))
                .then(new Answer<ChannelFuture>() {
                    @Override
                    public ChannelFuture answer(InvocationOnMock invocationOnMock) throws Throwable {
                        ChannelPromise promise = invocationOnMock.getArgument(3);
                        return promise.setSuccess();
                    }
                });

        ChannelPromise promise =
                new DefaultChannelPromise(channel, ImmediateEventExecutor.INSTANCE);
        final ChannelPromise promise2 =
                new DefaultChannelPromise(channel, ImmediateEventExecutor.INSTANCE);
        promise.addListener(f -> handler.resetStream(ctx, STREAM_ID, STREAM_CLOSED.code(), promise2));

        handler.resetStream(ctx, STREAM_ID, CANCEL.code(), promise);
        verify(frameWriter).writeRstStream(eq(ctx), eq(STREAM_ID), anyLong(), any(ChannelPromise.class));
        assertTrue(promise.isSuccess());
        assertTrue(promise2.isSuccess());
    }

Domain

Subdomains

Frequently Asked Questions

What does writeMultipleRstFramesForSameStream() do?
writeMultipleRstFramesForSameStream() is a function in the netty codebase, defined in codec-http2/src/test/java/io/netty/handler/codec/http2/Http2ConnectionHandlerTest.java.
Where is writeMultipleRstFramesForSameStream() defined?
writeMultipleRstFramesForSameStream() is defined in codec-http2/src/test/java/io/netty/handler/codec/http2/Http2ConnectionHandlerTest.java at line 827.

Analyze Your Own Codebase

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

Try Supermodel Free