CodecCompressionTest Class — netty Architecture
Architecture documentation for the CodecCompressionTest class in CodecCompressionTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 3ccb7162_6782_66b0_7c76_efe45f5a039b["CodecCompressionTest"] 91940ff3_6d17_5404_e007_3f551c6d324b["CodecCompressionTest.java"] 3ccb7162_6782_66b0_7c76_efe45f5a039b -->|defined in| 91940ff3_6d17_5404_e007_3f551c6d324b bf2ac2cc_a5fb_e637_40f5_b7524edacf2c["testBrotli4j()"] 3ccb7162_6782_66b0_7c76_efe45f5a039b -->|method| bf2ac2cc_a5fb_e637_40f5_b7524edacf2c 853d4477_7420_e4e5_e340_0f01e7301f8a["testZstd()"] 3ccb7162_6782_66b0_7c76_efe45f5a039b -->|method| 853d4477_7420_e4e5_e340_0f01e7301f8a 1752b0b1_7b50_0c26_ad71_af62cf815017["testCompress()"] 3ccb7162_6782_66b0_7c76_efe45f5a039b -->|method| 1752b0b1_7b50_0c26_ad71_af62cf815017
Relationship Graph
Source Code
testsuite-jpms/src/test/java/io/netty/testsuite_jpms/test/CodecCompressionTest.java lines 31–59
public class CodecCompressionTest {
@Test
public void testBrotli4j() {
testCompress(new BrotliEncoder());
}
@Test
public void testZstd() {
testCompress(new ZstdEncoder());
}
public void testCompress(MessageToByteEncoder<ByteBuf> encoder) {
EmbeddedChannel channel = new EmbeddedChannel(encoder);
ByteBuf data = Unpooled.copiedBuffer("some-string", StandardCharsets.UTF_8);
assertTrue(channel.writeOutbound(data));
assertTrue(channel.finish());
assertEquals(0, data.readableBytes());
int size = 0;
for (ByteBuf chunk = channel.readOutbound(); chunk != null; chunk = channel.readOutbound()) {
// Zstd can emit an empty buffer (flush)
if (chunk != Unpooled.EMPTY_BUFFER) {
size += chunk.readableBytes();
assertTrue(chunk.release());
}
}
assertTrue(size > 0);
}
}
Source
Frequently Asked Questions
What is the CodecCompressionTest class?
CodecCompressionTest is a class in the netty codebase, defined in testsuite-jpms/src/test/java/io/netty/testsuite_jpms/test/CodecCompressionTest.java.
Where is CodecCompressionTest defined?
CodecCompressionTest is defined in testsuite-jpms/src/test/java/io/netty/testsuite_jpms/test/CodecCompressionTest.java at line 31.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free