Home / Function/ testDefaultThreadFactoryNonStickyThreadGroupConstructor() — netty Function Reference

testDefaultThreadFactoryNonStickyThreadGroupConstructor() — netty Function Reference

Architecture documentation for the testDefaultThreadFactoryNonStickyThreadGroupConstructor() function in DefaultThreadFactoryTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  1be54d70_05c9_ed46_9977_f24f74ac02ea["testDefaultThreadFactoryNonStickyThreadGroupConstructor()"]
  eaa6bd91_82d8_cddc_06fc_0aeeb341228a["DefaultThreadFactoryTest"]
  1be54d70_05c9_ed46_9977_f24f74ac02ea -->|defined in| eaa6bd91_82d8_cddc_06fc_0aeeb341228a
  style 1be54d70_05c9_ed46_9977_f24f74ac02ea fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

common/src/test/java/io/netty/util/concurrent/DefaultThreadFactoryTest.java lines 221–264

    @Test
    @Timeout(value = 2000, unit = TimeUnit.MILLISECONDS)
    public void testDefaultThreadFactoryNonStickyThreadGroupConstructor() throws InterruptedException {

        final AtomicReference<DefaultThreadFactory> factory = new AtomicReference<DefaultThreadFactory>();
        final AtomicReference<ThreadGroup> firstCaptured = new AtomicReference<ThreadGroup>();

        final ThreadGroup firstGroup = new ThreadGroup("first");
        final Thread first = new Thread(firstGroup, new Runnable() {
            @Override
            public void run() {
                factory.set(new DefaultThreadFactory("sticky", false, Thread.NORM_PRIORITY, null));
                final Thread t = factory.get().newThread(new Runnable() {
                    @Override
                    public void run() {
                    }
                });
                firstCaptured.set(t.getThreadGroup());
            }
        });
        first.start();
        first.join();

        assertEquals(firstGroup, firstCaptured.get());

        final AtomicReference<ThreadGroup> secondCaptured = new AtomicReference<ThreadGroup>();

        final ThreadGroup secondGroup = new ThreadGroup("second");
        final Thread second = new Thread(secondGroup, new Runnable() {
            @Override
            public void run() {
                final Thread t = factory.get().newThread(new Runnable() {
                    @Override
                    public void run() {
                    }
                });
                secondCaptured.set(t.getThreadGroup());
            }
        });
        second.start();
        second.join();

        assertEquals(secondGroup, secondCaptured.get());
    }

Domain

Subdomains

Frequently Asked Questions

What does testDefaultThreadFactoryNonStickyThreadGroupConstructor() do?
testDefaultThreadFactoryNonStickyThreadGroupConstructor() is a function in the netty codebase, defined in common/src/test/java/io/netty/util/concurrent/DefaultThreadFactoryTest.java.
Where is testDefaultThreadFactoryNonStickyThreadGroupConstructor() defined?
testDefaultThreadFactoryNonStickyThreadGroupConstructor() is defined in common/src/test/java/io/netty/util/concurrent/DefaultThreadFactoryTest.java at line 221.

Analyze Your Own Codebase

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

Try Supermodel Free