Home / Function/ testRemoveWhileInCallDecode() — netty Function Reference

testRemoveWhileInCallDecode() — netty Function Reference

Architecture documentation for the testRemoveWhileInCallDecode() function in ByteToMessageDecoderTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  9247eabb_a09b_cac5_89fd_993c11b416f4["testRemoveWhileInCallDecode()"]
  b1c999fe_35fb_8b70_a958_296cffb0616a["ByteToMessageDecoderTest"]
  9247eabb_a09b_cac5_89fd_993c11b416f4 -->|defined in| b1c999fe_35fb_8b70_a958_296cffb0616a
  5082856a_b229_862d_0072_81f9b24f56a3["EmbeddedChannel()"]
  9247eabb_a09b_cac5_89fd_993c11b416f4 -->|calls| 5082856a_b229_862d_0072_81f9b24f56a3
  style 9247eabb_a09b_cac5_89fd_993c11b416f4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-base/src/test/java/io/netty/handler/codec/ByteToMessageDecoderTest.java lines 218–247

    @Test
    public void testRemoveWhileInCallDecode() {
        final Object upgradeMessage = new Object();
        final ByteToMessageDecoder decoder = new ByteToMessageDecoder() {
            @Override
            protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
                assertEquals('a', in.readByte());
                out.add(upgradeMessage);
            }
        };

        EmbeddedChannel channel = new EmbeddedChannel(decoder, new ChannelInboundHandlerAdapter() {
            @Override
            public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
                if (msg == upgradeMessage) {
                    ctx.pipeline().remove(decoder);
                    return;
                }
                ctx.fireChannelRead(msg);
            }
        });

        ByteBuf buf = Unpooled.wrappedBuffer(new byte[] { 'a', 'b', 'c' });
        assertTrue(channel.writeInbound(buf.copy()));
        ByteBuf b = channel.readInbound();
        assertEquals(b, buf.skipBytes(1));
        assertFalse(channel.finish());
        buf.release();
        b.release();
    }

Domain

Subdomains

Frequently Asked Questions

What does testRemoveWhileInCallDecode() do?
testRemoveWhileInCallDecode() is a function in the netty codebase, defined in codec-base/src/test/java/io/netty/handler/codec/ByteToMessageDecoderTest.java.
Where is testRemoveWhileInCallDecode() defined?
testRemoveWhileInCallDecode() is defined in codec-base/src/test/java/io/netty/handler/codec/ByteToMessageDecoderTest.java at line 218.
What does testRemoveWhileInCallDecode() call?
testRemoveWhileInCallDecode() calls 1 function(s): EmbeddedChannel.

Analyze Your Own Codebase

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

Try Supermodel Free