Home / Class/ LocalTransportThreadModelTest3 Class — netty Architecture

LocalTransportThreadModelTest3 Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  f86ec9f6_ad3f_1246_2bcb_3e0c74480849["LocalTransportThreadModelTest3"]
  1d7a584f_0b8f_1af1_7aae_abb923f4163b["LocalTransportThreadModelTest3.java"]
  f86ec9f6_ad3f_1246_2bcb_3e0c74480849 -->|defined in| 1d7a584f_0b8f_1af1_7aae_abb923f4163b
  1ba35c45_4481_a9ea_7bb4_b9df8a73305d["init()"]
  f86ec9f6_ad3f_1246_2bcb_3e0c74480849 -->|method| 1ba35c45_4481_a9ea_7bb4_b9df8a73305d
  2f808eb3_f6f4_8b37_09c4_5db1d5edc68d["destroy()"]
  f86ec9f6_ad3f_1246_2bcb_3e0c74480849 -->|method| 2f808eb3_f6f4_8b37_09c4_5db1d5edc68d
  b11ab351_9359_4143_15a3_86b694c2d257["testConcurrentAddRemoveInboundEventsMultiple()"]
  f86ec9f6_ad3f_1246_2bcb_3e0c74480849 -->|method| b11ab351_9359_4143_15a3_86b694c2d257
  2cbfae34_2369_444b_80c7_6a2381966e13["testConcurrentAddRemoveOutboundEventsMultiple()"]
  f86ec9f6_ad3f_1246_2bcb_3e0c74480849 -->|method| 2cbfae34_2369_444b_80c7_6a2381966e13
  b0cc291c_461c_e05c_f2bf_3ff94d6469ff["testConcurrentAddRemoveInboundEvents()"]
  f86ec9f6_ad3f_1246_2bcb_3e0c74480849 -->|method| b0cc291c_461c_e05c_f2bf_3ff94d6469ff
  d7140350_8361_fc0e_c145_b07f4959808a["testConcurrentAddRemoveOutboundEvents()"]
  f86ec9f6_ad3f_1246_2bcb_3e0c74480849 -->|method| d7140350_8361_fc0e_c145_b07f4959808a
  364f868b_2802_fe3b_5533_83572757fe40["testConcurrentAddRemove()"]
  f86ec9f6_ad3f_1246_2bcb_3e0c74480849 -->|method| 364f868b_2802_fe3b_5533_83572757fe40
  3040527d_343e_e75c_3640_cf84c1de7f83["events()"]
  f86ec9f6_ad3f_1246_2bcb_3e0c74480849 -->|method| 3040527d_343e_e75c_3640_cf84c1de7f83

Relationship Graph

Source Code

transport/src/test/java/io/netty/channel/local/LocalTransportThreadModelTest3.java lines 49–337

public class LocalTransportThreadModelTest3 {

    enum EventType {
        EXCEPTION_CAUGHT,
        USER_EVENT,
        MESSAGE_RECEIVED_LAST,
        INACTIVE,
        ACTIVE,
        UNREGISTERED,
        REGISTERED,
        MESSAGE_RECEIVED,
        WRITE,
        READ
    }

    private static EventLoopGroup group;
    private static LocalAddress localAddr;

    @BeforeAll
    public static void init() {
        // Configure a test server
        group = new MultiThreadIoEventLoopGroup(LocalIoHandler.newFactory());
        ServerBootstrap sb = new ServerBootstrap();
        sb.group(group)
                .channel(LocalServerChannel.class)
                .childHandler(new ChannelInitializer<LocalChannel>() {
                    @Override
                    public void initChannel(LocalChannel ch) throws Exception {
                        ch.pipeline().addLast(new ChannelInboundHandlerAdapter() {
                            @Override
                            public void channelRead(ChannelHandlerContext ctx, Object msg) {
                                // Discard
                                ReferenceCountUtil.release(msg);
                            }
                        });
                    }
                });

        localAddr = (LocalAddress) sb.bind(LocalAddress.ANY).syncUninterruptibly().channel().localAddress();
    }

    @AfterAll
    public static void destroy() throws Exception {
        group.shutdownGracefully().sync();
    }

    @Test
    @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS)
    @Disabled("regression test")
    public void testConcurrentAddRemoveInboundEventsMultiple() throws Throwable {
        for (int i = 0; i < 50; i ++) {
            testConcurrentAddRemoveInboundEvents();
        }
    }

    @Test
    @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS)
    @Disabled("regression test")
    public void testConcurrentAddRemoveOutboundEventsMultiple() throws Throwable {
        for (int i = 0; i < 50; i ++) {
            testConcurrentAddRemoveOutboundEvents();
        }
    }

    @Test
    @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS)
    @Disabled("needs a fix")
    public void testConcurrentAddRemoveInboundEvents() throws Throwable {
        testConcurrentAddRemove(true);
    }

    @Test
    @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS)
    @Disabled("needs a fix")
    public void testConcurrentAddRemoveOutboundEvents() throws Throwable {
        testConcurrentAddRemove(false);
    }

    private static void testConcurrentAddRemove(boolean inbound) throws Exception {
        EventLoopGroup l = new MultiThreadIoEventLoopGroup(
                4, new DefaultThreadFactory("l"), LocalIoHandler.newFactory());

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free