274 |
|
} |
275 |
|
|
276 |
|
/** |
277 |
+ |
* The default rejected execution handler is AbortPolicy. |
278 |
+ |
*/ |
279 |
+ |
public void testDefaultRejectedExecutionHandler() { |
280 |
+ |
final ThreadPoolExecutor p = |
281 |
+ |
new ThreadPoolExecutor(1, 2, |
282 |
+ |
LONG_DELAY_MS, MILLISECONDS, |
283 |
+ |
new ArrayBlockingQueue<Runnable>(10)); |
284 |
+ |
try (PoolCleaner cleaner = cleaner(p)) { |
285 |
+ |
assertTrue(p.getRejectedExecutionHandler() |
286 |
+ |
instanceof ThreadPoolExecutor.AbortPolicy); |
287 |
+ |
} |
288 |
+ |
} |
289 |
+ |
|
290 |
+ |
/** |
291 |
|
* getRejectedExecutionHandler returns handler in constructor if not set |
292 |
|
*/ |
293 |
|
public void testGetRejectedExecutionHandler() { |