* Created by IntelliJ IDEA. User: bard
*/
public class TestRecalculateTaskScheduleAlgorithm extends TaskTestCase {
public void testFinishStartDependenciesOnMovingEndDateForward()
throws TaskDependencyException {
TaskManager taskManager = getTaskManager();
Task task1 = taskManager.createTask();
task1.setStart(new GanttCalendar(2000, 01, 01));
task1.setDuration(taskManager.createLength(GregorianTimeUnitStack.DAY,
1));
//
Task task2 = taskManager.createTask();
task2.setStart(new GanttCalendar(2000, 01, 02));
task2.setDuration(taskManager.createLength(GregorianTimeUnitStack.DAY,
1));
//
Task task3 = taskManager.createTask();
task3.setStart(new GanttCalendar(2000, 01, 03));
task3.setDuration(taskManager.createLength(GregorianTimeUnitStack.DAY,
1));
// System.err.println("task3 end="+task3.getEnd());
//
taskManager.getDependencyCollection().createDependency(task3, task2,
new FinishStartConstraintImpl());
taskManager.getDependencyCollection().createDependency(task2, task1,
new FinishStartConstraintImpl());
task1.setEnd(new GanttCalendar(2000, 01, 03));
//
RecalculateTaskScheduleAlgorithm alg = taskManager
.getAlgorithmCollection().getRecalculateTaskScheduleAlgorithm();
alg.run(task1);
//
assertEquals("Unexpected value of end of task=" + task3,
new GanttCalendar(2000, 01, 05), task3.getEnd());