testMixedWritability() — netty Function Reference
Architecture documentation for the testMixedWritability() function in ChannelOutboundBufferTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 40218d07_10f7_38ca_e9ed_60cc3c840d52["testMixedWritability()"] 06eb8f18_da0c_40bf_fb14_47e2c94a6923["ChannelOutboundBufferTest"] 40218d07_10f7_38ca_e9ed_60cc3c840d52 -->|defined in| 06eb8f18_da0c_40bf_fb14_47e2c94a6923 00d35efd_91f9_9891_6cdb_8a43498309e6["safeClose()"] 40218d07_10f7_38ca_e9ed_60cc3c840d52 -->|calls| 00d35efd_91f9_9891_6cdb_8a43498309e6 style 40218d07_10f7_38ca_e9ed_60cc3c840d52 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
transport/src/test/java/io/netty/channel/ChannelOutboundBufferTest.java lines 391–428
@Test
public void testMixedWritability() {
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();
// Trigger channelWritabilityChanged() by writing a lot.
ch.write(buffer().writeZero(257));
assertEquals("false ", buf.toString());
// Ensure that setting a user-defined writability flag to false does not trigger channelWritabilityChanged()
cob.setUserDefinedWritability(1, false);
ch.runPendingTasks();
assertEquals("false ", buf.toString());
// Ensure reducing the totalPendingWriteBytes down to zero does not trigger channelWritabilityChanged()
// because of the user-defined writability flag.
ch.flush();
assertEquals(0L, cob.totalPendingWriteBytes());
assertEquals("false ", buf.toString());
// Ensure that setting the user-defined writability flag to true triggers channelWritabilityChanged()
cob.setUserDefinedWritability(1, true);
ch.runPendingTasks();
assertEquals("false true ", buf.toString());
safeClose(ch);
}
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does testMixedWritability() do?
testMixedWritability() is a function in the netty codebase, defined in transport/src/test/java/io/netty/channel/ChannelOutboundBufferTest.java.
Where is testMixedWritability() defined?
testMixedWritability() is defined in transport/src/test/java/io/netty/channel/ChannelOutboundBufferTest.java at line 391.
What does testMixedWritability() call?
testMixedWritability() 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