9 |
|
import junit.framework.*; |
10 |
|
import java.util.*; |
11 |
|
import java.util.concurrent.*; |
12 |
+ |
import static java.util.concurrent.TimeUnit.MILLISECONDS; |
13 |
|
|
14 |
|
public class CountDownLatchTest extends JSR166TestCase { |
15 |
|
public static void main(String[] args) { |
93 |
|
public void run() { |
94 |
|
try { |
95 |
|
threadAssertTrue(l.getCount() > 0); |
96 |
< |
threadAssertTrue(l.await(SMALL_DELAY_MS, TimeUnit.MILLISECONDS)); |
96 |
> |
threadAssertTrue(l.await(SMALL_DELAY_MS, MILLISECONDS)); |
97 |
|
} catch (InterruptedException e) { |
98 |
|
threadUnexpectedException(); |
99 |
|
} |
146 |
|
public void run() { |
147 |
|
try { |
148 |
|
threadAssertTrue(l.getCount() > 0); |
149 |
< |
l.await(MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS); |
149 |
> |
l.await(MEDIUM_DELAY_MS, MILLISECONDS); |
150 |
|
threadShouldThrow(); |
151 |
|
} catch (InterruptedException success) {} |
152 |
|
} |
171 |
|
public void run() { |
172 |
|
try { |
173 |
|
threadAssertTrue(l.getCount() > 0); |
174 |
< |
threadAssertFalse(l.await(SHORT_DELAY_MS, TimeUnit.MILLISECONDS)); |
174 |
> |
threadAssertFalse(l.await(SHORT_DELAY_MS, MILLISECONDS)); |
175 |
|
threadAssertTrue(l.getCount() > 0); |
176 |
|
} catch (InterruptedException ie) { |
177 |
|
threadUnexpectedException(); |