259 |
|
assertEquals(g.getNumberOfDependents(), 0); |
260 |
|
} |
261 |
|
|
262 |
– |
|
262 |
|
/** |
263 |
|
* toString indicates current completion state |
264 |
|
*/ |
373 |
|
} |
374 |
|
} |
375 |
|
|
377 |
– |
|
376 |
|
/** |
377 |
|
* exceptionally action completes with function value on source |
378 |
< |
* exception; otherwise with source value |
378 |
> |
* exception; otherwise with source value |
379 |
|
*/ |
380 |
|
public void testExceptionally() { |
381 |
|
CompletableFuture<Integer> f = new CompletableFuture<>(); |
661 |
|
checkCompletedWithWrappedCancellationException(g); |
662 |
|
} |
663 |
|
|
666 |
– |
|
664 |
|
/** |
665 |
|
* thenCombine result completes normally after normal completion |
666 |
|
* of sources |
1168 |
|
checkCompletedWithWrappedCancellationException(g); |
1169 |
|
} |
1170 |
|
|
1174 |
– |
|
1171 |
|
/** |
1172 |
|
* runAfterEither result completes normally after normal completion |
1173 |
|
* of either source |
1316 |
|
checkCompletedWithWrappedCancellationException(g); |
1317 |
|
} |
1318 |
|
|
1323 |
– |
|
1319 |
|
// asyncs |
1320 |
|
|
1321 |
|
/** |
1348 |
|
try { |
1349 |
|
g.join(); |
1350 |
|
shouldThrow(); |
1351 |
< |
} catch (Exception ok) { |
1357 |
< |
} |
1351 |
> |
} catch (CompletionException success) {} |
1352 |
|
checkCompletedWithWrappedCFException(g); |
1353 |
|
} |
1354 |
|
|
2082 |
|
checkCompletedWithWrappedCancellationException(g); |
2083 |
|
} |
2084 |
|
|
2091 |
– |
|
2085 |
|
// async with explicit executors |
2086 |
|
|
2087 |
|
/** |
2114 |
|
try { |
2115 |
|
g.join(); |
2116 |
|
shouldThrow(); |
2117 |
< |
} catch (Exception ok) { |
2125 |
< |
} |
2117 |
> |
} catch (CompletionException success) {} |
2118 |
|
checkCompletedWithWrappedCFException(g); |
2119 |
|
} |
2120 |
|
|
3173 |
|
checkCompletedWithWrappedCFException(g); |
3174 |
|
} |
3175 |
|
|
3184 |
– |
|
3176 |
|
/** |
3177 |
< |
* handleAsync action action completes normally with function |
3178 |
< |
* value on either normal or exceptional completion of source |
3177 |
> |
* handleAsync action completes normally with function value on |
3178 |
> |
* either normal or exceptional completion of source |
3179 |
|
*/ |
3180 |
|
public void testHandleAsync() { |
3181 |
|
CompletableFuture<Integer> f, g; |