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.39 by jsr166, Tue Nov 30 02:12:52 2010 UTC vs.
Revision 1.43 by jsr166, Sat May 7 19:49:37 2011 UTC

# Line 1 | Line 1
1   /*
2   * Written by Doug Lea with assistance from members of JCP JSR-166
3   * Expert Group and released to the public domain, as explained at
4 < * http://creativecommons.org/licenses/publicdomain
4 > * http://creativecommons.org/publicdomain/zero/1.0/
5   * Other contributors include Andrew Wright, Jeffrey Hayes,
6   * Pat Fisher, Mike Judd.
7   */
# Line 154 | Line 154 | public class ThreadPoolExecutorTest exte
154              assertEquals(0, p.getCompletedTaskCount());
155              threadProceed.countDown();
156              threadDone.await();
157 <            Thread.sleep(SHORT_DELAY_MS);
157 >            delay(SHORT_DELAY_MS);
158              assertEquals(1, p.getCompletedTaskCount());
159          } finally {
160              joinPool(p);
# Line 378 | Line 378 | public class ThreadPoolExecutorTest exte
378      }
379  
380      /**
381 <     * isShutDown is false before shutdown, true after
381 >     * isShutdown is false before shutdown, true after
382       */
383      public void testIsShutdown() {
384          final ThreadPoolExecutor p =
# Line 564 | Line 564 | public class ThreadPoolExecutorTest exte
564      }
565  
566      /**
567 <     * shutDownNow returns a list containing tasks that were not run
567 >     * shutdownNow returns a list containing tasks that were not run
568       */
569 <    public void testShutDownNow() {
569 >    public void testShutdownNow() {
570          final ThreadPoolExecutor p =
571              new ThreadPoolExecutor(1, 1,
572                                     LONG_DELAY_MS, MILLISECONDS,
# Line 1345 | Line 1345 | public class ThreadPoolExecutorTest exte
1345          try {
1346              TrackedNoOpRunnable r = new TrackedNoOpRunnable();
1347              p.execute(r);
1348 <            Thread.sleep(SHORT_DELAY_MS);
1348 >            delay(SHORT_DELAY_MS);
1349              assertTrue(r.done);
1350              assertTrue(p.beforeCalled);
1351              assertTrue(p.afterCalled);
# Line 1919 | Line 1919 | public class ThreadPoolExecutorTest exte
1919              for (int i = 0; i < (MEDIUM_DELAY_MS/10); i++) {
1920                  if (p.getPoolSize() == 0)
1921                      break;
1922 <                Thread.sleep(10);
1922 >                delay(10);
1923              }
1924              assertEquals(0, p.getPoolSize());
1925          } finally {
# Line 1943 | Line 1943 | public class ThreadPoolExecutorTest exte
1943                      threadStarted.countDown();
1944                      assertTrue(p.getPoolSize() >= 1);
1945                  }});
1946 <            Thread.sleep(SMALL_DELAY_MS);
1946 >            delay(SMALL_DELAY_MS);
1947              assertTrue(p.getPoolSize() >= 1);
1948          } finally {
1949              joinPool(p);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines