testReadIfNotAutoReadWhenNotSharable() — netty Function Reference
Architecture documentation for the testReadIfNotAutoReadWhenNotSharable() function in MessageToMessageDecoderTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 3aafbf69_2602_e9f8_1a32_9ea06fa31d1d["testReadIfNotAutoReadWhenNotSharable()"] d6b90011_d41c_f492_3d57_b65b43e5303f["MessageToMessageDecoderTest"] 3aafbf69_2602_e9f8_1a32_9ea06fa31d1d -->|defined in| d6b90011_d41c_f492_3d57_b65b43e5303f style 3aafbf69_2602_e9f8_1a32_9ea06fa31d1d fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
codec-base/src/test/java/io/netty/handler/codec/MessageToMessageDecoderTest.java lines 32–54
@Test
void testReadIfNotAutoReadWhenNotSharable() {
ReadCountHandler readCountHandler = new ReadCountHandler();
EmbeddedChannel channel = new EmbeddedChannel(new MessageToMessageDecoder<String>() {
private int count;
@Override
protected void decode(ChannelHandlerContext ctx, String msg, List<Object> out) {
if (count++ == 0) {
return;
}
out.add(msg);
}
});
channel.config().setAutoRead(false);
channel.pipeline().addFirst(readCountHandler);
assertFalse(channel.writeInbound("something"));
assertEquals(1, readCountHandler.readCount.get());
assertTrue(channel.writeInbound("something"));
// As we produced a message in the MessageToMessageDecoder we don't expect that there will be any extra
// read happen.
assertEquals(1, readCountHandler.readCount.get());
assertTrue(channel.finishAndReleaseAll());
}
Domain
Subdomains
Source
Frequently Asked Questions
What does testReadIfNotAutoReadWhenNotSharable() do?
testReadIfNotAutoReadWhenNotSharable() is a function in the netty codebase, defined in codec-base/src/test/java/io/netty/handler/codec/MessageToMessageDecoderTest.java.
Where is testReadIfNotAutoReadWhenNotSharable() defined?
testReadIfNotAutoReadWhenNotSharable() is defined in codec-base/src/test/java/io/netty/handler/codec/MessageToMessageDecoderTest.java at line 32.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free