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.23 by jsr166, Sat May 7 19:49:37 2011 UTC vs.
Revision 1.25 by jsr166, Fri May 27 19:43:27 2011 UTC

# Line 48 | Line 48 | public class ScheduledExecutorSubclassTe
48          }
49      }
50  
51
51      public class CustomExecutor extends ScheduledThreadPoolExecutor {
52  
53          protected <V> RunnableScheduledFuture<V> decorateTask(Runnable r, RunnableScheduledFuture<V> task) {
# Line 73 | Line 72 | public class ScheduledExecutorSubclassTe
72  
73      }
74  
76
75      /**
76       * execute successfully executes a runnable
77       */
# Line 92 | Line 90 | public class ScheduledExecutorSubclassTe
90          }
91      }
92  
95
93      /**
94       * delayed schedule of callable successfully executes after delay
95       */
# Line 229 | Line 226 | public class ScheduledExecutorSubclassTe
226          joinPool(p);
227      }
228  
232
229      /**
230       * execute(null) throws NPE
231       */
# Line 523 | Line 519 | public class ScheduledExecutorSubclassTe
519          assertTrue(p.isShutdown());
520      }
521  
526
522      /**
523       * isTerminated is false before termination, true after
524       */
# Line 714 | Line 709 | public class ScheduledExecutorSubclassTe
709          }
710      }
711  
717
712      /**
713       * If setExecuteExistingDelayedTasksAfterShutdownPolicy is false,
714       * delayed tasks are cancelled at shutdown
# Line 741 | Line 735 | public class ScheduledExecutorSubclassTe
735          }
736      }
737  
744
738      /**
739       * If setContinueExistingPeriodicTasksAfterShutdownPolicy is set false,
740       * periodic tasks are cancelled at shutdown
# Line 753 | Line 746 | public class ScheduledExecutorSubclassTe
746          p.setContinueExistingPeriodicTasksAfterShutdownPolicy(false);
747          assertTrue(p.getExecuteExistingDelayedTasksAfterShutdownPolicy());
748          assertFalse(p.getContinueExistingPeriodicTasksAfterShutdownPolicy());
749 +        long initialDelay = LONG_DELAY_MS;
750          ScheduledFuture task =
751 <            p.scheduleAtFixedRate(new NoOpRunnable(), 5, 5, MILLISECONDS);
751 >            p.scheduleAtFixedRate(new NoOpRunnable(), initialDelay,
752 >                                  5, MILLISECONDS);
753          try { p.shutdown(); } catch (SecurityException ok) { return; }
754          assertTrue(p.isShutdown());
760        BlockingQueue q = p.getQueue();
755          assertTrue(p.getQueue().isEmpty());
756          assertTrue(task.isDone());
757          assertTrue(task.isCancelled());
758 <        assertTrue(p.awaitTermination(SMALL_DELAY_MS, MILLISECONDS));
765 <        assertTrue(p.isTerminated());
758 >        joinPool(p);
759      }
760  
761      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines