1 package org.jbpm.jpdl.patterns; 2 3 import junit.framework.*; 4 5 import org.jbpm.graph.def.*; 6 import org.jbpm.graph.exe.*; 7 8 public class Wfp21CancelCaseTest extends TestCase { 9 10 public void testCancelActivityScenario2() { 11 ProcessDefinition pd = Wfp20CancelActivityTest.cancelProcessDefinition; 12 ProcessInstance pi = new ProcessInstance(pd); 13 pi.signal(); 14 Token root = pi.getRootToken(); 15 Token tokenA = root.getChild("a"); 16 Token tokenF2 = root.getChild("f2"); 17 Token tokenF2B = tokenF2.getChild("b"); 18 Token tokenF2C = tokenF2.getChild("c"); 19 20 assertFalse( pi.hasEnded() ); 21 assertFalse( root.hasEnded() ); 22 assertFalse( tokenA.hasEnded() ); 23 assertFalse( tokenF2.hasEnded() ); 24 assertFalse( tokenF2B.hasEnded() ); 25 assertFalse( tokenF2C.hasEnded() ); 26 27 pi.end(); 28 29 assertTrue( pi.hasEnded() ); 30 assertTrue( root.hasEnded() ); 31 assertTrue( tokenA.hasEnded() ); 32 assertTrue( tokenF2.hasEnded() ); 33 assertTrue( tokenF2B.hasEnded() ); 34 assertTrue( tokenF2C.hasEnded() ); 35 } 36 37 } 38 | Popular Tags |