| 9 |
import junit.framework.*; |
import junit.framework.*; |
| 10 |
import java.util.*; |
import java.util.*; |
| 11 |
import java.util.concurrent.*; |
import java.util.concurrent.*; |
| 12 |
|
import static java.util.concurrent.TimeUnit.MILLISECONDS; |
| 13 |
import java.io.*; |
import java.io.*; |
| 14 |
import java.security.*; |
import java.security.*; |
| 15 |
|
|
| 321 |
public void joinPool(ExecutorService exec) { |
public void joinPool(ExecutorService exec) { |
| 322 |
try { |
try { |
| 323 |
exec.shutdown(); |
exec.shutdown(); |
| 324 |
assertTrue(exec.awaitTermination(LONG_DELAY_MS, TimeUnit.MILLISECONDS)); |
assertTrue(exec.awaitTermination(LONG_DELAY_MS, MILLISECONDS)); |
| 325 |
} catch (SecurityException ok) { |
} catch (SecurityException ok) { |
| 326 |
// Allowed in case test doesn't have privs |
// Allowed in case test doesn't have privs |
| 327 |
} catch (InterruptedException ie) { |
} catch (InterruptedException ie) { |
| 344 |
fail("Unexpected exception"); |
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. |
* The number of elements to place in collections, arrays, etc. |