Package org.speakright.core

Examples of org.speakright.core.TrailWrapper


  /**
   * test that a flow object can re-order the NBest results (in validateInput).
   */
  @Test public void testReorderNoConfirm()
  {
    TrailWrapper wrap1 = createApp(false);
   
    SRInstance run = StartIt(wrap1);
    Proceed(run, "");
    Proceed(run, createNBestResults("austin|||boston")); //nbest results with 'austin' as top result
    Proceed(run, "");
View Full Code Here


  }

  @Test public void testConfirmNoYes()
  {
    log("---- testConfirmNoYes ---");
    TrailWrapper wrap1 = createApp(true);
   
    SRInstance run = StartIt(wrap1);
    Proceed(run, "");
    Proceed(run, createNBestResults("austin|||boston")); //nbest results with 'austin' as top result
    Proceed(run, "no")//reject austin
View Full Code Here

  }
 
  @Test public void testConfirmYes()
  {
    log("---- testConfirmYes ---");
    TrailWrapper wrap1 = createApp(true);
   
    SRInstance run = StartIt(wrap1);
    Proceed(run, "");
    Proceed(run, createNBestResults("austin|||boston")); //nbest results with 'austin' as top result
    Proceed(run, "yes"); //accept austin
View Full Code Here

  }
 
  @Test public void testConfirmNoNo()
  {
    log("---- testConfirmNoNo ---");
    TrailWrapper wrap1 = createApp(true);
   
    SRInstance run = StartIt(wrap1);
    Proceed(run, "");
    Proceed(run, createNBestResults("austin|||boston")); //nbest results with 'austin' as top result
    Proceed(run, "no")//reject austin
View Full Code Here

  }

  @Test public void testConfirmNoNBest()
  {
    log("---- testConfirmNoNBest ---");
    TrailWrapper wrap1 = createApp(true);
   
    SRInstance run = StartIt(wrap1);
    Proceed(run, "");
    Proceed(run, "boston", "slot1", 100); //just because we enable nbest doesn't mean we'll get it!
    Proceed(run, "");
View Full Code Here

  }
 
  @Test public void testSkipList()
  {
    log("---- testSkipList ---");
    TrailWrapper wrap1 = createApp(true, true);
   
    SRInstance run = StartIt(wrap1);
    Proceed(run, "");
    Proceed(run, createNBestResults("austin|||boston")); //nbest results with 'austin' as top result
    Proceed(run, "no")//reject austin
View Full Code Here

      CityQuestion quest = new CityQuestion(false);
      flow.add(quest);
    }

    flow.add(new PromptFlow("I heard {$M.City}"));
    TrailWrapper wrap1 = new TrailWrapper(flow);
    return wrap1;   
  }
View Full Code Here

  }

  @Test public void realSimple()
  {
    App1 flow = new App1();
    TrailWrapper wrap1 = new TrailWrapper(flow);
   
    //SRInstance run = StartIt(wrap1);
    StartIt(wrap1);

    String sv = save(wrap1);
    TrailWrapper ww = (TrailWrapper)read(sv);
    String ss = ww.m_trail.toString();
    assertEquals("serializedtrail", "beg;F", ss);
  }
View Full Code Here

  }
 
  @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");
View Full Code Here

  @Test public void SerializeRun2()
  {
    log("---------serial2-------");
    App1 flow = new App1();
    TrailWrapper wrap1 = new TrailWrapper(flow);
   
   
    String path = String.format("tmpfiles\\sr_2.out");
    persistentStartIt(wrap1, path);
   
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.