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

Comparing jsr166/src/test/tck/AbstractExecutorServiceTest.java (file contents):
Revision 1.41 by jsr166, Mon Oct 5 22:54:45 2015 UTC vs.
Revision 1.44 by jsr166, Thu Oct 8 03:08:37 2015 UTC

# Line 449 | Line 449 | public class AbstractExecutorServiceTest
449      public void testTimedInvokeAny4() throws Exception {
450          final ExecutorService e = new DirectExecutorService();
451          try (PoolCleaner cleaner = cleaner(e)) {
452 +            long startTime = System.nanoTime();
453              List<Callable<String>> l = new ArrayList<Callable<String>>();
454              l.add(new NPETask());
455              try {
456 <                e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS);
456 >                e.invokeAny(l, LONG_DELAY_MS, MILLISECONDS);
457                  shouldThrow();
458              } catch (ExecutionException success) {
459                  assertTrue(success.getCause() instanceof NullPointerException);
460              }
461 +            assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
462          }
463      }
464  
# Line 466 | Line 468 | public class AbstractExecutorServiceTest
468      public void testTimedInvokeAny5() throws Exception {
469          final ExecutorService e = new DirectExecutorService();
470          try (PoolCleaner cleaner = cleaner(e)) {
471 +            long startTime = System.nanoTime();
472              List<Callable<String>> l = new ArrayList<Callable<String>>();
473              l.add(new StringTask());
474              l.add(new StringTask());
475 <            String result = e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS);
475 >            String result = e.invokeAny(l, LONG_DELAY_MS, MILLISECONDS);
476              assertSame(TEST_STRING, result);
477 +            assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
478          }
479      }
480  
# Line 538 | Line 542 | public class AbstractExecutorServiceTest
542              List<Callable<String>> l = new ArrayList<Callable<String>>();
543              l.add(new NPETask());
544              List<Future<String>> futures =
545 <                e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS);
545 >                e.invokeAll(l, LONG_DELAY_MS, MILLISECONDS);
546              assertEquals(1, futures.size());
547              try {
548                  futures.get(0).get();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines