Author: ruschein
Date: 2010-10-20 10:45:38 -0700 (Wed, 20 Oct 2010)
New Revision: 22309
Modified:
core3/work-api/trunk/src/test/java/org/cytoscape/work/AbstractTaskTest.java
Log:
Added another test.
Modified:
core3/work-api/trunk/src/test/java/org/cytoscape/work/AbstractTaskTest.java
===================================================================
--- core3/work-api/trunk/src/test/java/org/cytoscape/work/AbstractTaskTest.java
2010-10-20 17:39:40 UTC (rev 22308)
+++ core3/work-api/trunk/src/test/java/org/cytoscape/work/AbstractTaskTest.java
2010-10-20 17:45:38 UTC (rev 22309)
@@ -44,7 +44,7 @@
}
@Test
- public final void testTaskInsertion() throws Exception {
+ public final void testTaskInsertion1() throws Exception {
initialTask.insertTasksAfterCurrentTask(new SimpleTask2(2), new
SimpleTask2(3));
initialTask.insertTasksAfterCurrentTask(new SimpleTask2(4));
@@ -58,6 +58,21 @@
}
@Test
+ public final void testTaskInsertion2() throws Exception {
+ final TaskIterator tasks = new TaskIterator(new SimpleTask2(2),
new SimpleTask2(3));
+ initialTask.insertTasksAfterCurrentTask(tasks);
+ initialTask.insertTasksAfterCurrentTask(new SimpleTask2(4));
+
+ final int expectedSequence[] = { 1, 4, 2, 3 };
+ for (int taskId : expectedSequence) {
+ assertTrue("Invalid task count in iterator!",
iter.hasNext());
+ final Task task = iter.next();
+ assertEquals("Task ID does not match expected ID!",
taskId, ((SimpleTask2)task).getId());
+ }
+ assertFalse("Invalid task count in iterator!", iter.hasNext());
+ }
+
+ @Test
public final void testCancellation() throws Exception {
final SimpleTask2 task = new SimpleTask2(1);
assertFalse("\"cancelled\" must start out set to false!",
task.cancelled());
--
You received this message because you are subscribed to the Google Groups
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cytoscape-cvs?hl=en.