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.143 by jsr166, Sun Apr 3 17:09:46 2016 UTC vs.
Revision 1.145 by jsr166, Mon Apr 11 06:23:38 2016 UTC

# Line 640 | Line 640 | public class CompletableFutureTest exten
640  
641          ASYNC {
642              public void checkExecutionMode() {
643 <                // If tests are added that may run across different
644 <                // pools, this needs to be weakened to no-op.
645 <                ForkJoinPool p = ForkJoinTask.getPool();
646 <                assertTrue(p == null ||
647 <                           (defaultExecutorIsCommonPool &&
648 <                            p == ForkJoinPool.commonPool()));
643 >                assertEquals(defaultExecutorIsCommonPool,
644 >                             (ForkJoinPool.commonPool() == ForkJoinTask.getPool()));
645              }
646              public CompletableFuture<Void> runAsync(Runnable a) {
647                  return CompletableFuture.runAsync(a);
# Line 3529 | Line 3525 | public class CompletableFutureTest exten
3525          long timeoutMillis = timeoutMillis();
3526          CompletableFuture<Integer> f = new CompletableFuture<>();
3527          long startTime = System.nanoTime();
3528 <        f.orTimeout(timeoutMillis, MILLISECONDS);
3528 >        assertSame(f, f.orTimeout(timeoutMillis, MILLISECONDS));
3529          checkCompletedWithTimeoutException(f);
3530          assertTrue(millisElapsedSince(startTime) >= timeoutMillis);
3531      }
# Line 3544 | Line 3540 | public class CompletableFutureTest exten
3540          CompletableFuture<Integer> g = new CompletableFuture<>();
3541          long startTime = System.nanoTime();
3542          f.complete(v1);
3543 <        f.orTimeout(LONG_DELAY_MS, MILLISECONDS);
3544 <        g.orTimeout(LONG_DELAY_MS, MILLISECONDS);
3543 >        assertSame(f, f.orTimeout(LONG_DELAY_MS, MILLISECONDS));
3544 >        assertSame(g, g.orTimeout(LONG_DELAY_MS, MILLISECONDS));
3545          g.complete(v1);
3546          checkCompletedNormally(f, v1);
3547          checkCompletedNormally(g, v1);
# Line 3564 | Line 3560 | public class CompletableFutureTest exten
3560          long timeoutMillis = timeoutMillis();
3561          CompletableFuture<Integer> f = new CompletableFuture<>();
3562          long startTime = System.nanoTime();
3563 <        f.completeOnTimeout(v, timeoutMillis, MILLISECONDS);
3563 >        assertSame(f, f.completeOnTimeout(v, timeoutMillis, MILLISECONDS));
3564          assertSame(v, f.join());
3565          assertTrue(millisElapsedSince(startTime) >= timeoutMillis);
3566          f.complete(99);         // should have no effect
# Line 3581 | Line 3577 | public class CompletableFutureTest exten
3577          CompletableFuture<Integer> g = new CompletableFuture<>();
3578          long startTime = System.nanoTime();
3579          f.complete(v1);
3580 <        f.completeOnTimeout(-1, LONG_DELAY_MS, MILLISECONDS);
3581 <        g.completeOnTimeout(-1, LONG_DELAY_MS, MILLISECONDS);
3580 >        assertSame(f, f.completeOnTimeout(-1, LONG_DELAY_MS, MILLISECONDS));
3581 >        assertSame(g, g.completeOnTimeout(-1, LONG_DELAY_MS, MILLISECONDS));
3582          g.complete(v1);
3583          checkCompletedNormally(f, v1);
3584          checkCompletedNormally(g, v1);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines