package org.jbpm.examples.test; import java.util.List; import org.jbpm.api.ProcessInstance; import org.jbpm.api.task.Task; import org.jbpm.test.JbpmTestCase; public class ConcurrentTasksTest extends JbpmTestCase { String deploymentId; protected void setUp() throws Exception { super.setUp(); deploymentId = repositoryService.createDeployment() .addResourceFromClasspath( "org/jbpm/examples/test/process.jpdl.xml").deploy(); } protected void tearDown() throws Exception { repositoryService.deleteDeploymentCascade(deploymentId); super.tearDown(); } public void testConcurrentTasks() { ProcessInstance processInstance = executionService .startProcessInstanceByKey("concurrent_tasks"); List taskList = taskService.findPersonalTasks("alex"); assertEquals(2, taskList.size()); Task task1 = taskList.get(0); assertEquals(task1.getName(), "task1"); Task task2 = taskList.get(1); assertEquals(task2.getName(), "task2"); } }