Package net.ex337.scriptus.tests

Examples of net.ex337.scriptus.tests.JsTest


   
  }

  public void test_say() throws IOException {

    ScriptProcess p = datastore.newProcess(TEST_USER, "say.js", false, "", "owner", TransportType.Dummy);
   
    ScriptAction r = p.call();
   
    assertTrue("Said correctly", r instanceof Say);
    assertTrue("Said correctly to user", ((Say)r).getWho().equals("foo"));
    assertTrue("Said correctly message", ((Say)r).getMsg().equals("message"));
   
    p.save();
   
    r.visit(new ScriptusFacade(datastore, c, m, conf), p);
  }
View Full Code Here


    r.visit(new ScriptusFacade(datastore, c, m, conf), p);
  }

  public void test_defaultSay() throws IOException {

    ScriptProcess p = datastore.newProcess(TEST_USER, "defaultSay.js", false, "", "owner", TransportType.Dummy);
   
    ScriptAction r = p.call();
   
    assertTrue("Said correctly", r instanceof Say);
    assertNull("Said to owner correctly", ((Say)r).getWho());

  }
View Full Code Here

  }

  public void test_listen() throws IOException {

    ScriptProcess p = datastore.newProcess(TEST_USER, "listen.js", false, "", "owner", TransportType.Dummy);
   
    ScriptAction r = p.call();
   
    assertTrue("Listened correctly", r instanceof Listen);
    assertTrue("Listened correctly to", ((Listen)r).getWho().equals("foo"));
   
    p.save();
   
    r.visit(new ScriptusFacade(datastore, c, m, conf), p);
  }
View Full Code Here

    r.visit(new ScriptusFacade(datastore, c, m, conf), p);
  }

  public void test_defaultListen() throws IOException {

    ScriptProcess p = datastore.newProcess(TEST_USER, "defaultListen.js", false, "", "owner", TransportType.Dummy);
   
    ScriptAction r = p.call();
   
    assertTrue("Listened correctly", r instanceof Listen);
    assertNull("Listened correctly to", ((Listen)r).getWho());
   
    p.save();
   
    r.visit(new ScriptusFacade(datastore, c, m, conf), p);
  }
View Full Code Here

    r.visit(new ScriptusFacade(datastore, c, m, conf), p);
  }

  public void test_evalBroken() throws IOException {
   
    ScriptProcess p = datastore.newProcess(TEST_USER, "evalBroken.js", false, "", "owner", TransportType.Dummy);
   
    ScriptAction r = p.call();
   
    assertTrue("Broken", r instanceof ErrorTermination);
  }
View Full Code Here

    assertTrue("Broken", r instanceof ErrorTermination);
  }

  public void test_eval() throws IOException {
   
    ScriptProcess p = datastore.newProcess(TEST_USER, "eval.js", false, "", "owner", TransportType.Dummy);
   
    ScriptAction r = p.call();
   
    assertTrue("Listened correctly", r instanceof Listen);

    p.save();

    r.visit(new ScriptusFacade(datastore, c, m, conf), p);
  }
View Full Code Here

//    ((DummyTransport)m).defaultResponse = "response";
//  }

  public void test_breakSecurity() throws IOException {
   
    ScriptProcess p = datastore.newProcess(TEST_USER, "breakSec.js", false, "", "owner", TransportType.Dummy);
   
    p.save();
   
    ScriptAction r = p.call();
   
    assertTrue("Failed correctly", r instanceof ErrorTermination);
   
    System.out.println(((ErrorTermination)r).getError());
   
View Full Code Here

    r.visit(new ScriptusFacade(datastore, c, m, conf), p);
  }

  public void test_breakSecurity2() throws IOException {
   
    ScriptProcess p = datastore.newProcess(TEST_USER, "breakSec2.js", false, "", "owner", TransportType.Dummy);

    p.save();

    ScriptAction r = p.call();
   
    assertTrue("Failed correctly", r instanceof ErrorTermination);
   
    System.out.println(((ErrorTermination)r).getError());
   
View Full Code Here

    r.visit(new ScriptusFacade(datastore, c, m, conf), p);
  }

  public void test_breakSecurity3() throws IOException {
   
    ScriptProcess p = datastore.newProcess(TEST_USER, "breakSec3.js", false, "", "owner", TransportType.Dummy);
   
        p.save();
       
    ScriptAction r = p.call();
   
    assertTrue("Failed correctly", r instanceof ErrorTermination);
   
    System.out.println(((ErrorTermination)r).getError());
   
View Full Code Here

    r.visit(new ScriptusFacade(datastore, c, m, conf), p);
  }

  public void test_breakSecurity4() throws IOException {
   
    ScriptProcess p = datastore.newProcess(TEST_USER, "breakSec4.js", false, "", "owner", TransportType.Dummy);
   
        p.save();
       
    ScriptAction r = p.call();
   
    assertEquals("Failed correctly", ErrorTermination.class, r.getClass());
   
    System.out.println(((ErrorTermination)r).getError());
   
View Full Code Here

TOP

Related Classes of net.ex337.scriptus.tests.JsTest

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.