Home / Function/ ensureSubsequentRegistrationDoesNotFireActive() — netty Function Reference

ensureSubsequentRegistrationDoesNotFireActive() — netty Function Reference

Architecture documentation for the ensureSubsequentRegistrationDoesNotFireActive() function in AbstractChannelTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  f02f8dd4_ae43_9cb4_dad3_4d9110ec9db3["ensureSubsequentRegistrationDoesNotFireActive()"]
  63f919c7_8527_59bf_45a5_f49840c141ac["AbstractChannelTest"]
  f02f8dd4_ae43_9cb4_dad3_4d9110ec9db3 -->|defined in| 63f919c7_8527_59bf_45a5_f49840c141ac
  d4f5c0aa_d142_d540_e56d_49a5ff92416f["TestChannel()"]
  f02f8dd4_ae43_9cb4_dad3_4d9110ec9db3 -->|calls| d4f5c0aa_d142_d540_e56d_49a5ff92416f
  9225cd8f_6728_b060_f06a_6f6e2e5381c9["registerChannel()"]
  f02f8dd4_ae43_9cb4_dad3_4d9110ec9db3 -->|calls| 9225cd8f_6728_b060_f06a_6f6e2e5381c9
  style f02f8dd4_ae43_9cb4_dad3_4d9110ec9db3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport/src/test/java/io/netty/channel/AbstractChannelTest.java lines 55–85

    @Test
    public void ensureSubsequentRegistrationDoesNotFireActive() throws Throwable {
        final EventLoop eventLoop = mock(EventLoop.class);
        // This allows us to have a single-threaded test
        when(eventLoop.inEventLoop()).thenReturn(true);

        doAnswer(new Answer<Object>() {
            @Override
            public Object answer(InvocationOnMock invocationOnMock) {
                ((Runnable) invocationOnMock.getArgument(0)).run();
                return null;
            }
        }).when(eventLoop).execute(any(Runnable.class));

        final TestChannel channel = new TestChannel();
        ChannelInboundHandler handler = mock(ChannelInboundHandler.class);

        channel.pipeline().addLast(handler);

        registerChannel(eventLoop, channel);
        channel.unsafe().deregister(new DefaultChannelPromise(channel));

        registerChannel(eventLoop, channel);

        verify(handler).handlerAdded(any(ChannelHandlerContext.class));

        // Should register twice
        verify(handler,  times(2)) .channelRegistered(any(ChannelHandlerContext.class));
        verify(handler).channelActive(any(ChannelHandlerContext.class));
        verify(handler).channelUnregistered(any(ChannelHandlerContext.class));
    }

Domain

Subdomains

Frequently Asked Questions

What does ensureSubsequentRegistrationDoesNotFireActive() do?
ensureSubsequentRegistrationDoesNotFireActive() is a function in the netty codebase, defined in transport/src/test/java/io/netty/channel/AbstractChannelTest.java.
Where is ensureSubsequentRegistrationDoesNotFireActive() defined?
ensureSubsequentRegistrationDoesNotFireActive() is defined in transport/src/test/java/io/netty/channel/AbstractChannelTest.java at line 55.
What does ensureSubsequentRegistrationDoesNotFireActive() call?
ensureSubsequentRegistrationDoesNotFireActive() calls 2 function(s): TestChannel, registerChannel.

Analyze Your Own Codebase

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

Try Supermodel Free