Home / Function/ testTaskRemovalOnShutdownThrowsNoUnsupportedOperationException() — netty Function Reference

testTaskRemovalOnShutdownThrowsNoUnsupportedOperationException() — netty Function Reference

Architecture documentation for the testTaskRemovalOnShutdownThrowsNoUnsupportedOperationException() function in NioEventLoopTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  e372d426_94ba_e2eb_e178_1b5d72df6d24["testTaskRemovalOnShutdownThrowsNoUnsupportedOperationException()"]
  744640b8_9d8b_07b6_4d95_821961ea4e63["NioEventLoopTest"]
  e372d426_94ba_e2eb_e178_1b5d72df6d24 -->|defined in| 744640b8_9d8b_07b6_4d95_821961ea4e63
  style e372d426_94ba_e2eb_e178_1b5d72df6d24 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport/src/test/java/io/netty/channel/nio/NioEventLoopTest.java lines 202–236

    @SuppressWarnings("deprecation")
    @Test
    public void testTaskRemovalOnShutdownThrowsNoUnsupportedOperationException() throws Exception {
        final AtomicReference<Throwable> error = new AtomicReference<Throwable>();
        final Runnable task = new Runnable() {
            @Override
            public void run() {
                // NOOP
            }
        };
        // Just run often enough to trigger it normally.
        for (int i = 0; i < 1000; i++) {
            EventLoopGroup group = new MultiThreadIoEventLoopGroup(1, NioIoHandler.newFactory());
            final EventLoop loop = group.next();

            Thread t = new Thread(new Runnable() {
                @Override
                public void run() {
                    try {
                        for (;;) {
                            loop.execute(task);
                        }
                    } catch (Throwable cause) {
                        error.set(cause);
                    }
                }
            });
            t.start();
            group.shutdownNow();
            t.join();
            group.terminationFuture().syncUninterruptibly();
            assertInstanceOf(RejectedExecutionException.class, error.get());
            error.set(null);
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does testTaskRemovalOnShutdownThrowsNoUnsupportedOperationException() do?
testTaskRemovalOnShutdownThrowsNoUnsupportedOperationException() is a function in the netty codebase, defined in transport/src/test/java/io/netty/channel/nio/NioEventLoopTest.java.
Where is testTaskRemovalOnShutdownThrowsNoUnsupportedOperationException() defined?
testTaskRemovalOnShutdownThrowsNoUnsupportedOperationException() is defined in transport/src/test/java/io/netty/channel/nio/NioEventLoopTest.java at line 202.

Analyze Your Own Codebase

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

Try Supermodel Free