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

Comparing jsr166/src/test/tck/ScheduledExecutorSubclassTest.java (file contents):
Revision 1.20 by jsr166, Thu Apr 14 22:55:08 2011 UTC vs.
Revision 1.21 by dl, Fri May 6 11:22:07 2011 UTC

# Line 203 | Line 203 | public class ScheduledExecutorSubclassTe
203          RunnableCounter counter = new RunnableCounter();
204          ScheduledFuture h =
205              p.scheduleAtFixedRate(counter, 0, 1, MILLISECONDS);
206 <        Thread.sleep(SMALL_DELAY_MS);
206 >        delay(SMALL_DELAY_MS);
207          h.cancel(true);
208          int c = counter.count.get();
209          // By time scaling conventions, we must have at least
# Line 221 | Line 221 | public class ScheduledExecutorSubclassTe
221          RunnableCounter counter = new RunnableCounter();
222          ScheduledFuture h =
223              p.scheduleWithFixedDelay(counter, 0, 1, MILLISECONDS);
224 <        Thread.sleep(SMALL_DELAY_MS);
224 >        delay(SMALL_DELAY_MS);
225          h.cancel(true);
226          int c = counter.count.get();
227          assertTrue(c >= SMALL_DELAY_MS / SHORT_DELAY_MS);
# Line 382 | Line 382 | public class ScheduledExecutorSubclassTe
382              assertEquals(0, p.getCompletedTaskCount());
383              threadProceed.countDown();
384              threadDone.await();
385 <            Thread.sleep(SHORT_DELAY_MS);
385 >            delay(SHORT_DELAY_MS);
386              assertEquals(1, p.getCompletedTaskCount());
387          } finally {
388              joinPool(p);
# Line 657 | Line 657 | public class ScheduledExecutorSubclassTe
657                  long count = p.getTaskCount();
658                  if (count >= 0 && count <= max)
659                      break;
660 <                Thread.sleep(1);
660 >                delay(1);
661              }
662              assertTrue(k < SMALL_DELAY_MS);
663          } finally {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines