ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/CompletableFutureTest.java
(Generate patch)

Comparing jsr166/src/test/tck/CompletableFutureTest.java (file contents):
Revision 1.103 by dl, Thu Sep 3 11:45:34 2015 UTC vs.
Revision 1.110 by dl, Fri Sep 4 10:56:14 2015 UTC

# Line 3333 | Line 3333 | public class CompletableFutureTest exten
3333              () -> f.exceptionally(null),
3334  
3335              () -> f.handle(null),
3336 +
3337              () -> CompletableFuture.allOf((CompletableFuture<?>)null),
3338              () -> CompletableFuture.allOf((CompletableFuture<?>[])null),
3339              () -> CompletableFuture.allOf(f, null),
# Line 3359 | Line 3360 | public class CompletableFutureTest exten
3360      }
3361  
3362      // jdk9
3363 <    
3363 >
3364      /**
3365       * newIncompleteFuture returns an incomplete CompletableFuture
3366       */
# Line 3384 | Line 3385 | public class CompletableFutureTest exten
3385  
3386      /**
3387       * defaultExecutor by default returns the commonPool if
3388 <     * it supports at least one thread.
3388 >     * it supports more than one thread.
3389       */
3390      public void testDefaultExecutor() {
3391          CompletableFuture<Integer> f = new CompletableFuture<>();
3392          Executor e = f.defaultExecutor();
3393 <        Executor c =  ForkJoinPool.commonPool();
3394 <        if (ForkJoinPool.getCommonPoolParallelism() > 0)
3393 >        Executor c = ForkJoinPool.commonPool();
3394 >        if (ForkJoinPool.getCommonPoolParallelism() > 1)
3395              assertSame(e, c);
3396      }
3397  
# Line 3410 | Line 3411 | public class CompletableFutureTest exten
3411      public void testFailedFuture2() {
3412          try {
3413              CompletableFuture<Integer> f = CompletableFuture.failedFuture(null);
3414 <        } catch(NullPointerException success) {
3415 <        }
3414 >            shouldThrow();
3415 >        } catch (NullPointerException success) {}
3416      }
3417  
3418      /**
# Line 3479 | Line 3480 | public class CompletableFutureTest exten
3480      }
3481  
3482      /**
3483 <     * failedStage returns a Completionstage completed
3483 >     * failedStage returns a CompletionStage completed
3484       * exceptionally with the given Exception
3485       */
3486      public void testFailedStage() {
# Line 3512 | Line 3513 | public class CompletableFutureTest exten
3513          try {
3514              f.join();
3515              shouldThrow();
3516 <        } catch(Exception success) {
3516 <        }
3516 >        } catch (Exception success) {}
3517          checkCompletedWithWrappedCFException(f);
3518      }
3519  
# Line 3538 | Line 3538 | public class CompletableFutureTest exten
3538          try {
3539              f.join();
3540              shouldThrow();
3541 <        } catch(Exception success) {
3542 <        }
3541 >        } catch (Exception success) {}
3542          checkCompletedWithWrappedCFException(f);
3543      }
3544  
3545      /**
3546 <     *  orTimeout completes with TimeoutException if not complete
3546 >     * orTimeout completes with TimeoutException if not complete
3547       */
3548      public void testOrTimeout() {
3549          CompletableFuture<Integer> f = new CompletableFuture<>();
# Line 3553 | Line 3552 | public class CompletableFutureTest exten
3552      }
3553  
3554      /**
3555 <     *  orTimeout completes normally if completed before timeout
3555 >     * orTimeout completes normally if completed before timeout
3556       */
3557      public void testOrTimeout2() {
3558          CompletableFuture<Integer> f = new CompletableFuture<>();
# Line 3563 | Line 3562 | public class CompletableFutureTest exten
3562      }
3563  
3564      /**
3565 <     *  completeOnTimeout completes with given value if not complete
3565 >     * completeOnTimeout completes with given value if not complete
3566       */
3567      public void testCompleteOnTimeout() {
3568          CompletableFuture<Integer> f = new CompletableFuture<>();
# Line 3573 | Line 3572 | public class CompletableFutureTest exten
3572      }
3573  
3574      /**
3575 <     *  completeOnTimeout has no effect if completed within timeout
3575 >     * completeOnTimeout has no effect if completed within timeout
3576       */
3577      public void testCompleteOnTimeout2() {
3578          CompletableFuture<Integer> f = new CompletableFuture<>();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines