KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.jbpm.bpel.xml;
2
3 import org.jbpm.bpel.def.Activity;
4 import org.jbpm.bpel.def.While;
5
6 /**
7  * @author Juan Cantú
8  * @version $Revision: 1.2 $ $Date: 2005/04/19 00:45:50 $
9  */

10 public class WhileReaderTest extends AbstractReaderTestCase {
11   
12   public void testActivity() throws Exception JavaDoc {
13     String JavaDoc xml =
14       "<while>" +
15       "<condition>$c</condition>" +
16       " <empty name='whileActivity'/>" +
17       "</while>";
18     While whileBlock = (While) readActivity(xml);
19     Activity activity = (Activity) whileBlock.getNode("whileActivity");
20     assertNotNull(activity);
21     assertEquals(whileBlock, activity.getCompositeActivity());
22   }
23   
24   public void testCondition() throws Exception JavaDoc {
25     String JavaDoc xml =
26       "<while>" +
27       "<condition>$c</condition>" +
28       " <empty name='first'/>" +
29       "</while>";
30     While whileBlock = (While) readActivity(xml);
31     assertEquals("$c", whileBlock.getCondition().getText());
32   }
33 }
34
Popular Tags