144 |
|
// an execution per SHORT delay, but no more than one SHORT more |
145 |
|
assertTrue(c >= SMALL_DELAY_MS / SHORT_DELAY_MS); |
146 |
|
assertTrue(c <= SMALL_DELAY_MS + SHORT_DELAY_MS); |
147 |
– |
assertTrue(h.isDone()); |
147 |
|
joinPool(p1); |
148 |
|
} catch(Exception e){ |
149 |
|
unexpectedException(); |
164 |
|
int c = counter.count.get(); |
165 |
|
assertTrue(c >= SMALL_DELAY_MS / SHORT_DELAY_MS); |
166 |
|
assertTrue(c <= SMALL_DELAY_MS + SHORT_DELAY_MS); |
168 |
– |
assertTrue(h.isDone()); |
167 |
|
joinPool(p1); |
168 |
|
} catch(Exception e){ |
169 |
|
unexpectedException(); |
495 |
|
ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1); |
496 |
|
ScheduledFuture[] tasks = new ScheduledFuture[5]; |
497 |
|
for(int i = 0; i < 5; i++){ |
498 |
< |
tasks[i] = p1.schedule(new SmallPossiblyInterruptedRunnable(), SHORT_DELAY_MS, TimeUnit.MILLISECONDS); |
498 |
> |
tasks[i] = p1.schedule(new SmallPossiblyInterruptedRunnable(), 1, TimeUnit.MILLISECONDS); |
499 |
|
} |
500 |
|
try { |
501 |
|
Thread.sleep(SHORT_DELAY_MS); |