154 |
|
assertEquals(0, p.getCompletedTaskCount()); |
155 |
|
threadProceed.countDown(); |
156 |
|
threadDone.await(); |
157 |
< |
Thread.sleep(SHORT_DELAY_MS); |
157 |
> |
delay(SHORT_DELAY_MS); |
158 |
|
assertEquals(1, p.getCompletedTaskCount()); |
159 |
|
} finally { |
160 |
|
joinPool(p); |
1345 |
|
try { |
1346 |
|
TrackedNoOpRunnable r = new TrackedNoOpRunnable(); |
1347 |
|
p.execute(r); |
1348 |
< |
Thread.sleep(SHORT_DELAY_MS); |
1348 |
> |
delay(SHORT_DELAY_MS); |
1349 |
|
assertTrue(r.done); |
1350 |
|
assertTrue(p.beforeCalled); |
1351 |
|
assertTrue(p.afterCalled); |
1919 |
|
for (int i = 0; i < (MEDIUM_DELAY_MS/10); i++) { |
1920 |
|
if (p.getPoolSize() == 0) |
1921 |
|
break; |
1922 |
< |
Thread.sleep(10); |
1922 |
> |
delay(10); |
1923 |
|
} |
1924 |
|
assertEquals(0, p.getPoolSize()); |
1925 |
|
} finally { |
1943 |
|
threadStarted.countDown(); |
1944 |
|
assertTrue(p.getPoolSize() >= 1); |
1945 |
|
}}); |
1946 |
< |
Thread.sleep(SMALL_DELAY_MS); |
1946 |
> |
delay(SMALL_DELAY_MS); |
1947 |
|
assertTrue(p.getPoolSize() >= 1); |
1948 |
|
} finally { |
1949 |
|
joinPool(p); |