Home / Function/ testEncode() — netty Function Reference

testEncode() — netty Function Reference

Architecture documentation for the testEncode() function in StringEncoderTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  771084e3_0101_c45c_16e8_5b445ac82cbd["testEncode()"]
  7dd3b241_f441_9090_a0e6_beb9c7648958["StringEncoderTest"]
  771084e3_0101_c45c_16e8_5b445ac82cbd -->|defined in| 7dd3b241_f441_9090_a0e6_beb9c7648958
  style 771084e3_0101_c45c_16e8_5b445ac82cbd fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-base/src/test/java/io/netty/handler/codec/string/StringEncoderTest.java lines 28–41

    @Test
    public void testEncode() {
        String msg = "Test";
        EmbeddedChannel channel = new EmbeddedChannel(new StringEncoder());
        Assertions.assertTrue(channel.writeOutbound(msg));
        Assertions.assertTrue(channel.finish());
        ByteBuf buf = channel.readOutbound();
        byte[] data = new byte[buf.readableBytes()];
        buf.readBytes(data);
        Assertions.assertArrayEquals(msg.getBytes(CharsetUtil.UTF_8), data);
        Assertions.assertNull(channel.readOutbound());
        buf.release();
        assertFalse(channel.finish());
    }

Domain

Subdomains

Frequently Asked Questions

What does testEncode() do?
testEncode() is a function in the netty codebase, defined in codec-base/src/test/java/io/netty/handler/codec/string/StringEncoderTest.java.
Where is testEncode() defined?
testEncode() is defined in codec-base/src/test/java/io/netty/handler/codec/string/StringEncoderTest.java at line 28.

Analyze Your Own Codebase

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

Try Supermodel Free