| 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 18 public class GroovyStepTest extends TestCase { 19 public GroovyStepTest(String name) { 20 super(name); 21 } 22 23 public void testExecute() throws Exception { 24 ContextImpl ctx; 25 Result res = new Result(new StateMachine(), ctx = new ContextImpl()); 26 GroovyStep gs = new GroovyStep(); 27 gs.addImport("java.util.Date"); 28 gs.setText("Date d = new Date(); result.setNextStateId(\"someState\");"); 29 gs.onCreate(); 30 gs.execute(res); 31 super.assertEquals("someState", res.getNextStateId()); 32 } 33 } 34 | Popular Tags |