"</process-definition>"
);
JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
TestSchedulerService testSchedulerService = (TestSchedulerService) jbpmContext.getServices().getSchedulerService();
ProcessInstance processInstance = new ProcessInstance(processDefinition);
try {
processInstance.signal();
processInstance.suspend();
jbpmContext.save(processInstance);
} finally {
jbpmContext.close();
}
assertEquals(1, testSchedulerService.suspendedTimerTokens.size());
Token suspendedToken = (Token) testSchedulerService.suspendedTimerTokens.get(0);
assertSame(processInstance.getRootToken(), suspendedToken);
jbpmContext = jbpmConfiguration.createJbpmContext();
testSchedulerService = (TestSchedulerService) jbpmContext.getServices().getSchedulerService();
try {
processInstance.resume();
jbpmContext.save(processInstance);
} finally {
jbpmContext.close();
}
Token resumedToken = (Token) testSchedulerService.resumedTimerTokens.get(0);
assertSame(processInstance.getRootToken(), resumedToken);
}