flowControlledWriteCompleteThrowsAnException() — netty Function Reference
Architecture documentation for the flowControlledWriteCompleteThrowsAnException() function in DefaultHttp2RemoteFlowControllerTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 7bd55a42_7f3e_1d2e_3e9a_fcc8cc515b18["flowControlledWriteCompleteThrowsAnException()"] f8fd7697_92d4_6455_4dd8_09a33ac81a6f["DefaultHttp2RemoteFlowControllerTest"] 7bd55a42_7f3e_1d2e_3e9a_fcc8cc515b18 -->|defined in| f8fd7697_92d4_6455_4dd8_09a33ac81a6f 2138bd63_dd75_adae_bf55_ec27bb49f749["size()"] 7bd55a42_7f3e_1d2e_3e9a_fcc8cc515b18 -->|calls| 2138bd63_dd75_adae_bf55_ec27bb49f749 abf1bc09_403f_110e_0b96_d73f451a8f8b["write()"] 7bd55a42_7f3e_1d2e_3e9a_fcc8cc515b18 -->|calls| abf1bc09_403f_110e_0b96_d73f451a8f8b 5af4576c_23ff_8e3b_df41_9d71757029eb["writeComplete()"] 7bd55a42_7f3e_1d2e_3e9a_fcc8cc515b18 -->|calls| 5af4576c_23ff_8e3b_df41_9d71757029eb 72f6527f_6737_5bc4_f643_b308fe4de273["window()"] 7bd55a42_7f3e_1d2e_3e9a_fcc8cc515b18 -->|calls| 72f6527f_6737_5bc4_f643_b308fe4de273 46be14d4_2ad4_2dfe_fa3e_2212c0d8e50e["error()"] 7bd55a42_7f3e_1d2e_3e9a_fcc8cc515b18 -->|calls| 46be14d4_2ad4_2dfe_fa3e_2212c0d8e50e style 7bd55a42_7f3e_1d2e_3e9a_fcc8cc515b18 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
codec-http2/src/test/java/io/netty/handler/codec/http2/DefaultHttp2RemoteFlowControllerTest.java lines 754–800
@Test
public void flowControlledWriteCompleteThrowsAnException() throws Exception {
final Http2RemoteFlowController.FlowControlled flowControlled =
mock(Http2RemoteFlowController.FlowControlled.class);
Http2Stream streamA = stream(STREAM_A);
final AtomicInteger size = new AtomicInteger(150);
doAnswer(new Answer<Integer>() {
@Override
public Integer answer(InvocationOnMock invocationOnMock) throws Throwable {
return size.get();
}
}).when(flowControlled).size();
doAnswer(new Answer<Void>() {
@Override
public Void answer(InvocationOnMock invocationOnMock) throws Throwable {
size.addAndGet(-50);
return null;
}
}).when(flowControlled).write(any(ChannelHandlerContext.class), anyInt());
final Http2Stream stream = stream(STREAM_A);
doAnswer(new Answer<Void>() {
@Override
public Void answer(InvocationOnMock invocationOnMock) {
throw new RuntimeException("writeComplete failed");
}
}).when(flowControlled).writeComplete();
int windowBefore = window(STREAM_A);
controller.addFlowControlled(stream, flowControlled);
controller.writePendingBytes();
verify(flowControlled, times(3)).write(any(ChannelHandlerContext.class), anyInt());
verify(flowControlled, never()).error(any(ChannelHandlerContext.class), any(Throwable.class));
verify(flowControlled).writeComplete();
assertEquals(150, windowBefore - window(STREAM_A));
verify(listener, times(1)).writabilityChanged(streamA);
verify(listener, never()).writabilityChanged(stream(STREAM_B));
verify(listener, never()).writabilityChanged(stream(STREAM_C));
verify(listener, never()).writabilityChanged(stream(STREAM_D));
assertFalse(controller.isWritable(streamA));
assertTrue(controller.isWritable(stream(STREAM_B)));
assertTrue(controller.isWritable(stream(STREAM_C)));
assertTrue(controller.isWritable(stream(STREAM_D)));
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does flowControlledWriteCompleteThrowsAnException() do?
flowControlledWriteCompleteThrowsAnException() is a function in the netty codebase, defined in codec-http2/src/test/java/io/netty/handler/codec/http2/DefaultHttp2RemoteFlowControllerTest.java.
Where is flowControlledWriteCompleteThrowsAnException() defined?
flowControlledWriteCompleteThrowsAnException() is defined in codec-http2/src/test/java/io/netty/handler/codec/http2/DefaultHttp2RemoteFlowControllerTest.java at line 754.
What does flowControlledWriteCompleteThrowsAnException() call?
flowControlledWriteCompleteThrowsAnException() calls 5 function(s): error, size, window, write, writeComplete.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free