* @throws Exception
*/
@Test
public void timeOut() throws Exception
{
JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
ProcessInstance processInstance = jbpmContext.loadProcessInstance(processInstanceId);
Token token = processInstance.getRootToken();
assertEquals("start",token.getNode().getName());
//Move the process to service1
processInstance.signal();
jbpmContext.close();
//Our timer fires after 1000 millies, so let's wait for that
int seconds=0;
while(true) {
jbpmContext = jbpmConfiguration.createJbpmContext();
processInstance = jbpmContext.loadProcessInstance(processInstanceId);
token = processInstance.getRootToken();
logger.info(seconds++ + " Node=" + token.getNode().getName());
if ("ExceptionHandling".equals(token.getNode().getName())) break; //we're done waiting
if (seconds > 20) break; // the timer must not have fired so we are bailing (and failing)