testGatheringWrite0() — netty Function Reference
Architecture documentation for the testGatheringWrite0() function in SocketGatheringWriteTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD f09a2d81_a4a2_ecdc_8aab_6fba73e64850["testGatheringWrite0()"] 6d44418a_b3ab_891d_4077_734b9f438867["SocketGatheringWriteTest"] f09a2d81_a4a2_ecdc_8aab_6fba73e64850 -->|defined in| 6d44418a_b3ab_891d_4077_734b9f438867 148f64a2_7910_85e4_0f1e_be939e87470b["testGatheringWrite()"] 148f64a2_7910_85e4_0f1e_be939e87470b -->|calls| f09a2d81_a4a2_ecdc_8aab_6fba73e64850 0ed34e77_d6b0_1f71_523f_bab0958e8bba["testGatheringWriteNotAutoRead()"] 0ed34e77_d6b0_1f71_523f_bab0958e8bba -->|calls| f09a2d81_a4a2_ecdc_8aab_6fba73e64850 053aa526_30ca_cb91_3d75_8b97658f7d33["testGatheringWriteWithComposite()"] 053aa526_30ca_cb91_3d75_8b97658f7d33 -->|calls| f09a2d81_a4a2_ecdc_8aab_6fba73e64850 47978516_081a_1ba6_35ec_c278a9e9a7b9["testGatheringWriteWithCompositeNotAutoRead()"] 47978516_081a_1ba6_35ec_c278a9e9a7b9 -->|calls| f09a2d81_a4a2_ecdc_8aab_6fba73e64850 3cf2d5b1_3589_fc91_340d_cbfb0a1bfe73["testGatheringWriteBig()"] 3cf2d5b1_3589_fc91_340d_cbfb0a1bfe73 -->|calls| f09a2d81_a4a2_ecdc_8aab_6fba73e64850 a715d895_e6a6_b7f6_71fb_02f657d5cc9f["TestServerHandler()"] f09a2d81_a4a2_ecdc_8aab_6fba73e64850 -->|calls| a715d895_e6a6_b7f6_71fb_02f657d5cc9f d0f1a31e_121b_cb14_4b30_5731efd063b6["TestHandler()"] f09a2d81_a4a2_ecdc_8aab_6fba73e64850 -->|calls| d0f1a31e_121b_cb14_4b30_5731efd063b6 style f09a2d81_a4a2_ecdc_8aab_6fba73e64850 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketGatheringWriteTest.java lines 142–205
private void testGatheringWrite0(
ServerBootstrap sb, Bootstrap cb, byte[] data, boolean composite, boolean autoRead) throws Throwable {
sb.childOption(ChannelOption.AUTO_READ, autoRead);
cb.option(ChannelOption.AUTO_READ, autoRead);
Promise<Void> serverDonePromise = ImmediateEventExecutor.INSTANCE.newPromise();
final TestServerHandler sh = new TestServerHandler(autoRead, serverDonePromise, data.length);
final TestHandler ch = new TestHandler(autoRead);
cb.handler(ch);
sb.childHandler(sh);
Channel sc = sb.bind().sync().channel();
Channel cc = cb.connect(sc.localAddress()).sync().channel();
for (int i = 0; i < data.length;) {
int length = Math.min(random.nextInt(1024 * 8), data.length - i);
if (composite && i % 2 == 0) {
int firstBufLength = length / 2;
CompositeByteBuf comp = compositeBuffer();
comp.addComponent(true,
randomBufferType(cc.alloc(), data, i, firstBufLength))
.addComponent(true,
randomBufferType(cc.alloc(), data, i + firstBufLength, length - firstBufLength));
cc.write(comp);
} else {
cc.write(randomBufferType(cc.alloc(), data, i, length));
}
i += length;
}
ChannelFuture cf = cc.writeAndFlush(Unpooled.EMPTY_BUFFER);
assertNotEquals(cc.voidPromise(), cf);
try {
assertTrue(cf.await(60000));
cf.sync();
} catch (Throwable t) {
// TODO: Remove this once we fix this test.
TestUtils.dump(StringUtil.simpleClassName(this));
throw t;
}
serverDonePromise.sync();
sh.channel.close().sync();
ch.channel.close().sync();
sc.close().sync();
if (sh.exception.get() != null && !(sh.exception.get() instanceof IOException)) {
throw sh.exception.get();
}
if (sh.exception.get() != null) {
throw sh.exception.get();
}
if (ch.exception.get() != null && !(ch.exception.get() instanceof IOException)) {
throw ch.exception.get();
}
if (ch.exception.get() != null) {
throw ch.exception.get();
}
ByteBuf expected = wrappedBuffer(data);
assertEquals(expected, sh.received);
expected.release();
sh.received.release();
}
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does testGatheringWrite0() do?
testGatheringWrite0() is a function in the netty codebase, defined in testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketGatheringWriteTest.java.
Where is testGatheringWrite0() defined?
testGatheringWrite0() is defined in testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketGatheringWriteTest.java at line 142.
What does testGatheringWrite0() call?
testGatheringWrite0() calls 2 function(s): TestHandler, TestServerHandler.
What calls testGatheringWrite0()?
testGatheringWrite0() is called by 5 function(s): testGatheringWrite, testGatheringWriteBig, testGatheringWriteNotAutoRead, testGatheringWriteWithComposite, testGatheringWriteWithCompositeNotAutoRead.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free