public void testSFwithWeekEnd() throws ParseException {
Project project = new Project();
Task rootTask = project.getRootTask();
DateFormat DF_DDMMYYYY_HHMM = new SimpleDateFormat(“dd/MM/yyyy HH:mm”);
Task task1 = rootTask.getChildren().add(“Task 1”);
task1.set(Tsk.START, DF_DDMMYYYY_HHMM.parse(“03/11/2014 08:00”));
task1.set(Tsk.FINISH, DF_DDMMYYYY_HHMM.parse(“03/11/2014 17:00”));
task1.set(Tsk.DURATION, project.getDuration(1d));
Task task2 = rootTask.getChildren().add(“Task 2”);
task2.set(Tsk.START, DF_DDMMYYYY_HHMM.parse(“01/01/2014 08:00”));
task2.set(Tsk.FINISH, DF_DDMMYYYY_HHMM.parse(“01/01/2014 17:00”));
task2.set(Tsk.DURATION, project.getDuration(1d));
project.getTaskLinks().add(task1, task2, TaskLinkType.StartToFinish);
Assert.assertEquals(DF_DDMMYYYY_HHMM.parse(“31/10/2014 08:00”), task2.get(Tsk.START));
Assert.assertEquals(DF_DDMMYYYY_HHMM.parse(“03/11/2014 08:00”), task2.get(Tsk.FINISH));
}
Result: java.lang.AssertionError: expected:<Mon Nov 03 08:00:00 BRST 2014> but was:<Fri Oct 31 17:00:00 BRST 2014>
public void testSFwithoutWeekEnd() throws ParseException {
Project project = new Project();
Task rootTask = project.getRootTask();
DateFormat DF_DDMMYYYY_HHMM = new SimpleDateFormat(“dd/MM/yyyy HH:mm”);
Task task3 = rootTask.getChildren().add(“Task 3”);
task3.set(Tsk.START, DF_DDMMYYYY_HHMM.parse(“04/11/2014 08:00”));
task3.set(Tsk.FINISH, DF_DDMMYYYY_HHMM.parse(“04/11/2014 17:00”));
task3.set(Tsk.DURATION, project.getDuration(1d));
Task task4 = rootTask.getChildren().add(“Task 4”);
task4.set(Tsk.START, DF_DDMMYYYY_HHMM.parse(“01/01/2014 08:00”));
task4.set(Tsk.FINISH, DF_DDMMYYYY_HHMM.parse(“01/01/2014 17:00”));
task4.set(Tsk.DURATION, project.getDuration(1d));
project.getTaskLinks().add(task3, task4, TaskLinkType.StartToFinish);
Assert.assertEquals(DF_DDMMYYYY_HHMM.parse(“03/11/2014 08:00”), task4.get(Tsk.START));
Assert.assertEquals(DF_DDMMYYYY_HHMM.parse(“04/11/2014 08:00”), task4.get(Tsk.FINISH));
}
java.lang.AssertionError: expected:<Tue Nov 04 08:00:00 BRST 2014> but was:<Mon Nov 03 17:00:00 BRST 2014>