KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jbpm > scheduler > exe > TaskTimerTest


1 package org.jbpm.scheduler.exe;
2
3 import java.util.List JavaDoc;
4
5 import junit.framework.TestCase;
6
7 import org.jbpm.graph.def.ProcessDefinition;
8 import org.jbpm.graph.exe.ProcessInstance;
9
10 public class TaskTimerTest extends TestCase {
11
12   public void testTaskTimerExecution() {
13     ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
14       "<process-definition>" +
15       " <start-state>" +
16       " <transition to='timed task' />" +
17       " </start-state>" +
18       " <task-node name='timed task'>" +
19       " <task name='find the hole in the market'>" +
20       " <timer duedate='23 business seconds'>" +
21       " <action class='geftem-eu-shuppe-oender-ze-konte'/>" +
22       " </timer>" +
23       " </task>" +
24       " </task-node>" +
25       "</process-definition>"
26     );
27     
28     ProcessInstance processInstance = new ProcessInstance(processDefinition);
29     processInstance.signal();
30     
31     List JavaDoc scheduledTimers = processInstance.getSchedulerInstance().getScheduledTimers();
32     assertEquals(1, scheduledTimers.size());
33   }
34 }
35
Popular Tags