Package org.speakright.core

Examples of org.speakright.core.TrailWrapper


    log("---------SerializePromptsAndGrammars-------");
        SRApp flow = new SRApp();
        flow.add(new PFlow("this is the FIRST page"));
        flow.add(new PFlow("and now the SECOND page"));
        flow.add(new QFlow("abc.grxml", "what zxzzsize is it?"));
    TrailWrapper wrap1 = new TrailWrapper(flow);
   
   
    String path = String.format("tmpfiles\\sr_3.out");
    persistentStartIt(wrap1, path);
   
View Full Code Here


     * Finally I moved the test into TestWebServlet2.PFlow.  It stores M.city in
     * it's own static var the_cityval, and this is "yes".
     */
    log("---------webservlet2-------");
    TestWebServlet2.MyApp flow = TestWebServlet2.createApp();
    TrailWrapper wrap1 = new TrailWrapper(flow);
   
    String path = String.format("tmpfiles\\sr_3.out");
    persistentStartIt(wrap1, path);
   
    SRInstance run = persistentProceed(path, "");
    TrailWrapper flow2w = (TrailWrapper)run.ApplicationFlow();
    TestWebServlet2.MyApp flow2 = (TestWebServlet2.MyApp)flow2w.innerFlow();
   
    persistentProceed(path, "");
    log("--xxx--");
    persistentProceedSlot(path, "yes", "confirm");
//    assertEquals("city", "yes", flow2.M.city().get());
    assertEquals("city", "yes", TestWebServlet2.PFlow.the_cityval);
    persistentProceed(path, "");
    run = persistentProceed(path, SRResults.ResultCode.DISCONNECT);
    assertEquals("fail", false, run.isFailed());
    assertEquals("fin", true, run.isFinished());
    assertEquals("start", true, run.isStarted());
   
    ChkTrail(run, "PFlow;PFlow;QuestionFlow;PFlow");
    flow2w = (TrailWrapper)run.ApplicationFlow();
    flow2 = (TestWebServlet2.MyApp)flow2w.innerFlow();
    assertEquals("city", "yes", flow2.M.city().get());
    log("---------end webservlet2-------");
  }
View Full Code Here

   
  }
  @Test public void Start()
  {
    MyFlow flow = new MyFlow("a");
    TrailWrapper wrap1 = new TrailWrapper(flow);
   
    SRInstance run = new SRInstance();
    run.locations().setProjectDir(dir);
    assertEquals("", false, run.isFailed());
    assertEquals("", false, run.isFinished());
View Full Code Here

    ChkTrail(wrap1, "beg;F;E");
  }
  @Test public void Run1()
  {
    MyFlow flow = new MyFlow("a");
    TrailWrapper wrap1 = new TrailWrapper(flow);
   
    SRInstance run = new SRInstance();   
    run.locations().setProjectDir(dir);
    boolean b = run.start(wrap1);
    Assert.assertTrue(b);
View Full Code Here

  }
  @Test public void Run2()
  {
    MyFlow flow = new MyFlow("a");
    MyFlow flow2 = new MyFlow("b");
    TrailWrapper wrap1 = new TrailWrapper(flow);
    TrailWrapper wrap2 = new TrailWrapper(flow2);
    Flow2Wrapper outer = new Flow2Wrapper("outer", wrap1, wrap2);
    TrailWrapper wrap3 = new TrailWrapper(outer);
   
    SRInstance run = RunIt(wrap3);   
    assertEquals("fail", false, run.isFailed());
    assertEquals("fin", true, run.isFinished());
    assertEquals("start", true, run.isStarted());
View Full Code Here

  @Test public void ExitFlow()
  {
    MyFlow flow = new MyFlow("a");
    MyFlow flow2 = new MyFlow("b");
    flow2.m_exitInGetNext = true;
    TrailWrapper wrap1 = new TrailWrapper(flow);
    TrailWrapper wrap2 = new TrailWrapper(flow2);
   
    Flow2Wrapper flowBoth = new Flow2Wrapper("wrap", wrap1, wrap2);
    TrailWrapper wrap3 = new TrailWrapper(flowBoth);
 
    SRInstance run = RunIt(wrap3);   
    ChkTrail(run, "a;b");
    ChkTrail(wrap1, "beg;F;E;N;T;end");
    ChkTrail(wrap2, "beg;F;E;N;end");
View Full Code Here

  }
  @Test public void Disconnect()
  {
    MyFlow flow = new MyFlow("a");
    MyFlow flow2 = new MyFlow("b");
    TrailWrapper wrap1 = new TrailWrapper(flow);
    TrailWrapper wrap2 = new TrailWrapper(flow2);
   
    Flow2Wrapper flowBoth = new Flow2Wrapper("wrap", wrap1, wrap2);
    TrailWrapper wrap3 = new TrailWrapper(flowBoth);
 
    SRInstance run = RunSpecial(wrap3, wrap2, SRResults.ResultCode.DISCONNECT);
    ChkTrail(run, "a;b");
    ChkTrail(wrap1, "beg;F;E;N;T;end");
    ChkTrail(wrap2, "beg;F;E;end");
View Full Code Here

  @Test public void NoInput()
  {
    MyFlow flow = new MyFlow("a");
    flow.m_handleNoInput = true;
    MyFlow flow2 = new MyFlow("b");
    TrailWrapper wrap1 = new TrailWrapper(flow);
    TrailWrapper wrap2 = new TrailWrapper(flow2);
   
    Flow2Wrapper flowBoth = new Flow2Wrapper("wrap", wrap1, wrap2);
    TrailWrapper wrap3 = new TrailWrapper(flowBoth);
 
    SRInstance run = RunSpecial(wrap3, wrap1, SRResults.ResultCode.NOINPUT);
    ChkTrail(run, "a");
    ChkTrail(wrap1, "beg;F;E;NOINPUT;end");
    ChkTrail(wrap2, "");
View Full Code Here

  @Test public void Throw()
  {
    MyFlow flow = new MyFlow("a");
    flow.m_throwInGetNext = true;
    MyFlow flow2 = new MyFlow("b");
    TrailWrapper wrap1 = new TrailWrapper(flow);
    TrailWrapper wrap2 = new TrailWrapper(flow2);
   
    Flow2Wrapper flowBoth = new Flow2Wrapper("wrapthrow", wrap1, wrap2);
    TrailWrapper wrap3 = new TrailWrapper(flowBoth);
 
    SRInstance run = RunIt(wrap3);
    ChkTrail(run, "a");
    ChkTrail(wrap1, "beg;F;E;N;end");
    ChkTrail(wrap2, "");
View Full Code Here

  @Test public void ThrowInExecute()
  {
    MyFlow flow = new MyFlow("a");
    flow.m_throwInExecute = true;
    MyFlow flow2 = new MyFlow("b");
    TrailWrapper wrap1 = new TrailWrapper(flow);
    TrailWrapper wrap2 = new TrailWrapper(flow2);
   
    Flow2Wrapper flowBoth = new Flow2Wrapper("wrapthrow", wrap1, wrap2);
    TrailWrapper wrap3 = new TrailWrapper(flowBoth);
 
    SRInstance run = RunIt(wrap3);
    ChkTrail(run, "a");
    ChkTrail(wrap1, "beg;F;E;end");
    ChkTrail(wrap2, "");
View Full Code Here

TOP

Related Classes of org.speakright.core.TrailWrapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.