Home / Function/ testTicker() — netty Function Reference

testTicker() — netty Function Reference

Architecture documentation for the testTicker() function in ManualIoEventLoopTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  50569f59_1329_6c39_fae5_fef14c568fe7["testTicker()"]
  7f1091cc_a8b6_0293_92ad_d94222ae6482["ManualIoEventLoopTest"]
  50569f59_1329_6c39_fae5_fef14c568fe7 -->|defined in| 7f1091cc_a8b6_0293_92ad_d94222ae6482
  style 50569f59_1329_6c39_fae5_fef14c568fe7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport/src/test/java/io/netty/channel/ManualIoEventLoopTest.java lines 339–360

    @Test
    public void testTicker() {
        MockTicker ticker = Ticker.newMockTicker();
        ManualIoEventLoop eventLoop = new ManualIoEventLoop(
                null, Thread.currentThread(), NioIoHandler.newFactory(), ticker);

        AtomicInteger counter = new AtomicInteger();
        eventLoop.schedule(counter::incrementAndGet, 60, TimeUnit.SECONDS);

        eventLoop.runNow();
        assertEquals(0, counter.get());

        ticker.advance(50, TimeUnit.SECONDS);
        eventLoop.runNow();
        assertEquals(0, counter.get());

        ticker.advance(20, TimeUnit.SECONDS);
        eventLoop.runNow();
        assertEquals(1, counter.get());

        eventLoop.shutdownGracefully();
    }

Domain

Subdomains

Frequently Asked Questions

What does testTicker() do?
testTicker() is a function in the netty codebase, defined in transport/src/test/java/io/netty/channel/ManualIoEventLoopTest.java.
Where is testTicker() defined?
testTicker() is defined in transport/src/test/java/io/netty/channel/ManualIoEventLoopTest.java at line 339.

Analyze Your Own Codebase

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

Try Supermodel Free