Package org.ngrinder.operation.cotroller

Examples of org.ngrinder.operation.cotroller.ScriptConsoleController


public class ScriptConsoleControllerTest extends AbstractNGrinderTransactionalTest {

  @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"));

    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

Related Classes of org.ngrinder.operation.cotroller.ScriptConsoleController

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.