assertEquals(6, msf.getAuditTrail().size());
assertEquals(10, msf.getAuditTrail().size()); assertEquals(4,msf.countFOE(processInstance));
	public void testSimpleSplitJoin() throws Exception {		MockProcessDef pd = new MockProcessDef("testSimpleSplitJoin"); 		ManualRunTaskDef tdStart = new ManualRunTaskDef(pd,"Start");		pd.setFirstTask(tdStart);		SplitTaskDef tdSplit = new SplitTaskDef(pd,"Split");		tdStart.addRoutingOut(tdSplit);		JoinTaskDef tdJoin = new JoinTaskDef(pd,"Join");				AutoRunTaskDef tdParallel1 = new AutoRunTaskDef (pd,"Parallel-1");		tdSplit.addRoutingOut(tdParallel1);		tdParallel1.addRoutingOut(tdJoin);		AutoRunTaskDef tdParallel2 = new AutoRunTaskDef (pd,"Parallel-2");		tdSplit.addRoutingOut(tdParallel2);				tdParallel2.addRoutingOut(tdJoin);				MockStateFactory msf = new MockStateFactory();		IEngine engine = new Engine(msf);		IProcessInstance processInstance = engine.createProcess(pd);		// tests to see if process is created properly 		assertEquals(pd, processInstance.getProcessDef());		assertTrue(processInstance.getProcessInstanceId().longValue() > 0);		assertEquals(IProcessInstance.STATE_CREATED, processInstance.getState());		// test to see if we have the expected number of tasks - NONE		Set taskInstances = processInstance.getTaskInstances();		assertEquals(0, taskInstances.size());		log.info("Starting Process");		engine.startProcess(processInstance);		taskInstances = processInstance.getTaskInstances();		// test to see if we have the expected number of tasks - ONE		assertEquals(1, taskInstances.size());				ITaskInstance ti = (ITaskInstance) taskInstances.iterator().next();		assertEquals(tdStart, ti.getTaskDefinition());		log.info("Transitioning Task " + ti.getTaskInstanceId());		engine.transitionTask(ti);		// test to see if we have the expected number of tasks - NONE		taskInstances = processInstance.getTaskInstances();		assertEquals(0, taskInstances.size());		/* test to see if the audit log is the expected size -		 * 1 process		 * 1 start task		 * 1 split task		 * 2 parallel tasks		 * 1 join task		 *  = 6 objects		 */ 				assertEquals(6, msf.getAuditTrail().size());		// test to see all are marked as "completed" / "deleted" as appropriate		assertEquals(1,msf.countInstances(pd));		assertEquals(1,msf.countInstances(tdStart));		assertEquals(1,msf.countInstances(tdSplit));		assertEquals(1,msf.countInstances(tdParallel1));		assertEquals(1,msf.countInstances(tdParallel2));		assertEquals(1,msf.countInstances(tdJoin));			}