827 |
|
await(poolBlocked); |
828 |
|
|
829 |
|
assertEquals(poolSize, ran.get()); |
830 |
+ |
assertEquals(poolSize, p.getActiveCount()); |
831 |
|
assertTrue(q.isEmpty()); |
832 |
|
|
833 |
|
// Add second wave of tasks. |
879 |
|
else |
880 |
|
assertTrue(delayeds.get(1).isCancelled()); |
881 |
|
|
882 |
< |
if (testImplementationDetails) { |
883 |
< |
if (effectivePeriodicPolicy) |
884 |
< |
periodics.forEach( |
885 |
< |
f -> { |
886 |
< |
assertFalse(f.isDone()); |
887 |
< |
if (!periodicTasksContinue) |
888 |
< |
assertTrue(f.cancel(false)); |
889 |
< |
}); |
890 |
< |
else { |
891 |
< |
periodics.subList(0, 4).forEach(f -> assertFalse(f.isDone())); |
892 |
< |
periodics.subList(4, 8).forEach(f -> assertTrue(f.isCancelled())); |
893 |
< |
} |
882 |
> |
if (effectivePeriodicPolicy) |
883 |
> |
periodics.forEach( |
884 |
> |
f -> { |
885 |
> |
assertFalse(f.isDone()); |
886 |
> |
if (!periodicTasksContinue) { |
887 |
> |
assertTrue(f.cancel(false)); |
888 |
> |
assertTrue(f.isCancelled()); |
889 |
> |
} |
890 |
> |
}); |
891 |
> |
else { |
892 |
> |
periodics.subList(0, 4).forEach(f -> assertFalse(f.isDone())); |
893 |
> |
periodics.subList(4, 8).forEach(f -> assertTrue(f.isCancelled())); |
894 |
|
} |
895 |
|
|
896 |
|
unblock.countDown(); // Release all pool threads |