ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/ExecutorsTest.java
(Generate patch)

Comparing jsr166/src/test/tck/ExecutorsTest.java (file contents):
Revision 1.25 by jsr166, Sat Nov 21 02:07:26 2009 UTC vs.
Revision 1.26 by jsr166, Sat Nov 21 02:33:20 2009 UTC

# Line 10 | Line 10
10   import junit.framework.*;
11   import java.util.*;
12   import java.util.concurrent.*;
13 + import static java.util.concurrent.TimeUnit.MILLISECONDS;
14   import java.math.BigInteger;
15   import java.security.*;
16  
# Line 35 | Line 36 | public class ExecutorsTest extends JSR16
36          public T call() throws Exception {
37              Future<T> ftask = exec.submit(func);
38              try {
39 <                return ftask.get(msecs, TimeUnit.MILLISECONDS);
39 >                return ftask.get(msecs, MILLISECONDS);
40              } finally {
41                  ftask.cancel(true);
42              }
# Line 222 | Line 223 | public class ExecutorsTest extends JSR16
223      public void testNewSingleThreadScheduledExecutor() throws Exception {
224          TrackedCallable callable = new TrackedCallable();
225          ScheduledExecutorService p1 = Executors.newSingleThreadScheduledExecutor();
226 <        Future f = p1.schedule(callable, SHORT_DELAY_MS, TimeUnit.MILLISECONDS);
226 >        Future f = p1.schedule(callable, SHORT_DELAY_MS, MILLISECONDS);
227          assertFalse(callable.done);
228          Thread.sleep(MEDIUM_DELAY_MS);
229          assertTrue(callable.done);
# Line 236 | Line 237 | public class ExecutorsTest extends JSR16
237      public void testnewScheduledThreadPool() throws Exception {
238          TrackedCallable callable = new TrackedCallable();
239          ScheduledExecutorService p1 = Executors.newScheduledThreadPool(2);
240 <        Future f = p1.schedule(callable, SHORT_DELAY_MS, TimeUnit.MILLISECONDS);
240 >        Future f = p1.schedule(callable, SHORT_DELAY_MS, MILLISECONDS);
241          assertFalse(callable.done);
242          Thread.sleep(MEDIUM_DELAY_MS);
243          assertTrue(callable.done);
# Line 250 | Line 251 | public class ExecutorsTest extends JSR16
251      public void testunconfigurableScheduledExecutorService() throws Exception {
252          TrackedCallable callable = new TrackedCallable();
253          ScheduledExecutorService p1 = Executors.unconfigurableScheduledExecutorService(Executors.newScheduledThreadPool(2));
254 <        Future f = p1.schedule(callable, SHORT_DELAY_MS, TimeUnit.MILLISECONDS);
254 >        Future f = p1.schedule(callable, SHORT_DELAY_MS, MILLISECONDS);
255          assertFalse(callable.done);
256          Thread.sleep(MEDIUM_DELAY_MS);
257          assertTrue(callable.done);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines