Package net.ex337.scriptus.model

Examples of net.ex337.scriptus.model.ScriptProcess.call()


 
  public void test_forkNoPrefix() throws IOException {
   
    ScriptProcess p = datastore.newProcess(TEST_USER, "forkNoPrefix.js", false, "", "owner", TransportType.Dummy);
   
    ScriptAction r = p.call();
   
    assertTrue("Forked correctly", r instanceof Fork);
   
    r.visit(new ScriptusFacade(datastore, c, m, conf), p);
View Full Code Here


 
  public void test_exit() throws IOException {
   
    ScriptProcess p = datastore.newProcess(TEST_USER, "exit.js", false, "", "owner", TransportType.Dummy);
   
    ScriptAction r = p.call();
   
    assertTrue("Exited correctly", r instanceof NormalTermination);
    assertTrue("correct exit", ((NormalTermination)r).getResult().equals("result"));

  }
View Full Code Here

  public void test_exec() throws IOException {
   
    final ScriptProcess p = datastore.newProcess(TEST_USER, "exec.js", false, "ags", "owner", TransportType.Dummy);
   
    ScriptAction r = p.call();
   
    p.save();
   
    assertTrue("Exec correctly", r instanceof Exec);
    assertEquals("Exec good program", "returnArg.js", ((Exec)r).getScript());
View Full Code Here

       
        assertEquals("good pid", p.getPid(), pid);
        assertEquals("good source", "returnArg.js", pp.getSourceName());
        assertEquals("good args", "arg1 arg2", pp.getArgs());
       
        ScriptAction aa = pp.call();
       
        assertEquals("good class result", NormalTermination.class, aa.getClass());
        assertEquals("goood result", "resultarg1 arg2", ((NormalTermination)aa).getResult());
      }
     
View Full Code Here

  public void test_sleepHour() throws IOException {
   
    ScriptProcess p = datastore.newProcess(TEST_USER, "sleepHour.js", false, "", "owner", TransportType.Dummy);
   
    ScriptAction r = p.call();
   
    assertTrue("slept correctly", r instanceof Sleep);

  }
View Full Code Here

  public void test_getHttp() throws IOException {
   
    ScriptProcess p = datastore.newProcess(TEST_USER, "getHttp.js", false, "", "owner", TransportType.Dummy);
   
    ScriptAction r = p.call();
   
    assertTrue("slept correctly", r instanceof Get);

    p.save();
View Full Code Here

  public void test_evalGet() throws IOException {
   
    ScriptProcess p = datastore.newProcess(TEST_USER, "evalget.js", false, "", "owner", TransportType.Dummy);
   
    ScriptAction r = p.call();
   
    assertTrue("slept correctly", r instanceof Get);

    p.save();
View Full Code Here

   
    p = datastore.getProcess(p.getPid());
   
    assertTrue("got content", p.getState() instanceof String);
   
    r = p.call();
   
    assertTrue("said correctly", r instanceof Say);
   
    assertTrue("contains fn def", ((Say)r).getMsg().contains("return new Date().clearTime();"));
  }
View Full Code Here

  public void test_evalGetBug() throws IOException {
   
    ScriptProcess p = datastore.newProcess(TEST_USER, "evalgetBUG.js", false, "", "owner", TransportType.Dummy);
   
    ScriptAction r = p.call();
   
    assertTrue("slept correctly", r instanceof Get);

    p.save();
View Full Code Here

   
    p = datastore.getProcess(p.getPid());
   
    assertTrue("got content", p.getState() instanceof String);
   
    r = p.call();
   
    assertTrue("said correctly", r instanceof Say);
   
    assertTrue("contains fn def", ((Say)r).getMsg().contains("return new Date().clearTime();"));
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.