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

Comparing jsr166/src/test/tck/ThreadPoolExecutorTest.java (file contents):
Revision 1.58 by jsr166, Mon Sep 14 00:53:37 2015 UTC vs.
Revision 1.60 by jsr166, Sun Sep 27 18:50:50 2015 UTC

# Line 624 | Line 624 | public class ThreadPoolExecutorTest exte
624      }
625  
626      /**
627 <     * shutdownNow returns a list containing tasks that were not run
627 >     * shutdownNow returns a list containing tasks that were not run,
628 >     * and those tasks are drained from the queue
629       */
630      public void testShutdownNow() {
631          final ThreadPoolExecutor p =
# Line 642 | Line 643 | public class ThreadPoolExecutorTest exte
643              } catch (SecurityException ok) { return; }
644          }
645          assertTrue(p.isShutdown());
646 +        assertTrue(p.getQueue().isEmpty());
647          assertTrue(l.size() <= 4);
648      }
649  
# Line 1895 | Line 1897 | public class ThreadPoolExecutorTest exte
1897          try {
1898              for (long timeout = timeoutMillis();;) {
1899                  List<Callable<String>> tasks = new ArrayList<>();
1900 <                tasks.add(new StringTask());
1900 >                tasks.add(new StringTask("0"));
1901                  tasks.add(Executors.callable(new LongPossiblyInterruptedRunnable(), TEST_STRING));
1902 <                tasks.add(new StringTask());
1902 >                tasks.add(new StringTask("2"));
1903                  long startTime = System.nanoTime();
1904                  List<Future<String>> futures =
1905                      e.invokeAll(tasks, timeout, MILLISECONDS);
# Line 1907 | Line 1909 | public class ThreadPoolExecutorTest exte
1909                      assertTrue(future.isDone());
1910                  assertTrue(futures.get(1).isCancelled());
1911                  try {
1912 <                    assertEquals(TEST_STRING, futures.get(0).get());
1913 <                    assertEquals(TEST_STRING, futures.get(2).get());
1912 >                    assertEquals("0", futures.get(0).get());
1913 >                    assertEquals("2", futures.get(2).get());
1914                      break;
1915                  } catch (CancellationException retryWithLongerTimeout) {
1916                      timeout *= 2;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines