canSendGoAwayUsingVoidPromise() — netty Function Reference
Architecture documentation for the canSendGoAwayUsingVoidPromise() function in Http2ConnectionHandlerTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD f7cdcc4e_3f19_c3e1_f5b6_5b8f8b88417c["canSendGoAwayUsingVoidPromise()"] e8b32c7d_fa9d_422b_0744_82047ac00ea5["Http2ConnectionHandlerTest"] f7cdcc4e_3f19_c3e1_f5b6_5b8f8b88417c -->|defined in| e8b32c7d_fa9d_422b_0744_82047ac00ea5 style f7cdcc4e_3f19_c3e1_f5b6_5b8f8b88417c fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
codec-http2/src/test/java/io/netty/handler/codec/http2/Http2ConnectionHandlerTest.java lines 701–724
@Test
public void canSendGoAwayUsingVoidPromise() throws Exception {
handler = newHandler();
ByteBuf data = dummyData();
long errorCode = Http2Error.INTERNAL_ERROR.code();
handler = newHandler();
final Throwable cause = new RuntimeException("fake exception");
doAnswer(new Answer<ChannelFuture>() {
@Override
public ChannelFuture answer(InvocationOnMock invocation) throws Throwable {
ChannelPromise promise = invocation.getArgument(4);
assertFalse(promise.isVoid());
// This is what DefaultHttp2FrameWriter does... I hate mocking :-(.
SimpleChannelPromiseAggregator aggregatedPromise =
new SimpleChannelPromiseAggregator(promise, channel, ImmediateEventExecutor.INSTANCE);
aggregatedPromise.newPromise();
aggregatedPromise.doneAllocatingPromises();
return aggregatedPromise.setFailure(cause);
}
}).when(frameWriter).writeGoAway(
any(ChannelHandlerContext.class), anyInt(), anyLong(), any(ByteBuf.class), any(ChannelPromise.class));
handler.goAway(ctx, STREAM_ID, errorCode, data, newVoidPromise(channel));
verify(pipeline).fireExceptionCaught(cause);
}
Domain
Subdomains
Source
Frequently Asked Questions
What does canSendGoAwayUsingVoidPromise() do?
canSendGoAwayUsingVoidPromise() is a function in the netty codebase, defined in codec-http2/src/test/java/io/netty/handler/codec/http2/Http2ConnectionHandlerTest.java.
Where is canSendGoAwayUsingVoidPromise() defined?
canSendGoAwayUsingVoidPromise() is defined in codec-http2/src/test/java/io/netty/handler/codec/http2/Http2ConnectionHandlerTest.java at line 701.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free