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

Comparing jsr166/src/test/tck/ScheduledExecutorTest.java (file contents):
Revision 1.70 by jsr166, Tue Oct 6 05:12:16 2015 UTC vs.
Revision 1.71 by jsr166, Tue Oct 6 05:22:25 2015 UTC

# Line 373 | Line 373 | public class ScheduledExecutorTest exten
373          final ThreadPoolExecutor p = new ScheduledThreadPoolExecutor(THREADS);
374          final CountDownLatch threadsStarted = new CountDownLatch(THREADS);
375          final CountDownLatch done = new CountDownLatch(1);
376 <        try (PoolCleaner cleaner = cleaner(p)) {
376 >        try (PoolCleaner cleaner = cleaner(p, done)) {
377              assertEquals(0, p.getLargestPoolSize());
378              for (int i = 0; i < THREADS; i++)
379                  p.execute(new CheckedRunnable() {
# Line 382 | Line 382 | public class ScheduledExecutorTest exten
382                          await(done);
383                          assertEquals(THREADS, p.getLargestPoolSize());
384                      }});
385 <            assertTrue(threadsStarted.await(LONG_DELAY_MS, MILLISECONDS));
385 >            await(threadsStarted);
386              assertEquals(THREADS, p.getLargestPoolSize());
387            done.countDown();
387          }
388          assertEquals(THREADS, p.getLargestPoolSize());
389      }
# Line 397 | Line 396 | public class ScheduledExecutorTest exten
396          final ThreadPoolExecutor p = new ScheduledThreadPoolExecutor(1);
397          final CountDownLatch threadStarted = new CountDownLatch(1);
398          final CountDownLatch done = new CountDownLatch(1);
399 <        try (PoolCleaner cleaner = cleaner(p)) {
399 >        try (PoolCleaner cleaner = cleaner(p, done)) {
400              assertEquals(0, p.getPoolSize());
401              p.execute(new CheckedRunnable() {
402                  public void realRun() throws InterruptedException {
# Line 405 | Line 404 | public class ScheduledExecutorTest exten
404                      assertEquals(1, p.getPoolSize());
405                      await(done);
406                  }});
407 <            assertTrue(threadStarted.await(LONG_DELAY_MS, MILLISECONDS));
407 >            await(threadStarted);
408              assertEquals(1, p.getPoolSize());
410            done.countDown();
409          }
410      }
411  
# Line 654 | Line 652 | public class ScheduledExecutorTest exten
652          }};
653          for (int i = 0; i < count; i++)
654              p.execute(waiter);
655 <        assertTrue(threadsStarted.await(LONG_DELAY_MS, MILLISECONDS));
655 >        await(threadsStarted);
656          assertEquals(poolSize, p.getActiveCount());
657          assertEquals(0, p.getCompletedTaskCount());
658          final List<Runnable> queuedTasks;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines