[jboss-user] [JBoss jBPM] - JUnit : process with timers / async=

gchanteb do-not-reply at jboss.com
Wed Mar 18 05:55:58 EDT 2009


Hi,

I would like to know your methods to JUnit test process with timers and asynchronous mode enabled.

For example, if i have this basic JUnit test:

	public void testProcess()
  | 	{
  | 		createnewProcessInstance();
  | 		assertEquals(1, processInstance.getId());
  | 		
  | 		Token rootToken = processInstance.getRootToken();
  | 		assertEquals("start-state", rootToken.getNode().getName());
  | 		
  | 		processInstance.signal();
  | 		
  | 		assertEquals("timer-state", rootToken.getNode().getName());
  | 		
  | 		processInstance.signal();
  | 		
  | 		assertEquals("end-state", rootToken.getNode().getName());
  | 	}

for this process:

<?xml version="1.0" encoding="UTF-8"?>
  | 
  | <process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="process6">
  | 
  | 	<start-state name="start-state">
  | 		<transition to="timer-state"></transition>
  | 	</start-state>
  | 
  | 	<state name="timer-state">
  | 		<transition to="end-state" name="to end-state"></transition>
  | 	</state>
  | 	
  | 	<end-state name="end-state"></end-state>
  | 
  | </process-definition>

What should be my new JUnit test for this process:

<?xml version="1.0" encoding="UTF-8"?>
  | 
  | <process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="process6">
  | 
  | 	<start-state name="start-state">
  | 		<transition to="timer-state"></transition>
  | 	</start-state>
  | 
  | 	<state name="timer-state" async="true">
  | 		<timer name="timer" duedate="5 seconds" transition="to end-state">
  | 			<action class="Action"></action>
  | 		</timer>
  | 		<transition to="end-state" name="to end-state"></transition>
  | 	</state>
  | 	
  | 	<end-state name="end-state"></end-state>
  | 
  | </process-definition>

Thx.

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4218965#4218965

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4218965



More information about the jboss-user mailing list