KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > soto > state > code > BeanshellStepTest


1 package org.sapia.soto.state.code;
2
3 import junit.framework.TestCase;
4
5 import org.sapia.soto.state.ContextImpl;
6 import org.sapia.soto.state.Result;
7 import org.sapia.soto.state.StateMachine;
8
9
10 /**
11  * @author Yanick Duchesne
12  * <dl>
13  * <dt><b>Copyright:</b><dd>Copyright &#169; 2002-2003 <a HREF="http://www.sapia-oss.org">Sapia Open Source Software</a>. All Rights Reserved.</dd></dt>
14  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
15  * <a HREF="http://www.sapia-oss.org/license.html">license page</a> at the Sapia OSS web site</dd></dt>
16  * </dl>
17  */

18 public class BeanshellStepTest extends TestCase {
19   /**
20    *
21    */

22   public BeanshellStepTest(String JavaDoc name) {
23     super(name);
24   }
25
26   public void testExecute() throws Exception JavaDoc {
27     ContextImpl ctx;
28     Result res = new Result(new StateMachine(), ctx = new ContextImpl());
29     BeanshellStep bsh = new BeanshellStep();
30     bsh.setText("result.setNextStateId(\"someState\");");
31     bsh.execute(res);
32     super.assertEquals("someState", res.getNextStateId());
33   }
34 }
35
Popular Tags