CompatibleObjectEncoderTest Class — netty Architecture
Architecture documentation for the CompatibleObjectEncoderTest class in CompatibleObjectEncoderTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 8313722a_d7bd_b903_b703_f08418dc010a["CompatibleObjectEncoderTest"] a8559666_e853_8a0e_6a8c_147e2c3620e6["CompatibleObjectEncoderTest.java"] 8313722a_d7bd_b903_b703_f08418dc010a -->|defined in| a8559666_e853_8a0e_6a8c_147e2c3620e6 b528ba90_5706_e201_32eb_16a4b92ede7c["testMultipleEncodeReferenceCount()"] 8313722a_d7bd_b903_b703_f08418dc010a -->|method| b528ba90_5706_e201_32eb_16a4b92ede7c 74770f98_1f4d_593e_cf30_acb799e66e63["testEncode()"] 8313722a_d7bd_b903_b703_f08418dc010a -->|method| 74770f98_1f4d_593e_cf30_acb799e66e63
Relationship Graph
Source Code
codec-base/src/test/java/io/netty/handler/codec/serialization/CompatibleObjectEncoderTest.java lines 30–77
public class CompatibleObjectEncoderTest {
@Test
public void testMultipleEncodeReferenceCount() throws IOException, ClassNotFoundException {
EmbeddedChannel channel = new EmbeddedChannel(new CompatibleObjectEncoder());
testEncode(channel, new TestSerializable(6, 8));
testEncode(channel, new TestSerializable(10, 5));
testEncode(channel, new TestSerializable(1, 5));
assertFalse(channel.finishAndReleaseAll());
}
private static void testEncode(EmbeddedChannel channel, TestSerializable original)
throws IOException, ClassNotFoundException {
channel.writeOutbound(original);
Object o = channel.readOutbound();
ByteBuf buf = (ByteBuf) o;
try (ObjectInputStream ois = new ObjectInputStream(new ByteBufInputStream(buf))) {
assertEquals(original, ois.readObject());
} finally {
buf.release();
}
}
private static final class TestSerializable implements Serializable {
private static final long serialVersionUID = 2235771472534930360L;
public final int x;
public final int y;
TestSerializable(int x, int y) {
this.x = x;
this.y = y;
}
@Override
public boolean equals(Object o) {
if (!(o instanceof TestSerializable)) {
return false;
}
TestSerializable rhs = (TestSerializable) o;
return x == rhs.x && y == rhs.y;
}
@Override
public int hashCode() {
return 31 * (31 + x) + y;
}
}
}
Defined In
Source
Frequently Asked Questions
What is the CompatibleObjectEncoderTest class?
CompatibleObjectEncoderTest is a class in the netty codebase, defined in codec-base/src/test/java/io/netty/handler/codec/serialization/CompatibleObjectEncoderTest.java.
Where is CompatibleObjectEncoderTest defined?
CompatibleObjectEncoderTest is defined in codec-base/src/test/java/io/netty/handler/codec/serialization/CompatibleObjectEncoderTest.java at line 30.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free