Home / Function/ testPromiseListenerAddWhenComplete() — netty Function Reference

testPromiseListenerAddWhenComplete() — netty Function Reference

Architecture documentation for the testPromiseListenerAddWhenComplete() function in DefaultPromiseTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  e760fb78_c892_f94d_ba1f_2d7203f2f5d3["testPromiseListenerAddWhenComplete()"]
  18d135a2_101c_bae7_e68f_dd4660e1fb75["DefaultPromiseTest"]
  e760fb78_c892_f94d_ba1f_2d7203f2f5d3 -->|defined in| 18d135a2_101c_bae7_e68f_dd4660e1fb75
  d36be764_b123_7ad5_b83a_11a3cab40406["testPromiseListenerAddWhenCompleteFailure()"]
  d36be764_b123_7ad5_b83a_11a3cab40406 -->|calls| e760fb78_c892_f94d_ba1f_2d7203f2f5d3
  0d1f3df9_9966_4141_27e3_5dcd4f275b39["testPromiseListenerAddWhenCompleteSuccess()"]
  0d1f3df9_9966_4141_27e3_5dcd4f275b39 -->|calls| e760fb78_c892_f94d_ba1f_2d7203f2f5d3
  style e760fb78_c892_f94d_ba1f_2d7203f2f5d3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

common/src/test/java/io/netty/util/concurrent/DefaultPromiseTest.java lines 542–553

    private static void testPromiseListenerAddWhenComplete(Throwable cause) throws InterruptedException {
        final CountDownLatch latch = new CountDownLatch(1);
        final Promise<Void> promise = new DefaultPromise<Void>(ImmediateEventExecutor.INSTANCE);
        promise.addListener((FutureListener<Void>) future ->
                promise.addListener((FutureListener<Void>) f -> latch.countDown()));
        if (cause == null) {
            promise.setSuccess(null);
        } else {
            promise.setFailure(cause);
        }
        latch.await();
    }

Domain

Subdomains

Frequently Asked Questions

What does testPromiseListenerAddWhenComplete() do?
testPromiseListenerAddWhenComplete() is a function in the netty codebase, defined in common/src/test/java/io/netty/util/concurrent/DefaultPromiseTest.java.
Where is testPromiseListenerAddWhenComplete() defined?
testPromiseListenerAddWhenComplete() is defined in common/src/test/java/io/netty/util/concurrent/DefaultPromiseTest.java at line 542.
What calls testPromiseListenerAddWhenComplete()?
testPromiseListenerAddWhenComplete() is called by 2 function(s): testPromiseListenerAddWhenCompleteFailure, testPromiseListenerAddWhenCompleteSuccess.

Analyze Your Own Codebase

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

Try Supermodel Free