28 |
|
return new TestSuite(CompletableFutureTest.class); |
29 |
|
} |
30 |
|
|
31 |
+ |
// XXXX Just a skeleton implementation for now. |
32 |
+ |
public void testTODO() { |
33 |
+ |
fail("Please add some real tests!"); |
34 |
+ |
} |
35 |
+ |
|
36 |
|
public void testToString() { |
37 |
|
CompletableFuture<String> f; |
38 |
< |
assertTrue(new CompletableFuture<String>().toString() |
34 |
< |
.contains("[Not completed]")); |
38 |
> |
|
39 |
|
f = new CompletableFuture<String>(); |
40 |
+ |
assertTrue(f.toString().contains("[Not completed]")); |
41 |
+ |
|
42 |
|
f.complete("foo"); |
43 |
|
assertTrue(f.toString().contains("[Completed normally]")); |
44 |
+ |
|
45 |
|
f = new CompletableFuture<String>(); |
46 |
|
f.completeExceptionally(new IndexOutOfBoundsException()); |
47 |
|
assertTrue(f.toString().contains("[Completed exceptionally]")); |