1 package org.sapia.soto.state; 2 3 import junit.framework.TestCase; 4 5 import org.sapia.soto.SotoContainer; 6 import org.sapia.soto.state.ContextImpl; 7 import org.sapia.soto.state.StateMachineService; 8 9 import java.io.File ; 10 11 12 21 public class ModuleTest extends TestCase { 22 public ModuleTest(String name) { 23 super(name); 24 } 25 26 public void testReload() throws Exception { 27 SotoContainer cont = new SotoContainer(); 28 File conf; 29 File included; 30 included = new File ("etc/stm/included.xml"); 31 included.setLastModified(System.currentTimeMillis()); 32 System.setProperty("soto.debug", "true"); 33 cont.load(conf = new File ("etc/stm/config.xml")); 34 35 StateMachineService svc = (StateMachineService) cont.lookup("stateService"); 36 svc.execute("test", "test", new ContextImpl()); 37 38 45 included.setLastModified(1); 46 Thread.sleep(500); 47 svc.execute("test", "test", new ContextImpl()); 48 } 49 } 50 | Popular Tags |