Exemplo n.º 1
0
 /** Close the context. */
 public void close() {
   try {
     ((Context) cx).exit();
   } catch (Exception e) {
     suite.passed = false;
     file.passed = false;
     file.exception = "file failed with exception:  " + e;
   }
 }
Exemplo n.º 2
0
  /**
   * Creates the JavaScript Context, which evaluates the contents of a RhinoFile and returns a
   * result. The RhinoEnv parses the test result, and sets values of the RhinoFile test result
   * properties.
   *
   * @see com.netscape.javascript.Context#setOptimizationLevel
   * @see com.netscape.javascript.Context#setDebugLevel
   */
  public synchronized void runTest() {
    this.driver.p(file.name);
    try {
      cx = createContext();
      ((Context) cx).setOptimizationLevel(driver.OPT_LEVEL);
      ((Context) cx).setDebugLevel(driver.DEBUG_LEVEL);
      Object loadFn = executeTestFile(driver.HELPER_FUNCTIONS.getAbsolutePath());

      file.startTime = driver.getCurrentTime();
      result = executeTestFile(file.filePath);
      file.endTime = driver.getCurrentTime();
      parseResult();

    } catch (Exception e) {
      suite.passed = false;
      file.passed = false;
      file.exception += "file failed with exception:  " + e;
    }
  }