KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.jbpm.bpel.xml;
2
3 import javax.xml.namespace.QName JavaDoc;
4
5 import org.jbpm.bpel.data.def.VariableDefinition;
6 import org.jbpm.bpel.def.Throw;
7
8 /**
9  * @author Juan Cantú
10  * @version $Revision: 1.6 $ $Date: 2005/06/16 19:15:35 $
11  */

12 public class ThrowReaderTest extends AbstractReaderTestCase {
13   
14   public void testFaultName() throws Exception JavaDoc {
15     String JavaDoc xml ="<throw faultName='fn'/>";
16     Throw throwActivity = (Throw) readActivity(xml);
17     assertEquals(new QName JavaDoc("fn"), throwActivity.getFaultName());
18   }
19   
20   public void testFaultVariable() throws Exception JavaDoc {
21     VariableDefinition variable = new VariableDefinition();
22     variable.setName("fv");
23     scope.addVariable(variable);
24     
25     String JavaDoc xml ="<throw faultName='fn' faultVariable='fv'/>";
26     
27     Throw throwActivity = (Throw) readActivity(xml);
28     assertEquals( "fv", throwActivity.getFaultVariable().getName() );
29   }
30 }
31
Popular Tags