Пример #1
0
 public void finish() {
   if (currentTest != null && testNGResults != null) {
     final TestProxy failedToStart = testNGResults.getFailedToStart();
     if (failedToStart != null) {
       currentTest.addChild(failedToStart);
       currentTest.setTearDownFailure(true);
       testNGResults.setFailedToStart(null);
     }
   }
   currentTest = null;
 }
Пример #2
0
  public void addTestResult(TestResultMessage result) {
    if (testNGResults != null) {
      int exceptionMark = myExceptionalMark == -1 ? 0 : myExceptionalMark;

      if (currentTest != null) {
        final String stackTrace = result.getStackTrace();
        if (stackTrace != null && stackTrace.length() > 10) {
          exceptionMark = currentTest.getCurrentSize();
          // trim useless crud from stacktrace
          currentTest.appendStacktrace(result);
        }
        final TestProxy failedToStart = testNGResults.getFailedToStart();
        if (failedToStart != null) {
          currentTest.addChild(failedToStart);
        }
      }
      testNGResults.addTestResult(result, exceptionMark);
      myExceptionalMark = -1;
    }
  }