Home / Class/ TestHandler Class — netty Architecture

TestHandler Class — netty Architecture

Architecture documentation for the TestHandler class in PendingWriteQueueTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  0d966029_8353_9df1_9042_4c0b69edb47c["TestHandler"]
  1a93edc6_89bc_2006_5947_2054d06c6714["PendingWriteQueueTest.java"]
  0d966029_8353_9df1_9042_4c0b69edb47c -->|defined in| 1a93edc6_89bc_2006_5947_2054d06c6714
  275816aa_6afd_01a7_9e79_90ea6ef196d3["channelActive()"]
  0d966029_8353_9df1_9042_4c0b69edb47c -->|method| 275816aa_6afd_01a7_9e79_90ea6ef196d3
  c0e66cf8_7fea_5c09_425e_7b33398c45e6["write()"]
  0d966029_8353_9df1_9042_4c0b69edb47c -->|method| c0e66cf8_7fea_5c09_425e_7b33398c45e6
  3c318cdf_c917_da17_c963_7ace79e37c0e["handlerAdded()"]
  0d966029_8353_9df1_9042_4c0b69edb47c -->|method| 3c318cdf_c917_da17_c963_7ace79e37c0e

Relationship Graph

Source Code

transport/src/test/java/io/netty/channel/PendingWriteQueueTest.java lines 347–370

    private static class TestHandler extends ChannelDuplexHandler {
        protected PendingWriteQueue queue;
        private int expectedSize;

        @Override
        public void channelActive(ChannelHandlerContext ctx) throws Exception {
            super.channelActive(ctx);
            assertQueueEmpty(queue);
            assertTrue(ctx.channel().isWritable(), "Should be writable");
        }

        @Override
        public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
            queue.add(msg, promise);
            assertFalse(queue.isEmpty());
            assertEquals(++expectedSize, queue.size());
            assertNotNull(queue.current());
        }

        @Override
        public void handlerAdded(ChannelHandlerContext ctx) throws Exception {
            queue = new PendingWriteQueue(ctx);
        }
    }

Frequently Asked Questions

What is the TestHandler class?
TestHandler is a class in the netty codebase, defined in transport/src/test/java/io/netty/channel/PendingWriteQueueTest.java.
Where is TestHandler defined?
TestHandler is defined in transport/src/test/java/io/netty/channel/PendingWriteQueueTest.java at line 347.

Analyze Your Own Codebase

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

Try Supermodel Free