3354 |
|
* Test submissions to an executor that rejects all tasks. |
3355 |
|
*/ |
3356 |
|
public void testRejectingExecutor() { |
3357 |
< |
for (Integer v : new Integer[] { 1, null }) { |
3358 |
< |
|
3357 |
> |
for (Integer v : new Integer[] { 1, null }) |
3358 |
> |
{ |
3359 |
|
final CountingRejectingExecutor e = new CountingRejectingExecutor(); |
3360 |
|
|
3361 |
|
final CompletableFuture<Integer> complete = CompletableFuture.completedFuture(v); |
3434 |
|
checkCompletedWithWrappedException(future, e.ex); |
3435 |
|
|
3436 |
|
assertEquals(futures.size(), e.count.get()); |
3437 |
< |
|
3438 |
< |
} |
3439 |
< |
} |
3437 |
> |
}} |
3438 |
|
|
3439 |
|
/** |
3440 |
|
* Test submissions to an executor that rejects all tasks, but |
3442 |
|
* explicitly completed. |
3443 |
|
*/ |
3444 |
|
public void testRejectingExecutorNeverInvoked() { |
3445 |
+ |
for (Integer v : new Integer[] { 1, null }) |
3446 |
+ |
{ |
3447 |
|
final CountingRejectingExecutor e = new CountingRejectingExecutor(); |
3448 |
|
|
3449 |
– |
for (Integer v : new Integer[] { 1, null }) { |
3450 |
– |
|
3449 |
|
final CompletableFuture<Integer> complete = CompletableFuture.completedFuture(v); |
3450 |
|
final CompletableFuture<Integer> incomplete = new CompletableFuture<>(); |
3451 |
|
|
3493 |
|
checkCompletedNormally(future, null); |
3494 |
|
|
3495 |
|
assertEquals(0, e.count.get()); |
3496 |
< |
|
3499 |
< |
} |
3500 |
< |
} |
3496 |
> |
}} |
3497 |
|
|
3498 |
|
/** |
3499 |
|
* toCompletableFuture returns this CompletableFuture. |