testUserDefinedWritability2() — netty Function Reference
Architecture documentation for the testUserDefinedWritability2() function in ChannelOutboundBufferTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 2e4cc85a_2e25_69c7_5857_a5a0ac6675a2["testUserDefinedWritability2()"] 06eb8f18_da0c_40bf_fb14_47e2c94a6923["ChannelOutboundBufferTest"] 2e4cc85a_2e25_69c7_5857_a5a0ac6675a2 -->|defined in| 06eb8f18_da0c_40bf_fb14_47e2c94a6923 00d35efd_91f9_9891_6cdb_8a43498309e6["safeClose()"] 2e4cc85a_2e25_69c7_5857_a5a0ac6675a2 -->|calls| 00d35efd_91f9_9891_6cdb_8a43498309e6 style 2e4cc85a_2e25_69c7_5857_a5a0ac6675a2 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
transport/src/test/java/io/netty/channel/ChannelOutboundBufferTest.java lines 351–389
@Test
public void testUserDefinedWritability2() {
final StringBuilder buf = new StringBuilder();
EmbeddedChannel ch = new EmbeddedChannel(new ChannelInboundHandlerAdapter() {
@Override
public void channelWritabilityChanged(ChannelHandlerContext ctx) {
buf.append(ctx.channel().isWritable());
buf.append(' ');
}
});
ch.config().setWriteBufferLowWaterMark(128);
ch.config().setWriteBufferHighWaterMark(256);
ChannelOutboundBuffer cob = ch.unsafe().outboundBuffer();
// Ensure that setting a user-defined writability flag to false affects channel.isWritable()
cob.setUserDefinedWritability(1, false);
ch.runPendingTasks();
assertEquals("false ", buf.toString());
// Ensure that setting another user-defined writability flag to false does not trigger
// channelWritabilityChanged.
cob.setUserDefinedWritability(2, false);
ch.runPendingTasks();
assertEquals("false ", buf.toString());
// Ensure that setting only one user-defined writability flag to true does not affect channel.isWritable()
cob.setUserDefinedWritability(1, true);
ch.runPendingTasks();
assertEquals("false ", buf.toString());
// Ensure that setting all user-defined writability flags to true affects channel.isWritable()
cob.setUserDefinedWritability(2, true);
ch.runPendingTasks();
assertEquals("false true ", buf.toString());
safeClose(ch);
}
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does testUserDefinedWritability2() do?
testUserDefinedWritability2() is a function in the netty codebase, defined in transport/src/test/java/io/netty/channel/ChannelOutboundBufferTest.java.
Where is testUserDefinedWritability2() defined?
testUserDefinedWritability2() is defined in transport/src/test/java/io/netty/channel/ChannelOutboundBufferTest.java at line 351.
What does testUserDefinedWritability2() call?
testUserDefinedWritability2() calls 1 function(s): safeClose.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free