コード例 #1
0
  @Exported(name = "status", visibility = 9)
  // because stapler notices suffix 's' and remove it
  public Status getStatus() {
    if (isSkipped()) {
      return Status.SKIPPED;
    }
    JUnitTestInfo junitTestInfo = getPreviousTestInfo();
    if (junitTestInfo == null) {
      return isPassed() ? Status.PASSED : Status.FAILED;
    }

    if (junitTestInfo.getStatus() == JUnitTestInfo.STATUS_SUCCESS) {
      return isPassed() ? Status.PASSED : Status.REGRESSION;
    } else {
      return isPassed() ? Status.FIXED : Status.FAILED;
    }
  }
コード例 #2
0
 /**
  * Tests whether the test was skipped or not. TestNG allows tests to be skipped if their
  * dependencies fail or they are part of a group that has been configured to be skipped.
  *
  * @return true if the test was not executed, false otherwise.
  */
 @Exported(visibility = 9)
 public boolean isSkipped() {
   return testInfo.getStatus() == JUnitTestInfo.STATUS_SKIP;
 }
コード例 #3
0
 /** @return true if the test was not skipped and did not fail, false otherwise. */
 @Override
 public boolean isPassed() {
   return testInfo.getStatus() == JUnitTestInfo.STATUS_SUCCESS;
 }