LzfDecoderTest Class — netty Architecture
Architecture documentation for the LzfDecoderTest class in LzfDecoderTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD fd4434e9_ec0d_236c_cba1_1760fabaa938["LzfDecoderTest"] 5c3deb25_2d52_a6c2_871c_2a55aa4abf6b["LzfDecoderTest.java"] fd4434e9_ec0d_236c_cba1_1760fabaa938 -->|defined in| 5c3deb25_2d52_a6c2_871c_2a55aa4abf6b bd2c0af3_cb72_c17b_6702_3ffd5dad3150["LzfDecoderTest()"] fd4434e9_ec0d_236c_cba1_1760fabaa938 -->|method| bd2c0af3_cb72_c17b_6702_3ffd5dad3150 bd3feae4_fd0d_b7fd_cac1_561073e0b2d8["EmbeddedChannel()"] fd4434e9_ec0d_236c_cba1_1760fabaa938 -->|method| bd3feae4_fd0d_b7fd_cac1_561073e0b2d8 61cabf77_1488_65aa_d134_9d92428d4c13["testUnexpectedBlockIdentifier()"] fd4434e9_ec0d_236c_cba1_1760fabaa938 -->|method| 61cabf77_1488_65aa_d134_9d92428d4c13 32715791_1570_1933_f584_19f8d662c079["testUnknownTypeOfChunk()"] fd4434e9_ec0d_236c_cba1_1760fabaa938 -->|method| 32715791_1570_1933_f584_19f8d662c079 e9cfc355_f012_229e_e709_4d494884e500["compress()"] fd4434e9_ec0d_236c_cba1_1760fabaa938 -->|method| e9cfc355_f012_229e_e709_4d494884e500
Relationship Graph
Source Code
codec-compression/src/test/java/io/netty/handler/codec/compression/LzfDecoderTest.java lines 29–74
public class LzfDecoderTest extends AbstractDecoderTest {
public LzfDecoderTest() throws Exception {
}
@Override
protected EmbeddedChannel createChannel() {
return new EmbeddedChannel(new LzfDecoder());
}
@Test
public void testUnexpectedBlockIdentifier() {
final ByteBuf in = Unpooled.buffer();
in.writeShort(0x1234); //random value
in.writeByte(BLOCK_TYPE_NON_COMPRESSED);
in.writeShort(0);
assertThrows(DecompressionException.class, new Executable() {
@Override
public void execute() {
channel.writeInbound(in);
}
}, "unexpected block identifier");
}
@Test
public void testUnknownTypeOfChunk() {
final ByteBuf in = Unpooled.buffer();
in.writeByte(BYTE_Z);
in.writeByte(BYTE_V);
in.writeByte(0xFF); //random value
in.writeInt(0);
assertThrows(DecompressionException.class, new Executable() {
@Override
public void execute() {
channel.writeInbound(in);
}
}, "unknown type of chunk");
}
@Override
protected byte[] compress(byte[] data) throws Exception {
return PlatformDependent.hasUnsafe() ? LZFEncoder.encode(data) : LZFEncoder.safeEncode(data);
}
}
Source
Frequently Asked Questions
What is the LzfDecoderTest class?
LzfDecoderTest is a class in the netty codebase, defined in codec-compression/src/test/java/io/netty/handler/codec/compression/LzfDecoderTest.java.
Where is LzfDecoderTest defined?
LzfDecoderTest is defined in codec-compression/src/test/java/io/netty/handler/codec/compression/LzfDecoderTest.java at line 29.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free