Home / Function/ testThreadProperties() — netty Function Reference

testThreadProperties() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  df833e4a_f808_ea25_ad90_415d001157d1["testThreadProperties()"]
  bbf4ea8d_698f_542a_1559_437b1b237a04["SingleThreadEventExecutorTest"]
  df833e4a_f808_ea25_ad90_415d001157d1 -->|defined in| bbf4ea8d_698f_542a_1559_437b1b237a04
  d1474077_6d3a_87c2_2d11_070af739005b["run()"]
  df833e4a_f808_ea25_ad90_415d001157d1 -->|calls| d1474077_6d3a_87c2_2d11_070af739005b
  style df833e4a_f808_ea25_ad90_415d001157d1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

common/src/test/java/io/netty/util/concurrent/SingleThreadEventExecutorTest.java lines 293–319

    @Test
    public void testThreadProperties() {
        final AtomicReference<Thread> threadRef = new AtomicReference<Thread>();
        SingleThreadEventExecutor executor = new SingleThreadEventExecutor(
                null, new DefaultThreadFactory("test"), false) {
            @Override
            protected void run() {
                threadRef.set(Thread.currentThread());
                while (!confirmShutdown()) {
                    Runnable task = takeTask();
                    if (task != null) {
                        task.run();
                    }
                }
            }
        };
        ThreadProperties threadProperties = executor.threadProperties();

        Thread thread = threadRef.get();
        assertEquals(thread.getId(), threadProperties.id());
        assertEquals(thread.getName(), threadProperties.name());
        assertEquals(thread.getPriority(), threadProperties.priority());
        assertEquals(thread.isAlive(), threadProperties.isAlive());
        assertEquals(thread.isDaemon(), threadProperties.isDaemon());
        assertTrue(threadProperties.stackTrace().length > 0);
        executor.shutdownGracefully(0, 0, TimeUnit.MILLISECONDS).syncUninterruptibly();
    }

Domain

Subdomains

Calls

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free