*/
public class TestTaskActivitiesRecalculation extends TaskTestCase {
public void testRecalculateOnChangingDurationByMutator() {
Task task = getTaskManager().createTask();
{
task.setStart(new GanttCalendar(2000, 0, 3));
task.setDuration(getTaskManager().createLength(1));
TaskActivity[] activities = task.getActivities();
assertEquals("Unexpected length of activities", 1,
activities.length);
assertEquals("Unexpected end of the las activity",
new GanttCalendar(2000, 0, 4).getTime(), activities[0]
.getEnd());
}
//
{
TaskMutator mutator = task.createMutator();
mutator.setDuration(getTaskManager().createLength(2));
TaskActivity[] activities = task.getActivities();
assertEquals("Unexpected length of activities", 1,
activities.length);
assertEquals("Unexpected end of the last activity",
new GanttCalendar(2000, 0, 5).getTime(), activities[0]
.getEnd());
}
}