コード例 #1
0
  @Override
  public Result getResultThresholdNumber(
      XUnitLog log,
      AbstractBuild<?, ?> build,
      TestResultAction testResultAction,
      TestResultAction previousTestResultAction) {

    int failedCount = testResultAction.getFailCount();

    int previousFailedCount = 0;
    if (previousTestResultAction != null) {
      previousFailedCount = previousTestResultAction.getFailCount();
    }
    int newFailedCount = failedCount - previousFailedCount;

    return getResultThresholdNumber(log, failedCount, newFailedCount);
  }
コード例 #2
0
  @Override
  public Result getResultThresholdPercent(
      XUnitLog log,
      AbstractBuild<?, ?> build,
      TestResultAction testResultAction,
      TestResultAction previousTestResultAction) {

    double count = testResultAction.getTotalCount();

    double failedCount = testResultAction.getFailCount();
    double percentFailed = (failedCount / count) * 100;

    double previousFailedCount = 0;
    if (previousTestResultAction != null) {
      previousFailedCount = previousTestResultAction.getFailCount();
    }
    double newFailedCount = failedCount - previousFailedCount;
    double percentNewFailed = (newFailedCount / count) * 100;

    return getResultThresholdPercent(log, percentFailed, percentNewFailed);
  }