package unittest; import java.util.*; import org.jbpm.api.*; import org.jbpm.api.job.*; import org.jbpm.api.task.*; import org.jbpm.test.*; public class X10ExceptionTaskTest extends JbpmTestCase { protected void setUp() throws Exception { super.setUp(); identityService.createUser("johnsmith", "johnsmith", "johnsmith"); deployJpdlXmlString( "" + " " + " " + " " + " " + " " + " " + " " + " " + " ${task.name}" + " " + " " + " " + " " + " " + " " + ""); } protected void tearDown() throws Exception { identityService.deleteUser("johnsmith"); super.tearDown(); } public void testDefault() throws Exception { ProcessInstance processInstance = executionService .startProcessInstanceByKey("X10ExceptionTaskTest"); String processInstanceId = processInstance.getId(); int retries = 0; while (retries < 3) { retries++; try { List jobs = managementService.createJobQuery().list(); Job job = jobs.get(0); managementService.executeJob(job.getId()); break; } catch (Exception e) { System.out.println(e); } } List tasks = taskService.createTaskQuery().list(); assertEquals(0, tasks.size()); } }