diff --git a/ganttzk/src/test/java/org/zkoss/ganttz/data/criticalpath/CriticalPathCalculatorTest.java b/ganttzk/src/test/java/org/zkoss/ganttz/data/criticalpath/CriticalPathCalculatorTest.java index 4d63ae65c..1e673aacb 100644 --- a/ganttzk/src/test/java/org/zkoss/ganttz/data/criticalpath/CriticalPathCalculatorTest.java +++ b/ganttzk/src/test/java/org/zkoss/ganttz/data/criticalpath/CriticalPathCalculatorTest.java @@ -156,9 +156,22 @@ public class CriticalPathCalculatorTest { .andReturn(new HashSet()) .anyTimes(); + addTaskMethods(listOfTasks); + replay(diagramGraphExample); } + private void addTaskMethods(List listOfTasks) { + for (ITaskFundamentalProperties task : listOfTasks) { + expect(diagramGraphExample.getStartDate(task)).andReturn( + task.getBeginDate()).anyTimes(); + expect(diagramGraphExample.getStartConstraintsFor(task)).andReturn( + task.getStartConstraints()).anyTimes(); + expect(diagramGraphExample.getEndDateFor(task)).andReturn( + task.getEndDate()).anyTimes(); + } + } + /** *
      * #### T1 ####
@@ -194,6 +207,8 @@ public class CriticalPathCalculatorTest {
                 .andReturn(new HashSet())
                 .anyTimes();
 
+        addTaskMethods(listOfTasks);
+
         replay(diagramGraphExample);
     }
 
@@ -235,6 +250,8 @@ public class CriticalPathCalculatorTest {
         expect(diagramGraphExample.getOutgoingTasksFor(subtask1)).andReturn(
                 new HashSet()).anyTimes();
 
+        addTaskMethods(listOfTasks);
+
         replay(diagramGraphExample);
     }
 
@@ -293,6 +310,8 @@ public class CriticalPathCalculatorTest {
         expect(diagramGraphExample.getOutgoingTasksFor(subtask2)).andReturn(
                 new HashSet()).anyTimes();
 
+        addTaskMethods(listOfTasks);
+
         replay(diagramGraphExample);
     }
 
@@ -344,6 +363,8 @@ public class CriticalPathCalculatorTest {
                 .andReturn(new HashSet())
                 .anyTimes();
 
+        addTaskMethods(listOfTasks);
+
         replay(diagramGraphExample);
     }
 
@@ -392,6 +413,8 @@ public class CriticalPathCalculatorTest {
         expect(diagramGraphExample.getOutgoingTasksFor(subtask2)).andReturn(
                 new HashSet()).anyTimes();
 
+        addTaskMethods(listOfTasks);
+
         replay(diagramGraphExample);
     }
 
@@ -444,6 +467,8 @@ public class CriticalPathCalculatorTest {
         expect(diagramGraphExample.getOutgoingTasksFor(subtask1)).andReturn(
                 new HashSet()).anyTimes();
 
+        addTaskMethods(listOfTasks);
+
         replay(diagramGraphExample);
     }
 
@@ -503,6 +528,8 @@ public class CriticalPathCalculatorTest {
         expect(diagramGraphExample.getOutgoingTasksFor(finalTask)).andReturn(
                 new HashSet()).anyTimes();
 
+        addTaskMethods(listOfTasks);
+
         replay(diagramGraphExample);
     }
 
@@ -573,6 +600,8 @@ public class CriticalPathCalculatorTest {
         expect(diagramGraphExample.getOutgoingTasksFor(finalTask2)).andReturn(
                 new HashSet()).anyTimes();
 
+        addTaskMethods(listOfTasks);
+
         replay(diagramGraphExample);
     }
 
@@ -664,6 +693,8 @@ public class CriticalPathCalculatorTest {
         expect(diagramGraphExample.getOutgoingTasksFor(task10)).andReturn(
                 new HashSet()).anyTimes();
 
+        addTaskMethods(listOfTasks);
+
         replay(diagramGraphExample);
     }
 
@@ -706,6 +737,8 @@ public class CriticalPathCalculatorTest {
         expect(diagramGraphExample.getOutgoingTasksFor(task2)).andReturn(
                 new HashSet()).anyTimes();
 
+        addTaskMethods(listOfTasks);
+
         replay(diagramGraphExample);
     }
 
@@ -756,6 +789,8 @@ public class CriticalPathCalculatorTest {
         expect(diagramGraphExample.getOutgoingTasksFor(task2)).andReturn(
                 new HashSet()).anyTimes();
 
+        addTaskMethods(listOfTasks);
+
         replay(diagramGraphExample);
     }
 
@@ -817,6 +852,8 @@ public class CriticalPathCalculatorTest {
         expect(diagramGraphExample.getOutgoingTasksFor(subtask2)).andReturn(
                 new HashSet()).anyTimes();
 
+        addTaskMethods(listOfTasks);
+
         replay(diagramGraphExample);
     }
 
@@ -879,6 +916,8 @@ public class CriticalPathCalculatorTest {
         expect(diagramGraphExample.getOutgoingTasksFor(subtask3)).andReturn(
                 new HashSet()).anyTimes();
 
+        addTaskMethods(listOfTasks);
+
         replay(diagramGraphExample);
     }
 
@@ -921,6 +960,8 @@ public class CriticalPathCalculatorTest {
         expect(diagramGraphExample.getOutgoingTasksFor(task2)).andReturn(
                 new HashSet()).anyTimes();
 
+        addTaskMethods(listOfTasks);
+
         replay(diagramGraphExample);
     }
 
@@ -972,6 +1013,8 @@ public class CriticalPathCalculatorTest {
         expect(diagramGraphExample.getOutgoingTasksFor(task2)).andReturn(
                 new HashSet()).anyTimes();
 
+        addTaskMethods(listOfTasks);
+
         replay(diagramGraphExample);
     }
 
@@ -1033,6 +1076,8 @@ public class CriticalPathCalculatorTest {
         expect(diagramGraphExample.getOutgoingTasksFor(subtask2)).andReturn(
                 new HashSet()).anyTimes();
 
+        addTaskMethods(listOfTasks);
+
         replay(diagramGraphExample);
     }
 
@@ -1095,6 +1140,8 @@ public class CriticalPathCalculatorTest {
         expect(diagramGraphExample.getOutgoingTasksFor(subtask3)).andReturn(
                 new HashSet()).anyTimes();
 
+        addTaskMethods(listOfTasks);
+
         replay(diagramGraphExample);
     }
 
@@ -1145,6 +1192,8 @@ public class CriticalPathCalculatorTest {
         expect(diagramGraphExample.getOutgoingTasksFor(subtask2)).andReturn(
                 new HashSet()).anyTimes();
 
+        addTaskMethods(listOfTasks);
+
         replay(diagramGraphExample);
     }
 
@@ -1195,6 +1244,8 @@ public class CriticalPathCalculatorTest {
         expect(diagramGraphExample.getOutgoingTasksFor(subtask2)).andReturn(
                 new HashSet()).anyTimes();
 
+        addTaskMethods(listOfTasks);
+
         replay(diagramGraphExample);
     }
 
@@ -1251,6 +1302,8 @@ public class CriticalPathCalculatorTest {
         expect(diagramGraphExample.contains(taskContainer, subtask1))
                 .andReturn(true).anyTimes();
 
+        addTaskMethods(listOfTasks);
+
         replay(diagramGraphExample);
     }
 
@@ -1327,6 +1380,8 @@ public class CriticalPathCalculatorTest {
         expect(diagramGraphExample.contains(taskContainer, subtask2))
                 .andReturn(true).anyTimes();
 
+        addTaskMethods(listOfTasks);
+
         replay(diagramGraphExample);
     }
 
@@ -1391,6 +1446,8 @@ public class CriticalPathCalculatorTest {
         expect(diagramGraphExample.contains(taskContainer, subtask1))
                 .andReturn(true).anyTimes();
 
+        addTaskMethods(listOfTasks);
+
         replay(diagramGraphExample);
     }
 
@@ -1465,6 +1522,8 @@ public class CriticalPathCalculatorTest {
         expect(diagramGraphExample.contains(taskContainer, subtask1))
                 .andReturn(true).anyTimes();
 
+        addTaskMethods(listOfTasks);
+
         replay(diagramGraphExample);
     }