" </state>" +
" <end-state name='end'/>" +
"</process-definition>"
);
JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
try {
TestSchedulerService testSchedulerService = (TestSchedulerService) jbpmContext.getServices().getSchedulerService();
ProcessInstance processInstance = new ProcessInstance(processDefinition);
processInstance.signal();
assertEquals(1, testSchedulerService.createdTimers.size());
Timer scheduledTimer = (Timer) testSchedulerService.createdTimers.get(0);
assertEquals("reminder", scheduledTimer.name);
assertEquals(processDefinition.getNode("catch crooks"), scheduledTimer.graphElement);
System.out.println("due date: "+scheduledTimer.dueDate);
assertNotNull(scheduledTimer.dueDate);
assertEquals("10 business minutes", scheduledTimer.repeat);
assertEquals("the-remainder-action-class-name", scheduledTimer.action.getActionDelegation().getClassName());
assertSame(processInstance.getRootToken(), scheduledTimer.token);
assertEquals("time-out-transition", scheduledTimer.transitionName);
// while we are at it, i might as well check if the cancel timer is not executed ;)
processInstance.signal();
assertEquals(0, testSchedulerService.cancelledTimersByName.size());
} finally {
jbpmContext.close();
}
}