262 |
|
assertEquals(1, p.getActiveCount()); |
263 |
|
done.await(); |
264 |
|
}}); |
265 |
< |
assertTrue(threadStarted.await(MEDIUM_DELAY_MS, MILLISECONDS)); |
265 |
> |
assertTrue(threadStarted.await(LONG_DELAY_MS, MILLISECONDS)); |
266 |
|
assertEquals(1, p.getActiveCount()); |
267 |
|
done.countDown(); |
268 |
|
} |
491 |
|
done.await(); |
492 |
|
assertEquals(THREADS, p.getLargestPoolSize()); |
493 |
|
}}); |
494 |
< |
assertTrue(threadsStarted.await(MEDIUM_DELAY_MS, MILLISECONDS)); |
494 |
> |
assertTrue(threadsStarted.await(LONG_DELAY_MS, MILLISECONDS)); |
495 |
|
assertEquals(THREADS, p.getLargestPoolSize()); |
496 |
|
done.countDown(); // release pool |
497 |
|
} |
535 |
|
assertEquals(1, p.getPoolSize()); |
536 |
|
done.await(); |
537 |
|
}}); |
538 |
< |
assertTrue(threadStarted.await(MEDIUM_DELAY_MS, MILLISECONDS)); |
538 |
> |
assertTrue(threadStarted.await(LONG_DELAY_MS, MILLISECONDS)); |
539 |
|
assertEquals(1, p.getPoolSize()); |
540 |
|
done.countDown(); // release pool |
541 |
|
} |
612 |
|
threadStarted.countDown(); |
613 |
|
done.await(); |
614 |
|
}}); |
615 |
< |
assertTrue(threadStarted.await(MEDIUM_DELAY_MS, MILLISECONDS)); |
615 |
> |
assertTrue(threadStarted.await(LONG_DELAY_MS, MILLISECONDS)); |
616 |
|
assertFalse(p.isTerminating()); |
617 |
|
done.countDown(); |
618 |
|
try { p.shutdown(); } catch (SecurityException ok) { return; } |
640 |
|
threadStarted.countDown(); |
641 |
|
done.await(); |
642 |
|
}}); |
643 |
< |
assertTrue(threadStarted.await(MEDIUM_DELAY_MS, MILLISECONDS)); |
643 |
> |
assertTrue(threadStarted.await(LONG_DELAY_MS, MILLISECONDS)); |
644 |
|
assertFalse(p.isTerminating()); |
645 |
|
done.countDown(); |
646 |
|
try { p.shutdown(); } catch (SecurityException ok) { return; } |
674 |
|
tasks[i] = new FutureTask(task); |
675 |
|
p.execute(tasks[i]); |
676 |
|
} |
677 |
< |
assertTrue(threadStarted.await(MEDIUM_DELAY_MS, MILLISECONDS)); |
677 |
> |
assertTrue(threadStarted.await(LONG_DELAY_MS, MILLISECONDS)); |
678 |
|
assertSame(q, p.getQueue()); |
679 |
|
assertFalse(q.contains(tasks[0])); |
680 |
|
assertTrue(q.contains(tasks[tasks.length - 1])); |
704 |
|
}}; |
705 |
|
p.execute(tasks[i]); |
706 |
|
} |
707 |
< |
assertTrue(threadStarted.await(MEDIUM_DELAY_MS, MILLISECONDS)); |
707 |
> |
assertTrue(threadStarted.await(LONG_DELAY_MS, MILLISECONDS)); |
708 |
|
assertFalse(p.remove(tasks[0])); |
709 |
|
assertTrue(q.contains(tasks[4])); |
710 |
|
assertTrue(q.contains(tasks[3])); |