1 package org.jbpm.bpel.def; 2 3 import junit.framework.TestCase; 4 5 import org.jbpm.context.def.ContextDefinition; 6 import org.jbpm.graph.def.ProcessDefinition; 7 import org.jbpm.graph.def.Transition; 8 9 13 public class ActivityDefTest extends TestCase { 14 15 Link link; 16 Activity activity; 17 String linkName = "testLink"; 18 19 public void setUp() { 20 ProcessDefinition pd = new ProcessDefinition(); 21 pd.addDefinition(new ContextDefinition()); 22 activity = new Empty(); 23 link = new Link(linkName); 24 } 25 26 public void testDefaultArrivingTransition() { 27 Transition t = new Transition(); 28 activity.addArrivingTransition( t ); 29 assertEquals(t, activity.getDefaultArrivingTransition()); 30 } 31 32 public void testSetSource() { 33 activity.addSource(link); 34 assertEquals(link, activity.getSources().iterator().next()); 35 } 36 37 public void testSetTarget() { 38 activity.addTarget(link); 39 assertEquals(link.getTarget(), activity); 40 assertTrue(activity.getTargets().contains(link)); 41 } 42 } 43 | Popular Tags |