FastLzIntegrationTest Class — netty Architecture
Architecture documentation for the FastLzIntegrationTest class in FastLzIntegrationTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 9194e8b9_99f1_2202_1e46_1c89760174c5["FastLzIntegrationTest"] 59cedf6c_8f19_f564_6deb_753017d95d77["FastLzIntegrationTest.java"] 9194e8b9_99f1_2202_1e46_1c89760174c5 -->|defined in| 59cedf6c_8f19_f564_6deb_753017d95d77 6b1ab5ef_edaf_acd8_bce0_91eced30633d["EmbeddedChannel()"] 9194e8b9_99f1_2202_1e46_1c89760174c5 -->|method| 6b1ab5ef_edaf_acd8_bce0_91eced30633d bc5448c9_2ea6_eb6c_0131_2ea06789651d["testIdentity()"] 9194e8b9_99f1_2202_1e46_1c89760174c5 -->|method| bc5448c9_2ea6_eb6c_0131_2ea06789651d
Relationship Graph
Source Code
codec-compression/src/test/java/io/netty/handler/codec/compression/FastLzIntegrationTest.java lines 26–114
public class FastLzIntegrationTest extends AbstractIntegrationTest {
public static class TestWithChecksum extends AbstractIntegrationTest {
@Override
protected EmbeddedChannel createEncoder() {
return new EmbeddedChannel(new FastLzFrameEncoder(true));
}
@Override
protected EmbeddedChannel createDecoder() {
return new EmbeddedChannel(new FastLzFrameDecoder(true));
}
}
public static class TestRandomChecksum extends AbstractIntegrationTest {
@Override
protected EmbeddedChannel createEncoder() {
return new EmbeddedChannel(new FastLzFrameEncoder(rand.nextBoolean()));
}
@Override
protected EmbeddedChannel createDecoder() {
return new EmbeddedChannel(new FastLzFrameDecoder(rand.nextBoolean()));
}
}
@Override
protected EmbeddedChannel createEncoder() {
return new EmbeddedChannel(new FastLzFrameEncoder(rand.nextBoolean()));
}
@Override
protected EmbeddedChannel createDecoder() {
return new EmbeddedChannel(new FastLzFrameDecoder(rand.nextBoolean()));
}
@Override // test batched flow of data
protected void testIdentity(final byte[] data, boolean heapBuffer) {
initChannels();
final ByteBuf original = heapBuffer? Unpooled.wrappedBuffer(data) :
Unpooled.directBuffer(data.length).writeBytes(data);
final CompositeByteBuf compressed = Unpooled.compositeBuffer();
final CompositeByteBuf decompressed = Unpooled.compositeBuffer();
try {
int written = 0, length = rand.nextInt(100);
while (written + length < data.length) {
ByteBuf in = Unpooled.wrappedBuffer(data, written, length);
encoder.writeOutbound(in);
written += length;
length = rand.nextInt(100);
}
ByteBuf in = Unpooled.wrappedBuffer(data, written, data.length - written);
encoder.writeOutbound(in);
encoder.finish();
ByteBuf msg;
while ((msg = encoder.readOutbound()) != null) {
compressed.addComponent(true, msg);
}
final byte[] compressedArray = new byte[compressed.readableBytes()];
compressed.readBytes(compressedArray);
written = 0;
length = rand.nextInt(100);
while (written + length < compressedArray.length) {
in = Unpooled.wrappedBuffer(compressedArray, written, length);
decoder.writeInbound(in);
written += length;
length = rand.nextInt(100);
}
in = Unpooled.wrappedBuffer(compressedArray, written, compressedArray.length - written);
decoder.writeInbound(in);
assertFalse(compressed.isReadable());
while ((msg = decoder.readInbound()) != null) {
decompressed.addComponent(true, msg);
}
assertEquals(original, decompressed);
Defined In
Source
Frequently Asked Questions
What is the FastLzIntegrationTest class?
FastLzIntegrationTest is a class in the netty codebase, defined in codec-compression/src/test/java/io/netty/handler/codec/compression/FastLzIntegrationTest.java.
Where is FastLzIntegrationTest defined?
FastLzIntegrationTest is defined in codec-compression/src/test/java/io/netty/handler/codec/compression/FastLzIntegrationTest.java at line 26.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free