131 |
|
} catch (ExecutionException success) { |
132 |
|
assertSame(ex, success.getCause()); |
133 |
|
} catch (Throwable fail) { threadUnexpectedException(fail); } |
134 |
< |
|
134 |
> |
|
135 |
|
assertTrue(f.isDone()); |
136 |
|
assertFalse(f.isCancelled()); |
137 |
|
assertTrue(f.toString().contains("[Completed exceptionally]")); |
345 |
|
f = new CompletableFuture<String>(); |
346 |
|
f.completeExceptionally(new IndexOutOfBoundsException()); |
347 |
|
assertTrue(f.toString().contains("[Completed exceptionally]")); |
348 |
+ |
|
349 |
+ |
f = new CompletableFuture<String>(); |
350 |
+ |
f.cancel(true); |
351 |
+ |
assertTrue(f.toString().contains("[Completed exceptionally]")); |
352 |
+ |
|
353 |
+ |
f = new CompletableFuture<String>(); |
354 |
+ |
f.cancel(false); |
355 |
+ |
assertTrue(f.toString().contains("[Completed exceptionally]")); |
356 |
|
} |
357 |
|
|
358 |
|
/** |