Package org.ngrinder.operation.cotroller

Examples of org.ngrinder.operation.cotroller.ScriptConsoleController.run()


  @Test
  public void runScriptTest() {
    ScriptConsoleController scriptController = new ScriptConsoleController();

    Model model = new ExtendedModelMap();
    scriptController.run("", model);
    assertThat((String) model.asMap().get("result"), nullValue());
    String command = "print \'hello\'";
    scriptController.run(command, model);
    assertThat(model.containsAttribute("result"), is(true));
    assertThat((String) model.asMap().get("result"), containsString("hello"));
View Full Code Here


    Model model = new ExtendedModelMap();
    scriptController.run("", model);
    assertThat((String) model.asMap().get("result"), nullValue());
    String command = "print \'hello\'";
    scriptController.run(command, model);
    assertThat(model.containsAttribute("result"), is(true));
    assertThat((String) model.asMap().get("result"), containsString("hello"));

    scriptController.run("var a = 1", model);
    scriptController.run("print a", model);
View Full Code Here

    String command = "print \'hello\'";
    scriptController.run(command, model);
    assertThat(model.containsAttribute("result"), is(true));
    assertThat((String) model.asMap().get("result"), containsString("hello"));

    scriptController.run("var a = 1", model);
    scriptController.run("print a", model);
    assertThat((String) model.asMap().get("result"), containsString("No such property"));

  }
}
View Full Code Here

    scriptController.run(command, model);
    assertThat(model.containsAttribute("result"), is(true));
    assertThat((String) model.asMap().get("result"), containsString("hello"));

    scriptController.run("var a = 1", model);
    scriptController.run("print a", model);
    assertThat((String) model.asMap().get("result"), containsString("No such property"));

  }
}
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.