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.38 by jsr166, Thu Apr 14 22:55:08 2011 UTC vs.
Revision 1.39 by dl, Fri May 6 11:22:07 2011 UTC

# Line 150 | Line 150 | public class ScheduledExecutorTest exten
150          RunnableCounter counter = new RunnableCounter();
151          ScheduledFuture h =
152              p.scheduleAtFixedRate(counter, 0, 1, MILLISECONDS);
153 <        Thread.sleep(SMALL_DELAY_MS);
153 >        delay(SMALL_DELAY_MS);
154          h.cancel(true);
155          int c = counter.count.get();
156          // By time scaling conventions, we must have at least
# Line 168 | Line 168 | public class ScheduledExecutorTest exten
168          RunnableCounter counter = new RunnableCounter();
169          ScheduledFuture h =
170              p.scheduleWithFixedDelay(counter, 0, 1, MILLISECONDS);
171 <        Thread.sleep(SMALL_DELAY_MS);
171 >        delay(SMALL_DELAY_MS);
172          h.cancel(true);
173          int c = counter.count.get();
174          assertTrue(c >= SMALL_DELAY_MS / SHORT_DELAY_MS);
# Line 331 | Line 331 | public class ScheduledExecutorTest exten
331              assertEquals(0, p.getCompletedTaskCount());
332              threadProceed.countDown();
333              threadDone.await();
334 <            Thread.sleep(SHORT_DELAY_MS);
334 >            delay(SHORT_DELAY_MS);
335              assertEquals(1, p.getCompletedTaskCount());
336          } finally {
337              joinPool(p);
# Line 607 | Line 607 | public class ScheduledExecutorTest exten
607                  long count = p.getTaskCount();
608                  if (count >= 0 && count <= max)
609                      break;
610 <                Thread.sleep(1);
610 >                delay(1);
611              }
612              assertTrue(k < SMALL_DELAY_MS);
613          } finally {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines