Package net.sf.sahi.rhino

Examples of net.sf.sahi.rhino.RhinoScriptRunner


    String[] fileList = ScriptUtil.getScriptFiles(dir);
    return new NoCacheHttpResponse(Utils.toJSON(fileList));
  }

    private String getScriptPath(final Session session) {
        RhinoScriptRunner scriptRunner = (RhinoScriptRunner) session.getScriptRunner();
        if (scriptRunner == null) return "";
        SahiScript script = scriptRunner.getScript();
    if (script == null) {
            return "";
        }
        return Utils.escapeDoubleQuotesAndBackSlashes(script.getFilePath());
    }
View Full Code Here


    protected void writeTestSummary(List<TestLauncher> origtests) throws IOException {
      List<TestLauncher> tests = new ArrayList<TestLauncher>(origtests);
        for (Iterator<TestLauncher> iter = tests.iterator(); iter.hasNext();) {
            try {
                TestLauncher test = iter.next();
                RhinoScriptRunner scriptRunner = test.getScriptRunner();
                if (scriptRunner == null) {
                    continue;
                }
        Report report = scriptRunner.getReport();
                if (report == null) {
                    continue;
                }
                TestSummary summary = report.getTestSummary(scriptRunner.getLogFileNameBase());
                if (summary != null) {
                    summary.setAddLink(true);
                    suiteWriter.write(formatter.getSummaryData(summary));
                }
            } catch (Exception e) {
View Full Code Here

      stop(request);
      setScript(session, scriptPath);
    }
    private void setScript(Session session, String scriptPath){
        SahiScript script = new ScriptFactory().getScript(scriptPath);
        RhinoScriptRunner scriptRunner = new RhinoScriptRunner(script);
    session.setScriptRunner(scriptRunner);
        startPlayback(session, true, "1");
    }
View Full Code Here

                    "No Script has been set for playback.");
        }
    }

  private SahiScript getScript(Session session) {
    RhinoScriptRunner scriptRunner = (RhinoScriptRunner) session.getScriptRunner();
    return scriptRunner.getScript();
  }
View Full Code Here

        Session session = request.session();
        String fileName = request.getParameter("file");

        final String scriptFileWithPath;
        scriptFileWithPath = fileName;
        RhinoScriptRunner scriptRunner = new RhinoScriptRunner(new FileScript(scriptFileWithPath));
    session.setScriptRunner(scriptRunner);
    session.setIsPlaying(true);
        String startUrl = request.getParameter("startUrl");
        session.setIsWindowOpen(false);
        startPlayback(session, true, "0");
View Full Code Here

    this.execute(session, true, true);
  }
 
  public void execute(Session session, boolean async, boolean setDefaultReporters) throws Exception {
    System.out.println("#### Running Script: " + scriptName);
        scriptRunner = new RhinoScriptRunner(new ScriptFactory().getScript(scriptName), session.getSuite(), this, setDefaultReporters);
    session.setScriptRunner(scriptRunner);
        if (!isSingleSession) {
          launchBrowser();
        }
    if (async) scriptRunner.execute();
View Full Code Here

  private void markSuiteStatus() {
    Status status = finishedTests.size() > 0 ? Status.SUCCESS : Status.FAILURE;
    Session session;
    for (Iterator<TestLauncher> iterator = tests.iterator(); iterator.hasNext();) {
      TestLauncher testLauncher = (TestLauncher) iterator.next();
      RhinoScriptRunner scriptRunner = testLauncher.getScriptRunner();
      if (scriptRunner == null || scriptRunner.hasErrors()) {
        status = Status.FAILURE;
        break;
      }
    }
    session = Session.getInstance(this.sessionId);
View Full Code Here

        Session session = request.session();
        String toEval = request.getParameter("toEval");
        ScriptRunner scriptRunner = session.getScriptRunner();
        String result = "null";
        if (scriptRunner instanceof RhinoScriptRunner){
          RhinoScriptRunner rsr = (RhinoScriptRunner) session.getScriptRunner();
          toEval = SahiScript.modifyFunctionNames(toEval);
      result = rsr.eval(toEval);
        } else {
          logger.warning("Should not have come here: RhinoRuntime.eval: " + toEval);
        }
        return new NoCacheHttpResponse(result);
    }
View Full Code Here

TOP

Related Classes of net.sf.sahi.rhino.RhinoScriptRunner

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.