11 |
|
|
12 |
|
public class ThreadTest extends JSR166TestCase { |
13 |
|
public static void main(String[] args) { |
14 |
< |
junit.textui.TestRunner.run(suite()); |
14 |
> |
main(suite(), args); |
15 |
|
} |
16 |
|
|
17 |
|
public static Test suite() { |
48 |
|
* getDefaultUncaughtExceptionHandler returns value of last |
49 |
|
* setDefaultUncaughtExceptionHandler. |
50 |
|
*/ |
51 |
+ |
@SuppressWarnings("removal") |
52 |
|
public void testGetAndSetDefaultUncaughtExceptionHandler() { |
53 |
< |
assertEquals(null, Thread.getDefaultUncaughtExceptionHandler()); |
54 |
< |
// failure due to securityException is OK. |
53 |
> |
assertNull(Thread.getDefaultUncaughtExceptionHandler()); |
54 |
> |
// failure due to SecurityException is OK. |
55 |
|
// Would be nice to explicitly test both ways, but cannot yet. |
56 |
|
Thread.UncaughtExceptionHandler defaultHandler |
57 |
|
= Thread.getDefaultUncaughtExceptionHandler(); |
57 |
– |
Thread current = Thread.currentThread(); |
58 |
|
MyHandler eh = new MyHandler(); |
59 |
|
try { |
60 |
|
Thread.setDefaultUncaughtExceptionHandler(eh); |