}
@Test public void SerializeRun()
{
App1 flow = new App1();
TrailWrapper wrap1 = new TrailWrapper(flow);
SRInstance run = StartIt(wrap1);
String path = String.format("tmpfiles\\sr_1.out");
SRPersistentState state = new SRPersistentState(run, path);
try
{
FileOutputStream fout = new FileOutputStream(path);
boolean b = state.passivate(fout, path);
assertEquals("b",true,b);
fout.close();
}
catch(Exception e)
{}
try
{
path = state.m_streamId;
FileInputStream fin = new FileInputStream(path);
boolean b = state.activate(fin);
assertEquals("b",true,b);
fin.close();
state.m_run.finishActivation();
state.m_run.restoreModelBinder(new ModelBinder());
}
catch(Exception e)
{}
run = state.m_run; //the recreated run object
wrap1 = (TrailWrapper)run.ApplicationFlow();
assertEquals("appflow", "org.speakright.core.TrailWrapper", wrap1.getClass().getCanonicalName());
Proceed(run, "id33");
Proceed(run, "222");
Proceed(run);
Proceed(run, "choice1");