Home / Function/ testDefaultThreadFactoryInheritsThreadGroupFromSecurityManager() — netty Function Reference

testDefaultThreadFactoryInheritsThreadGroupFromSecurityManager() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  acdf49b3_934e_cbb4_487b_ff54a875c5c5["testDefaultThreadFactoryInheritsThreadGroupFromSecurityManager()"]
  eaa6bd91_82d8_cddc_06fc_0aeeb341228a["DefaultThreadFactoryTest"]
  acdf49b3_934e_cbb4_487b_ff54a875c5c5 -->|defined in| eaa6bd91_82d8_cddc_06fc_0aeeb341228a
  f0b3dd12_3d19_4b8d_e4bc_69ef17ce3819["runStickyThreadGroupTest()"]
  acdf49b3_934e_cbb4_487b_ff54a875c5c5 -->|calls| f0b3dd12_3d19_4b8d_e4bc_69ef17ce3819
  style acdf49b3_934e_cbb4_487b_ff54a875c5c5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

common/src/test/java/io/netty/util/concurrent/DefaultThreadFactoryTest.java lines 147–185

    @Test
    @Timeout(value = 2000, unit = TimeUnit.MILLISECONDS)
    public void testDefaultThreadFactoryInheritsThreadGroupFromSecurityManager() throws InterruptedException {
        final SecurityManager current = System.getSecurityManager();

        boolean securityManagerSet = false;
        try {
            final ThreadGroup sticky = new ThreadGroup("sticky");
            try {
                System.setSecurityManager(new SecurityManager() {
                    @Override
                    public ThreadGroup getThreadGroup() {
                        return sticky;
                    }

                    // so we can restore the security manager at the end of the test
                    @Override
                    public void checkPermission(Permission perm) {
                    }
                });
            } catch (UnsupportedOperationException e) {
                Assumptions.assumeFalse(true, "Setting SecurityManager not supported");
            }
            securityManagerSet = true;

            runStickyThreadGroupTest(
                    new Callable<DefaultThreadFactory>() {
                        @Override
                        public DefaultThreadFactory call() throws Exception {
                            return new DefaultThreadFactory("test");
                        }
                    },
                    sticky);
        } finally {
            if (securityManagerSet) {
                System.setSecurityManager(current);
            }
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does testDefaultThreadFactoryInheritsThreadGroupFromSecurityManager() do?
testDefaultThreadFactoryInheritsThreadGroupFromSecurityManager() is a function in the netty codebase, defined in common/src/test/java/io/netty/util/concurrent/DefaultThreadFactoryTest.java.
Where is testDefaultThreadFactoryInheritsThreadGroupFromSecurityManager() defined?
testDefaultThreadFactoryInheritsThreadGroupFromSecurityManager() is defined in common/src/test/java/io/netty/util/concurrent/DefaultThreadFactoryTest.java at line 147.
What does testDefaultThreadFactoryInheritsThreadGroupFromSecurityManager() call?
testDefaultThreadFactoryInheritsThreadGroupFromSecurityManager() calls 1 function(s): runStickyThreadGroupTest.

Analyze Your Own Codebase

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

Try Supermodel Free