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

Comparing jsr166/src/test/tck/ThreadPoolExecutorSubclassTest.java (file contents):
Revision 1.93 by jsr166, Tue Oct 6 16:39:06 2015 UTC vs.
Revision 1.96 by jsr166, Wed Aug 24 22:22:39 2016 UTC

# Line 17 | Line 17 | import java.util.concurrent.Callable;
17   import java.util.concurrent.CancellationException;
18   import java.util.concurrent.CountDownLatch;
19   import java.util.concurrent.ExecutionException;
20 import java.util.concurrent.Executors;
20   import java.util.concurrent.ExecutorService;
21   import java.util.concurrent.Future;
22   import java.util.concurrent.FutureTask;
# Line 1725 | Line 1724 | public class ThreadPoolExecutorSubclassT
1724                            LONG_DELAY_MS, MILLISECONDS,
1725                            new ArrayBlockingQueue<Runnable>(10));
1726          try (PoolCleaner cleaner = cleaner(e)) {
1727 +            long startTime = System.nanoTime();
1728              List<Callable<String>> l = new ArrayList<Callable<String>>();
1729              l.add(new NPETask());
1730              try {
1731 <                e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS);
1731 >                e.invokeAny(l, LONG_DELAY_MS, MILLISECONDS);
1732                  shouldThrow();
1733              } catch (ExecutionException success) {
1734                  assertTrue(success.getCause() instanceof NullPointerException);
1735              }
1736 +            assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
1737          }
1738      }
1739  
# Line 1745 | Line 1746 | public class ThreadPoolExecutorSubclassT
1746                            LONG_DELAY_MS, MILLISECONDS,
1747                            new ArrayBlockingQueue<Runnable>(10));
1748          try (PoolCleaner cleaner = cleaner(e)) {
1749 +            long startTime = System.nanoTime();
1750              List<Callable<String>> l = new ArrayList<Callable<String>>();
1751              l.add(new StringTask());
1752              l.add(new StringTask());
1753 <            String result = e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS);
1753 >            String result = e.invokeAny(l, LONG_DELAY_MS, MILLISECONDS);
1754              assertSame(TEST_STRING, result);
1755 +            assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
1756          }
1757      }
1758  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines