Package net.sf.sahi.session

Examples of net.sf.sahi.session.Status


    Session session = request.session();
    final SahiTestSuite suite = session.getSuite();
    String initJS = request.getParameter("initJS");
    System.out.println("Setting initJS" + initJS);
    suite.setInitJS(initJS);
    Status status = suite.executeTestForSingleSession(request.getParameter("testName"), request.getParameter("startURL"));
    return new SimpleHttpResponse(status.getName());
  }
View Full Code Here


        }
    }

    public HttpResponse status(final HttpRequest request) {
        Session session = request.session();
        Status status = session.getStatus();
        if (status == null) status = Status.FAILURE;
        return new NoCacheHttpResponse(status.getName());
    }
View Full Code Here

    if (scriptRunner == null){
      return new SimpleHttpResponse("error:Playback session not started. Verify that proxy is set on the browser.");
    }
    boolean done = scriptRunner.doneStep(""|| scriptRunner.isStopped();
    if (done){
      Status status = scriptRunner.getStatus();
      String browserException = scriptRunner.getBrowserException();
      if (browserException == null) browserException = "";
      if (status == Status.ERROR){
        return new SimpleHttpResponse("error:" +  browserException);
      } else if (status == Status.FAILURE) {
View Full Code Here

  public String getSuiteName(){
    return this.suiteName;
  }

  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()) {
View Full Code Here

    while (keys.hasNext()) {
      String sessionId = (String) keys.next();
      Session session = Session.getExistingInstance(sessionId);
      if (session == null) continue;
      long lastActiveTime = session.lastActiveTime();
      Status status = session.getStatus();
      if (status != Status.SUCCESS && status != Status.FAILURE
          && status != Status.INITIAL
          && now - lastActiveTime > inactivityLimit) {
        String message = "*** Forcefully terminating script. \nNo response from browser within expected time ("
            + inactivityLimit / 1000 + " seconds).";
View Full Code Here

TOP

Related Classes of net.sf.sahi.session.Status

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.