1 package org.jbpm.bpel.xml; 2 3 import org.jbpm.bpel.def.Activity; 4 import org.jbpm.bpel.def.Flow; 5 6 10 public class FlowReaderTest extends AbstractReaderTestCase { 11 12 public void testLinks() throws Exception { 13 String xml = 14 "<flow>" + 15 " <empty name='first'/>" + 16 " <empty name='second'/>" + 17 " <links>" + 18 " <link name='l1'/>" + 19 " <link name='l2'/>" + 20 " </links>" + 21 "</flow>"; 22 23 Flow flow = (Flow) readActivity(xml); 24 assertEquals("l1", flow.getLink("l1").getName()); 25 assertEquals("l2", flow.getLink("l2").getName()); 26 } 27 28 public void testLinksDefault() throws Exception { 29 String xml = 30 "<flow>" + 31 " <empty name='first'/>" + 32 " <empty name='second'/>" + 33 "</flow>"; 34 35 Flow flow = (Flow) readActivity(xml); 36 assertEquals(0, flow.getLinks().size()); 37 } 38 39 public void testActivities() throws Exception { 40 String xml = 41 "<flow>" + 42 " <empty name='first'/>" + 43 " <empty name='second'/>" + 44 "</flow>"; 45 46 Flow flow = (Flow) readActivity(xml); 47 Activity first = (Activity) flow.getNode("first"); 48 assertNotNull(first); 49 assertEquals(flow, first.getCompositeActivity()); 50 Activity second = (Activity) flow.getNode("second"); 51 assertNotNull(second); 52 assertEquals(flow, second.getCompositeActivity()); 53 } 54 } 55 | Popular Tags |