9 |
|
import junit.framework.*; |
10 |
|
import java.util.*; |
11 |
|
import java.util.concurrent.*; |
12 |
+ |
import static java.util.concurrent.TimeUnit.MILLISECONDS; |
13 |
|
import java.io.*; |
14 |
|
import java.security.*; |
15 |
|
|
321 |
|
public void joinPool(ExecutorService exec) { |
322 |
|
try { |
323 |
|
exec.shutdown(); |
324 |
< |
assertTrue(exec.awaitTermination(LONG_DELAY_MS, TimeUnit.MILLISECONDS)); |
324 |
> |
assertTrue(exec.awaitTermination(LONG_DELAY_MS, MILLISECONDS)); |
325 |
|
} catch (SecurityException ok) { |
326 |
|
// Allowed in case test doesn't have privs |
327 |
|
} catch (InterruptedException ie) { |
344 |
|
fail("Unexpected exception"); |
345 |
|
} |
346 |
|
|
347 |
+ |
/** |
348 |
+ |
* fail with message "Unexpected exception", with argument |
349 |
+ |
*/ |
350 |
+ |
public void unexpectedException(Throwable ex) { |
351 |
+ |
ex.printStackTrace(); |
352 |
+ |
fail("Unexpected exception: " + ex); |
353 |
+ |
} |
354 |
+ |
|
355 |
|
|
356 |
|
/** |
357 |
|
* The number of elements to place in collections, arrays, etc. |