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.160 by jsr166, Mon Jun 27 21:41:17 2016 UTC vs.
Revision 1.162 by jsr166, Sun Jul 3 15:27:28 2016 UTC

# Line 2700 | Line 2700 | public class CompletableFutureTest exten
2700          for (ExecutionMode m : ExecutionMode.values())
2701          for (Integer v1 : new Integer[] { 1, null })
2702          for (Integer v2 : new Integer[] { 2, null })
2703 +        for (boolean pushNop : new boolean[] { true, false })
2704      {
2705          final CompletableFuture<Integer> f = new CompletableFuture<>();
2706          final CompletableFuture<Integer> g = new CompletableFuture<>();
# Line 2712 | Line 2713 | public class CompletableFutureTest exten
2713          checkIncomplete(h1);
2714          rs[0].assertNotInvoked();
2715          rs[1].assertNotInvoked();
2716 +        if (pushNop) {          // ad hoc test of intra-completion interference
2717 +            m.thenRun(f, () -> {});
2718 +            m.thenRun(g, () -> {});
2719 +        }
2720          f.complete(v1);
2721          checkCompletedNormally(h0, null);
2722          checkCompletedNormally(h1, null);
# Line 3354 | Line 3359 | public class CompletableFutureTest exten
3359       * Test submissions to an executor that rejects all tasks.
3360       */
3361      public void testRejectingExecutor() {
3362 <        for (Integer v : new Integer[] { 1, null }) {
3363 <
3362 >        for (Integer v : new Integer[] { 1, null })
3363 >    {
3364          final CountingRejectingExecutor e = new CountingRejectingExecutor();
3365  
3366          final CompletableFuture<Integer> complete = CompletableFuture.completedFuture(v);
# Line 3434 | Line 3439 | public class CompletableFutureTest exten
3439              checkCompletedWithWrappedException(future, e.ex);
3440  
3441          assertEquals(futures.size(), e.count.get());
3442 <
3438 <        }
3439 <    }
3442 >    }}
3443  
3444      /**
3445       * Test submissions to an executor that rejects all tasks, but
# Line 3444 | Line 3447 | public class CompletableFutureTest exten
3447       * explicitly completed.
3448       */
3449      public void testRejectingExecutorNeverInvoked() {
3450 +        for (Integer v : new Integer[] { 1, null })
3451 +    {
3452          final CountingRejectingExecutor e = new CountingRejectingExecutor();
3453  
3449        for (Integer v : new Integer[] { 1, null }) {
3450
3454          final CompletableFuture<Integer> complete = CompletableFuture.completedFuture(v);
3455          final CompletableFuture<Integer> incomplete = new CompletableFuture<>();
3456  
# Line 3495 | Line 3498 | public class CompletableFutureTest exten
3498              checkCompletedNormally(future, null);
3499  
3500          assertEquals(0, e.count.get());
3501 <
3499 <        }
3500 <    }
3501 >    }}
3502  
3503      /**
3504       * toCompletableFuture returns this CompletableFuture.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines