[cvs] / jsr166 / src / test / tck / AbstractExecutorServiceTest.java Repository:
ViewVC logotype

Diff of /jsr166/src/test/tck/AbstractExecutorServiceTest.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.38, Mon Sep 14 03:14:43 2015 UTC revision 1.39, Sun Oct 4 06:05:53 2015 UTC
# Line 603  Line 603 
603      public void testTimedInvokeAll6() throws Exception {      public void testTimedInvokeAll6() throws Exception {
604          ExecutorService e = new DirectExecutorService();          ExecutorService e = new DirectExecutorService();
605          try {          try {
606              long timeout = timeoutMillis();              for (long timeout = timeoutMillis();;) {
607              List<Callable<String>> tasks = new ArrayList<>();              List<Callable<String>> tasks = new ArrayList<>();
608              tasks.add(new StringTask("0"));              tasks.add(new StringTask("0"));
609              tasks.add(Executors.callable(possiblyInterruptedRunnable(timeout),              tasks.add(Executors.callable(possiblyInterruptedRunnable(timeout),
# Line 616  Line 616 
616              assertTrue(millisElapsedSince(startTime) >= timeout);              assertTrue(millisElapsedSince(startTime) >= timeout);
617              for (Future future : futures)              for (Future future : futures)
618                  assertTrue(future.isDone());                  assertTrue(future.isDone());
619                    try {
620              assertEquals("0", futures.get(0).get());              assertEquals("0", futures.get(0).get());
621              assertEquals(TEST_STRING, futures.get(1).get());              assertEquals(TEST_STRING, futures.get(1).get());
622                    } catch (CancellationException retryWithLongerTimeout) {
623                        // unusual delay before starting second task
624                        timeout *= 2;
625                        if (timeout >= LONG_DELAY_MS / 2)
626                            fail("expected exactly one task to be cancelled");
627                        continue;
628                    }
629              assertTrue(futures.get(2).isCancelled());              assertTrue(futures.get(2).isCancelled());
630                    break;
631                }
632          } finally {          } finally {
633              joinPool(e);              joinPool(e);
634          }          }

Legend:
Removed from v.1.38  
changed lines
  Added in v.1.39

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8