Home / Class/ EmbeddedChannelIdTest Class — netty Architecture

EmbeddedChannelIdTest Class — netty Architecture

Architecture documentation for the EmbeddedChannelIdTest class in EmbeddedChannelIdTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  09415989_7b67_43b6_5ff5_500d7fa3e835["EmbeddedChannelIdTest"]
  4ce01fc9_6941_0f17_0cf6_83606717ffc0["EmbeddedChannelIdTest.java"]
  09415989_7b67_43b6_5ff5_500d7fa3e835 -->|defined in| 4ce01fc9_6941_0f17_0cf6_83606717ffc0
  8495c00c_7de3_701e_582f_ead52aab9c50["testSerialization()"]
  09415989_7b67_43b6_5ff5_500d7fa3e835 -->|method| 8495c00c_7de3_701e_582f_ead52aab9c50

Relationship Graph

Source Code

transport/src/test/java/io/netty/channel/embedded/EmbeddedChannelIdTest.java lines 31–53

public class EmbeddedChannelIdTest {

    @Test
    public void testSerialization() throws IOException, ClassNotFoundException {
        // test that a deserialized instance works the same as a normal instance (issue #2869)
        ChannelId normalInstance = EmbeddedChannelId.INSTANCE;

        ByteBuf buf = Unpooled.buffer();
        try (ObjectOutputStream outStream = new ObjectOutputStream(new ByteBufOutputStream(buf))) {
            outStream.writeObject(normalInstance);
        }

        final ChannelId deserializedInstance;
        try (ObjectInputStream inStream = new ObjectInputStream(new ByteBufInputStream(buf, true))) {
            deserializedInstance = (ChannelId) inStream.readObject();
        }

        assertEquals(normalInstance, deserializedInstance);
        assertEquals(normalInstance.hashCode(), deserializedInstance.hashCode());
        assertEquals(0, normalInstance.compareTo(deserializedInstance));
    }

}

Frequently Asked Questions

What is the EmbeddedChannelIdTest class?
EmbeddedChannelIdTest is a class in the netty codebase, defined in transport/src/test/java/io/netty/channel/embedded/EmbeddedChannelIdTest.java.
Where is EmbeddedChannelIdTest defined?
EmbeddedChannelIdTest is defined in transport/src/test/java/io/netty/channel/embedded/EmbeddedChannelIdTest.java at line 31.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free