10 |
|
import java.util.concurrent.*; |
11 |
|
import java.util.concurrent.locks.*; |
12 |
|
|
13 |
< |
public class LockSupportTest extends TestCase{ |
14 |
< |
|
13 |
> |
public class LockSupportTest extends JSR166TestCase{ |
14 |
|
public static void main(String[] args) { |
15 |
|
junit.textui.TestRunner.run (suite()); |
16 |
|
} |
18 |
– |
|
19 |
– |
|
17 |
|
public static Test suite() { |
18 |
|
return new TestSuite(LockSupportTest.class); |
19 |
|
} |
24 |
|
try{ |
25 |
|
LockSupport.park(); |
26 |
|
}catch(Exception e){ |
27 |
< |
fail("unexpected exception"); |
27 |
> |
threadFail("unexpected exception"); |
28 |
|
} |
29 |
|
} |
30 |
|
}); |
44 |
|
try{ |
45 |
|
LockSupport.parkNanos(1000); |
46 |
|
}catch(Exception e){ |
47 |
< |
fail("unexpected exception"); |
47 |
> |
threadFail("unexpected exception"); |
48 |
|
} |
49 |
|
} |
50 |
|
}); |
65 |
|
long d = new Date().getTime() + 100; |
66 |
|
LockSupport.parkUntil(d); |
67 |
|
}catch(Exception e){ |
68 |
< |
fail("unexpected exception"); |
68 |
> |
threadFail("unexpected exception"); |
69 |
|
} |
70 |
|
} |
71 |
|
}); |
77 |
|
fail("unexpected exception"); |
78 |
|
} |
79 |
|
} |
83 |
– |
|
84 |
– |
|
80 |
|
} |