Home / Function/ testSuspensionWhenExecutorIsNotStarted() — netty Function Reference

testSuspensionWhenExecutorIsNotStarted() — netty Function Reference

Architecture documentation for the testSuspensionWhenExecutorIsNotStarted() function in SingleThreadEventExecutorTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  6271404d_9287_da8b_368e_d0293a2734ac["testSuspensionWhenExecutorIsNotStarted()"]
  bbf4ea8d_698f_542a_1559_437b1b237a04["SingleThreadEventExecutorTest"]
  6271404d_9287_da8b_368e_d0293a2734ac -->|defined in| bbf4ea8d_698f_542a_1559_437b1b237a04
  28e9ff91_b16f_87e3_9960_0088813993be["SuspendingSingleThreadEventExecutor()"]
  6271404d_9287_da8b_368e_d0293a2734ac -->|calls| 28e9ff91_b16f_87e3_9960_0088813993be
  73126f1a_7f15_6c07_da13_1ed18aee4cf7["LatchTask()"]
  6271404d_9287_da8b_368e_d0293a2734ac -->|calls| 73126f1a_7f15_6c07_da13_1ed18aee4cf7
  style 6271404d_9287_da8b_368e_d0293a2734ac fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

common/src/test/java/io/netty/util/concurrent/SingleThreadEventExecutorTest.java lines 145–169

    @Test
    void testSuspensionWhenExecutorIsNotStarted() throws Exception {
        TestThreadFactory threadFactory = new TestThreadFactory();
        final SingleThreadEventExecutor executor = new SuspendingSingleThreadEventExecutor(threadFactory);
        // suspend when executor is not started yet
        assertTrue(executor.trySuspend());
        assertTrue(executor.isSuspended());

        // recover from suspension by executing a task
        LatchTask task1 = new LatchTask();
        executor.execute(task1);
        Thread currentThread = threadFactory.threads.take();
        assertFalse(executor.isSuspended());
        task1.await();

        executor.shutdownGracefully(0, 0, TimeUnit.MILLISECONDS).syncUninterruptibly();
        currentThread.join();
        assertFalse(executor.isSuspended());
        assertTrue(executor.isShutdown());

        // Guarantee that all threads were able to die...
        while ((currentThread = threadFactory.threads.poll()) != null) {
            currentThread.join();
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does testSuspensionWhenExecutorIsNotStarted() do?
testSuspensionWhenExecutorIsNotStarted() is a function in the netty codebase, defined in common/src/test/java/io/netty/util/concurrent/SingleThreadEventExecutorTest.java.
Where is testSuspensionWhenExecutorIsNotStarted() defined?
testSuspensionWhenExecutorIsNotStarted() is defined in common/src/test/java/io/netty/util/concurrent/SingleThreadEventExecutorTest.java at line 145.
What does testSuspensionWhenExecutorIsNotStarted() call?
testSuspensionWhenExecutorIsNotStarted() calls 2 function(s): LatchTask, SuspendingSingleThreadEventExecutor.

Analyze Your Own Codebase

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

Try Supermodel Free