Home / Function/ testListenerFailure() — netty Function Reference

testListenerFailure() — netty Function Reference

Architecture documentation for the testListenerFailure() function in PromiseNotifierTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  b1353a69_e2a8_1de8_3550_3b5b70ee3a3d["testListenerFailure()"]
  6d5f1092_59f3_c2aa_4bca_e779a4aabfcd["PromiseNotifierTest"]
  b1353a69_e2a8_1de8_3550_3b5b70ee3a3d -->|defined in| 6d5f1092_59f3_c2aa_4bca_e779a4aabfcd
  style b1353a69_e2a8_1de8_3550_3b5b70ee3a3d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

common/src/test/java/io/netty/util/concurrent/PromiseNotifierTest.java lines 73–96

    @Test
    public void testListenerFailure() throws Exception {
        @SuppressWarnings("unchecked")
        Promise<Void> p1 = mock(Promise.class);
        @SuppressWarnings("unchecked")
        Promise<Void> p2 = mock(Promise.class);

        @SuppressWarnings("unchecked")
        PromiseNotifier<Void, Future<Void>> notifier =
                new PromiseNotifier<Void, Future<Void>>(p1, p2);

        @SuppressWarnings("unchecked")
        Future<Void> future = mock(Future.class);
        Throwable t = mock(Throwable.class);
        when(future.isSuccess()).thenReturn(false);
        when(future.isCancelled()).thenReturn(false);
        when(future.cause()).thenReturn(t);
        when(p1.tryFailure(t)).thenReturn(true);
        when(p2.tryFailure(t)).thenReturn(true);

        notifier.operationComplete(future);
        verify(p1).tryFailure(t);
        verify(p2).tryFailure(t);
    }

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free