示例#1
0
 @Ignore("for performance testing purpose")
 @Test
 public void testPerf() throws ScriptException, OperationException {
   long start = System.currentTimeMillis();
   for (int i = 0; i < 500; i++) {
     scriptingService.run(scriptingService.getJSWrapper(), session);
   }
   long end = System.currentTimeMillis();
   System.err.println("DEBUG: Logic A toke " + (end - start) + " " + "MilliSeconds");
 }
示例#2
0
  @Test
  public void serviceShouldBeDeclared() throws Exception {
    ScriptEngineManager engineManager = new ScriptEngineManager();
    ScriptEngine engine =
        engineManager.getEngineByName(AutomationScriptingConstants.NASHORN_ENGINE);
    assertNotNull(engine);

    InputStream stream = this.getClass().getResourceAsStream("/checkWrapper.js");
    assertNotNull(stream);
    engine.eval(scriptingService.getJSWrapper());
    engine.eval(IOUtils.toString(stream));
    assertEquals("Hello" + System.lineSeparator(), outContent.toString());
  }