Home / Class/ ThreadExecutorMapTest Class — netty Architecture

ThreadExecutorMapTest Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  e711bd4e_54fa_d697_1f69_ed30e6807d36["ThreadExecutorMapTest"]
  c78783d2_30fe_4a8e_6457_c6a1d1bf1c86["ThreadExecutorMapTest.java"]
  e711bd4e_54fa_d697_1f69_ed30e6807d36 -->|defined in| c78783d2_30fe_4a8e_6457_c6a1d1bf1c86
  22ac2993_9df7_f13d_012c_23ac41fb18d3["testOldExecutorIsRestored()"]
  e711bd4e_54fa_d697_1f69_ed30e6807d36 -->|method| 22ac2993_9df7_f13d_012c_23ac41fb18d3
  53070770_1534_3b13_ff42_1eb35a7d7631["testDecorateExecutor()"]
  e711bd4e_54fa_d697_1f69_ed30e6807d36 -->|method| 53070770_1534_3b13_ff42_1eb35a7d7631
  517fbba0_9037_c478_fe85_5274834356be["testDecorateRunnable()"]
  e711bd4e_54fa_d697_1f69_ed30e6807d36 -->|method| 517fbba0_9037_c478_fe85_5274834356be
  10aed0e7_2b9a_fd3c_2a66_196949ebef17["testDecorateThreadFactory()"]
  e711bd4e_54fa_d697_1f69_ed30e6807d36 -->|method| 10aed0e7_2b9a_fd3c_2a66_196949ebef17

Relationship Graph

Source Code

common/src/test/java/io/netty/util/internal/ThreadExecutorMapTest.java lines 33–134

public class ThreadExecutorMapTest {
    private static final EventExecutor EVENT_EXECUTOR = new AbstractEventExecutor() {
        @Override
        public void shutdown() {
            throw new UnsupportedOperationException();
        }

        @Override
        public boolean inEventLoop(Thread thread) {
            return false;
        }

        @Override
        public boolean isShuttingDown() {
            return false;
        }

        @Override
        public Future<?> shutdownGracefully(long quietPeriod, long timeout, TimeUnit unit) {
            throw new UnsupportedOperationException();
        }

        @Override
        public Future<?> terminationFuture() {
            throw new UnsupportedOperationException();
        }

        @Override
        public boolean isShutdown() {
            return false;
        }

        @Override
        public boolean isTerminated() {
            return false;
        }

        @Override
        public boolean awaitTermination(long timeout, @NotNull TimeUnit unit) {
            return false;
        }

        @Override
        public void execute(@NotNull Runnable command) {
            throw new UnsupportedOperationException();
        }
    };

    @Test
    public void testOldExecutorIsRestored() {
        Executor executor = ThreadExecutorMap.apply(ImmediateExecutor.INSTANCE, ImmediateEventExecutor.INSTANCE);
        Executor executor2 = ThreadExecutorMap.apply(ImmediateExecutor.INSTANCE, EVENT_EXECUTOR);
        executor.execute(new Runnable() {
            @Override
            public void run() {
                executor2.execute(new Runnable() {
                    @Override
                    public void run() {
                        assertSame(EVENT_EXECUTOR, ThreadExecutorMap.currentExecutor());
                    }
                });
                assertSame(ImmediateEventExecutor.INSTANCE, ThreadExecutorMap.currentExecutor());
            }
        });
    }

    @Test
    public void testDecorateExecutor() {
        Executor executor = ThreadExecutorMap.apply(ImmediateExecutor.INSTANCE, ImmediateEventExecutor.INSTANCE);
        executor.execute(new Runnable() {
            @Override
            public void run() {
                assertSame(ImmediateEventExecutor.INSTANCE, ThreadExecutorMap.currentExecutor());
            }
        });
    }

    @Test
    public void testDecorateRunnable() {
        ThreadExecutorMap.apply(new Runnable() {
            @Override

Frequently Asked Questions

What is the ThreadExecutorMapTest class?
ThreadExecutorMapTest is a class in the netty codebase, defined in common/src/test/java/io/netty/util/internal/ThreadExecutorMapTest.java.
Where is ThreadExecutorMapTest defined?
ThreadExecutorMapTest is defined in common/src/test/java/io/netty/util/internal/ThreadExecutorMapTest.java at line 33.

Analyze Your Own Codebase

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

Try Supermodel Free