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.8 by jsr166, Fri Mar 22 22:27:04 2013 UTC vs.
Revision 1.9 by dl, Wed Mar 27 19:45:42 2013 UTC

# Line 271 | Line 271 | public class CompletableFutureTest exten
271          assertTrue(f.toString().contains("[Completed exceptionally]"));
272      }
273  
274 +    /**
275 +     * completedFuture returns a completed CompletableFuture with give value
276 +     */
277 +    public void testCompletedFuture() {
278 +        CompletableFuture<String> f = CompletableFuture.completedFuture("test");
279 +        checkCompletedNormally(f, "test");
280 +    }
281 +
282      static final Supplier<Integer> supplyOne =
283          () -> Integer.valueOf(1);
284      static final Function<Integer, Integer> inc =
# Line 2344 | Line 2352 | public class CompletableFutureTest exten
2352              CompletableFuture[] fs = new CompletableFuture[k];
2353              for (int i = 0; i < k; ++i)
2354                  fs[i] = new CompletableFuture<Integer>();
2355 <            CompletableFuture<?> f = CompletableFuture.allOf(fs);
2355 >            CompletableFuture<Void> f = CompletableFuture.allOf(fs);
2356              for (int i = 0; i < k; ++i) {
2357                  checkIncomplete(f);
2358                  fs[i].complete(one);
2359              }
2360 <            assertTrue(f.isDone());
2353 <            assertFalse(f.isCancelled());
2360 >            checkCompletedNormally(f, null);
2361          }
2362      }
2363  
# Line 2370 | Line 2377 | public class CompletableFutureTest exten
2377              CompletableFuture[] fs = new CompletableFuture[k];
2378              for (int i = 0; i < k; ++i)
2379                  fs[i] = new CompletableFuture<Integer>();
2380 <            CompletableFuture<?> f = CompletableFuture.anyOf(fs);
2380 >            CompletableFuture<Object> f = CompletableFuture.anyOf(fs);
2381              checkIncomplete(f);
2382              for (int i = 0; i < k; ++i) {
2383                  fs[i].complete(one);
2384 <                assertTrue(f.isDone());
2384 >                checkCompletedNormally(f, one);
2385              }
2386          }
2387      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines