package org.jbpm.examples.task.multiple; import java.util.List; import org.jbpm.api.task.Task; import org.jbpm.test.JbpmTestCase; import org.subethamail.wiser.Wiser; public class MultipleTasksTest extends JbpmTestCase { Wiser wiser = new Wiser(); String deploymentId; protected void setUp() throws Exception { super.setUp(); // deploy the process definition deploymentId = repositoryService.createDeployment() .addResourceFromClasspath( "org/jbpm/examples/task/multiple/process.jpdl.xml") .deploy(); // create actor identityService.createUser("johndoe", "John", "Doe", "john@doe"); // start mail server wiser.setPort(2525); wiser.start(); } protected void tearDown() throws Exception { // stop mail server wiser.stop(); repositoryService.deleteDeploymentCascade(deploymentId); super.tearDown(); } public void testOltWorkflow() { executionService.startProcessInstanceByKey("MultipleTasks"); List taskList = taskService.findPersonalTasks("johndoe"); assertEquals(1, taskList.size()); Task task = taskList.get(0); assertEquals("task1", task.getName()); assertEquals("johndoe", task.getAssignee()); // submit the task taskService.completeTask(task.getId(), "to task2"); /*This is where it goes wrong...*/ // verify that the next task is active and has been assigned to // 'johndoe' taskList = taskService.findPersonalTasks("johndoe"); assertEquals(1, taskList.size()); task = taskList.get(0); assertEquals("task2", task.getName()); assertEquals("johndoe", task.getAssignee()); } }