public GPCalendar getCalendar() {
return myJanuaryFirstIsHolidayCalendar;
}
public void testFinishStartBindings() throws Exception {
Task dependant = getTaskManager().createTask();
Task dependee = getTaskManager().createTask();
dependant.setStart(new GanttCalendar(1999, Calendar.DECEMBER, 30));
dependant.setEnd(new GanttCalendar(2000, Calendar.JANUARY, 3));
dependee.setStart(new GanttCalendar(1999, Calendar.NOVEMBER, 15));
dependee.setEnd(new GanttCalendar(1999, Calendar.NOVEMBER, 16));
//
TaskDependency dep = getTaskManager().getDependencyCollection()
.createDependency(dependant, dependee,
new FinishStartConstraintImpl());
TaskDependency.ActivityBinding binding = dep.getActivityBinding();
assertEquals(binding.getDependantActivity(),
dependant.getActivities()[0]);
assertEquals(binding.getDependeeActivity(), dependee.getActivities()[0]);
//
dependant.setStart(new GanttCalendar(2000, Calendar.JANUARY, 4));
dependant.setEnd(new GanttCalendar(2000, Calendar.JANUARY, 5));
dependee.setStart(new GanttCalendar(1999, Calendar.DECEMBER, 30));
dependee.setEnd(new GanttCalendar(2000, Calendar.JANUARY, 3));
binding = dep.getActivityBinding();
assertEquals(binding.getDependantActivity(),
dependant.getActivities()[0]);
assertEquals(binding.getDependeeActivity(), dependee.getActivities()[1]);
}