1 |
|
/* |
2 |
|
* Written by Doug Lea with assistance from members of JCP JSR-166 |
3 |
|
* Expert Group and released to the public domain, as explained at |
4 |
< |
* http://creativecommons.org/licenses/publicdomain |
4 |
> |
* http://creativecommons.org/publicdomain/zero/1.0/ |
5 |
|
* Other contributors include Andrew Wright, Jeffrey Hayes, |
6 |
|
* Pat Fisher, Mike Judd. |
7 |
|
*/ |
191 |
|
Future f = p.schedule(Executors.callable(task, Boolean.TRUE), |
192 |
|
SHORT_DELAY_MS, MILLISECONDS); |
193 |
|
assertFalse(f.isDone()); |
194 |
< |
assertTrue(done.await(SMALL_DELAY_MS, MILLISECONDS)); |
194 |
> |
assertTrue(done.await(MEDIUM_DELAY_MS, MILLISECONDS)); |
195 |
> |
assertSame(Boolean.TRUE, f.get(SMALL_DELAY_MS, MILLISECONDS)); |
196 |
> |
assertSame(Boolean.TRUE, f.get()); |
197 |
|
assertTrue(f.isDone()); |
196 |
– |
assertEquals(Boolean.TRUE, f.get()); |
198 |
|
} finally { |
199 |
|
joinPool(p); |
200 |
|
} |
214 |
|
Future f = p.schedule(Executors.callable(task, Boolean.TRUE), |
215 |
|
SHORT_DELAY_MS, MILLISECONDS); |
216 |
|
assertFalse(f.isDone()); |
217 |
< |
assertTrue(done.await(SMALL_DELAY_MS, MILLISECONDS)); |
217 |
> |
assertTrue(done.await(MEDIUM_DELAY_MS, MILLISECONDS)); |
218 |
> |
assertSame(Boolean.TRUE, f.get(SMALL_DELAY_MS, MILLISECONDS)); |
219 |
> |
assertSame(Boolean.TRUE, f.get()); |
220 |
|
assertTrue(f.isDone()); |
218 |
– |
assertEquals(Boolean.TRUE, f.get()); |
221 |
|
} finally { |
222 |
|
joinPool(p); |
223 |
|
} |
239 |
|
Future f = p.schedule(Executors.callable(task, Boolean.TRUE), |
240 |
|
SHORT_DELAY_MS, MILLISECONDS); |
241 |
|
assertFalse(f.isDone()); |
242 |
< |
assertTrue(done.await(SMALL_DELAY_MS, MILLISECONDS)); |
242 |
> |
assertTrue(done.await(MEDIUM_DELAY_MS, MILLISECONDS)); |
243 |
> |
assertSame(Boolean.TRUE, f.get(SMALL_DELAY_MS, MILLISECONDS)); |
244 |
> |
assertSame(Boolean.TRUE, f.get()); |
245 |
|
assertTrue(f.isDone()); |
242 |
– |
assertEquals(Boolean.TRUE, f.get()); |
246 |
|
} finally { |
247 |
|
joinPool(p); |
248 |
|
} |