KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jbpm > bpel > xml > FlowReaderTest


1 package org.jbpm.bpel.xml;
2
3 import org.jbpm.bpel.def.Activity;
4 import org.jbpm.bpel.def.Flow;
5
6 /**
7  * @author Juan Cantú
8  * @version $Revision: 1.1 $ $Date: 2005/04/08 18:36:58 $
9  */

10 public class FlowReaderTest extends AbstractReaderTestCase {
11   
12   public void testLinks() throws Exception JavaDoc {
13     String JavaDoc 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 JavaDoc {
29     String JavaDoc 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 JavaDoc {
40     String JavaDoc 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