--- jsr166/src/test/tck/ScheduledExecutorTest.java 2003/12/25 19:48:57 1.12 +++ jsr166/src/test/tck/ScheduledExecutorTest.java 2004/01/07 01:13:50 1.15 @@ -1,8 +1,9 @@ /* - * Written by members of JCP JSR-166 Expert Group and released to the - * public domain. Use, modify, and redistribute this code in any way - * without acknowledgement. Other contributors include Andrew Wright, - * Jeffrey Hayes, Pat Fischer, Mike Judd. + * Written by Doug Lea with assistance from members of JCP JSR-166 + * Expert Group and released to the public domain, as explained at + * http://creativecommons.org/licenses/publicdomain + * Other contributors include Andrew Wright, Jeffrey Hayes, + * Pat Fisher, Mike Judd. */ import junit.framework.*; @@ -594,7 +595,7 @@ public class ScheduledExecutorTest exten Thread.sleep(SHORT_DELAY_MS); assertFalse(task.isCancelled()); task.cancel(true); - assertTrue(task.isCancelled()); + assertTrue(task.isDone()); Thread.sleep(SHORT_DELAY_MS); assertTrue(p1.isTerminated()); } @@ -1060,14 +1061,17 @@ public class ScheduledExecutorTest exten ArrayList> l = new ArrayList>(); l.add(new StringTask()); l.add(Executors.callable(new MediumPossiblyInterruptedRunnable(), TEST_STRING)); + l.add(new StringTask()); List> result = e.invokeAll(l, SHORT_DELAY_MS, TimeUnit.MILLISECONDS); - assertEquals(2, result.size()); + assertEquals(3, result.size()); Iterator> it = result.iterator(); Future f1 = it.next(); Future f2 = it.next(); + Future f3 = it.next(); assertTrue(f1.isDone()); - assertFalse(f1.isCancelled()); assertTrue(f2.isDone()); + assertTrue(f3.isDone()); + assertFalse(f1.isCancelled()); assertTrue(f2.isCancelled()); } catch(Exception ex) { unexpectedException();