Home / Function/ testSerialization() — netty Function Reference

testSerialization() — netty Function Reference

Architecture documentation for the testSerialization() function in Http2StreamChannelIdTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  f6202420_7cf9_133c_6637_747b1f6de19e["testSerialization()"]
  c1fe30a4_a1d0_fd85_639c_7316b7921d57["Http2StreamChannelIdTest"]
  f6202420_7cf9_133c_6637_747b1f6de19e -->|defined in| c1fe30a4_a1d0_fd85_639c_7316b7921d57
  style f6202420_7cf9_133c_6637_747b1f6de19e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/test/java/io/netty/handler/codec/http2/Http2StreamChannelIdTest.java lines 32–57

    @Test
    public void testSerialization() throws Exception {
        ChannelId normalInstance = new Http2StreamChannelId(DefaultChannelId.newInstance(), 0);

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

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

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

Domain

Subdomains

Frequently Asked Questions

What does testSerialization() do?
testSerialization() is a function in the netty codebase, defined in codec-http2/src/test/java/io/netty/handler/codec/http2/Http2StreamChannelIdTest.java.
Where is testSerialization() defined?
testSerialization() is defined in codec-http2/src/test/java/io/netty/handler/codec/http2/Http2StreamChannelIdTest.java at line 32.

Analyze Your Own Codebase

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

Try Supermodel Free