use of org.activiti.engine.impl.calendar.DurationBusinessCalendar in project Activiti by Activiti.
the class ProcessEngineConfigurationImpl method initBusinessCalendarManager.
protected void initBusinessCalendarManager() {
if (businessCalendarManager == null) {
MapBusinessCalendarManager mapBusinessCalendarManager = new MapBusinessCalendarManager();
mapBusinessCalendarManager.addBusinessCalendar(DurationBusinessCalendar.NAME, new DurationBusinessCalendar(this.clock));
mapBusinessCalendarManager.addBusinessCalendar(DueDateBusinessCalendar.NAME, new DueDateBusinessCalendar(this.clock));
mapBusinessCalendarManager.addBusinessCalendar(CycleBusinessCalendar.NAME, new CycleBusinessCalendar(this.clock));
businessCalendarManager = mapBusinessCalendarManager;
}
}
use of org.activiti.engine.impl.calendar.DurationBusinessCalendar in project Activiti by Activiti.
the class DurationBusinessCalendarTest method testSimpleDuration.
public void testSimpleDuration() throws Exception {
Clock testingClock = new DefaultClockImpl();
DurationBusinessCalendar businessCalendar = new DurationBusinessCalendar(testingClock);
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy MM dd - HH:mm");
Date now = simpleDateFormat.parse("2010 06 11 - 17:23");
testingClock.setCurrentTime(now);
Date duedate = businessCalendar.resolveDuedate("P2DT5H70M");
Date expectedDuedate = simpleDateFormat.parse("2010 06 13 - 23:33");
assertEquals(expectedDuedate, duedate);
}
Aggregations