Home / Class/ CompleteChannelFutureTest Class — netty Architecture

CompleteChannelFutureTest Class — netty Architecture

Architecture documentation for the CompleteChannelFutureTest class in CompleteChannelFutureTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  150c4b54_92d7_b92b_77b3_e88f7d548bad["CompleteChannelFutureTest"]
  1d905be3_60d5_c209_a3d8_782e3a117b1d["CompleteChannelFutureTest.java"]
  150c4b54_92d7_b92b_77b3_e88f7d548bad -->|defined in| 1d905be3_60d5_c209_a3d8_782e3a117b1d
  d0b59f52_fa8a_af92_6258_8c614599fef0["shouldDisallowNullChannel()"]
  150c4b54_92d7_b92b_77b3_e88f7d548bad -->|method| d0b59f52_fa8a_af92_6258_8c614599fef0
  df4e5b5b_6e99_4eca_3dca_a399feb122cc["shouldNotDoAnythingOnRemove()"]
  150c4b54_92d7_b92b_77b3_e88f7d548bad -->|method| df4e5b5b_6e99_4eca_3dca_a399feb122cc
  046e65b0_731f_d2c5_e437_778b89f29ac6["testConstantProperties()"]
  150c4b54_92d7_b92b_77b3_e88f7d548bad -->|method| 046e65b0_731f_d2c5_e437_778b89f29ac6

Relationship Graph

Source Code

transport/src/test/java/io/netty/channel/CompleteChannelFutureTest.java lines 28–92

public class CompleteChannelFutureTest {

    @Test
    public void shouldDisallowNullChannel() {
        assertThrows(NullPointerException.class, new Executable() {
            @Override
            public void execute() {
                new CompleteChannelFutureImpl(null);
            }
        });
    }

    @Test
    public void shouldNotDoAnythingOnRemove() {
        Channel channel = Mockito.mock(Channel.class);
        CompleteChannelFuture future = new CompleteChannelFutureImpl(channel);
        ChannelFutureListener l = Mockito.mock(ChannelFutureListener.class);
        future.removeListener(l);
        Mockito.verifyNoMoreInteractions(l);
        Mockito.verifyNoInteractions(channel);
    }

    @Test
    public void testConstantProperties() throws InterruptedException {
        Channel channel = Mockito.mock(Channel.class);
        CompleteChannelFuture future = new CompleteChannelFutureImpl(channel);

        assertSame(channel, future.channel());
        assertTrue(future.isDone());
        assertSame(future, future.await());
        assertTrue(future.await(1));
        assertTrue(future.await(1, TimeUnit.NANOSECONDS));
        assertSame(future, future.awaitUninterruptibly());
        assertTrue(future.awaitUninterruptibly(1));
        assertTrue(future.awaitUninterruptibly(1, TimeUnit.NANOSECONDS));
        Mockito.verifyNoInteractions(channel);
    }

    private static class CompleteChannelFutureImpl extends CompleteChannelFuture {

        CompleteChannelFutureImpl(Channel channel) {
            super(channel, null);
        }

        @Override
        public Throwable cause() {
            throw new UnsupportedOperationException("cause is not supported for " + getClass().getName());
        }

        @Override
        public boolean isSuccess() {
            throw new UnsupportedOperationException("isSuccess is not supported for " + getClass().getName());
        }

        @Override
        public ChannelFuture sync() {
            throw new UnsupportedOperationException("sync is not supported for " + getClass().getName());
        }

        @Override
        public ChannelFuture syncUninterruptibly() {
            throw new UnsupportedOperationException("syncUninterruptibly is not supported for " + getClass().getName());
        }
    }
}

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free