Returns a an ExecutionResult with the {@code failure} set, {@code completed} true and {@code success} false.
493520
public static ExecutionResult failure(Throwable failure) {
    return new ExecutionResult(null, failure, false, 0, true, false, false);
  }
770896
public static boolean isSuccess(ModelNode operationResult) {
        if (operationResult != null) {
            return operationResult.hasDefined(OUTCOME)
                && operationResult.get(OUTCOME).asString().equals(OUTCOME_SUCCESS);
        }
        return false;
    }
675104
@Override
    public String getResult() {
        final List<String> result = new ArrayList<>();
        for (final Value t: value) {
            final String token = t.value.trim();
            // Pieces which are surrounded with braces are extension points.
            if (token.startsWith("{") && token.endsWith("}")) {
                final String extension = token.substring(1, token.length() - 1);
                final String extensionInputs = Integrator.getValue(featureTable, extension);
                if (extensionInputs != null) {
                    result.add(extensionInputs);
                }
            } else {
                result.add(token);
            }
        }
        if (!result.isEmpty()) {
            return StringUtils.join(result, ",");
        } else {
            return "";
        }
    }
426111
@Override
	public Status execute () {
		return GdxAI.getTimepiece().getTime() - startTime < timeout ? Status.RUNNING : Status.SUCCEEDED;
	}
1139321
public function getFailedResults(): ResultCollection
    {
        $failedResults = array_filter($this->results, function (Result $result) {
            return $result->isFailed();
        });

        return new self(...$failedResults);
    }
37887
protected void success(T result) {
    this.result = result;
    this.completed = true;
    for (Callback<T, E> callback : toBeNotified) {
      callback.success(result);
    }
  }
1032807
synchronized void result(@Nullable T res) {
        if (isFinished) {
            throw new RuntimeException("Promise " + this + " already completed!");
        }
        isFinished = true;
        result = res;
        deliverResult();
    }
462107
protected boolean isFailure(ExecutionResult result) {
    if (result.isNonResult())
      return false;
    else if (policy instanceof FailurePolicy)
      return ((FailurePolicy) policy).isFailure(result);
    else
      return result.getFailure() != null;
  }
555334
public static <T> Result<T> failed(String msg) {
        return Result.<T>builder().success(false).msg(msg).build();
    }
522298
protected <T> TypedResult<T> handleMissingResult() {
		// check if the monitoring thread is still there
		// we need to wait until we know what is going on
		if (monitoringThread.isAlive()) {
			return TypedResult.empty();
		}
		// the job finished with an exception
		else if (executionException != null) {
			throw executionException;
		}
		// we assume that a bounded job finished
		else {
			return TypedResult.endOfStream();
		}
	}
503045
private void complete(T result, Throwable error) {
    synchronized (orderedFutures) {
      this.result = result;
      this.error = error;
      this.complete = true;
      if (error == null) {
        for (CompletableFuture<T> future : orderedFutures) {
          future.complete(result);
        }
      } else {
        for (CompletableFuture<T> future : orderedFutures) {
          future.completeExceptionally(error);
        }
      }
      orderedFutures.clear();
    }
  }
579371
public static <T> Result<T> successful(T data) {
        return Result.<T>builder().success(true).data(data).build();
    }
733855
public Object initResult()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
	  SibTr.entry(tc, "initResult");  	

    Set theResults = new HashSet();
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
	  SibTr.exit(tc, "initResult");
    return theResults;
  }
1245563
public static <R> MethodResult<R> success(R result) {
        return new MethodResult<>(result, null, false);
    }
140540
public boolean waitForCompletion() {
        try {
            return completed.get();
        } catch (InterruptedException | ExecutionException e) {
            log.warn("Failed to wait for server completion", e);
        }

        return false;
    }
1087988
@Override
    public void doExecute() throws MojoExecutionException, MojoFailureException {
        if (!ignoreResultFailures && !scanResultsForFailedRequests) {
            getLog().warn(String.format(
                    "current value of scanResultsForFailedRequests(%s) is incompatible with ignoreResultFailures(%s), setting scanResultsForFailedRequests to true",
                    scanResultsForFailedRequests,
                    ignoreResultFailures
            ));
            scanResultsForFailedRequests = true;
        }
        if (scanResultsForSuccessfulRequests || scanResultsForFailedRequests) {
            getLog().info(" ");
            getLog().info(LINE_SEPARATOR);
            getLog().info("S C A N N I N G    F O R    R E S U L T S");
            getLog().info(LINE_SEPARATOR);
            getLog().info(" ");
            TestConfig testConfig = new TestConfig(new File(testConfigFile));
            String resultFormat = testConfig.getResultsOutputIsCSVFormat() ? "CSV" : "JTL";
            getLog().info(String.format("Will scan results using format: %s", resultFormat));
            ResultScanner resultScanner = new ResultScanner(
                    scanResultsForSuccessfulRequests,
                    scanResultsForFailedRequests,
                    testConfig.getResultsOutputIsCSVFormat()
            );
            for (String resultFileLocation : testConfig.getResultsFileLocations()) {
                resultScanner.parseResultFile(new File(resultFileLocation));
            }
            getLog().info(" ");
            getLog().info(LINE_SEPARATOR);
            getLog().info("P E R F O R M A N C E    T E S T    R E S U L T S");
            getLog().info(LINE_SEPARATOR);
            getLog().info(" ");
            getLog().info(String.format("Result (.%s) files scanned: %s", resultFormat.toLowerCase(), testConfig.getResultsFileLocations().size()));
            getLog().info(String.format("Successful requests:         %s", resultScanner.getSuccessCount()));
            getLog().info(String.format("Failed requests:             %s", resultScanner.getFailureCount()));
            TestFailureDecider decider = new TestFailureDecider(ignoreResultFailures, errorRateThresholdInPercent, resultScanner);
            decider.runChecks();
            getLog().info(String.format("Failures:                    %s%% (%s%% accepted)", decider.getErrorPercentage(), decider.getErrorPercentageThreshold()));
            getLog().info(" ");
            if (decider.failBuild()) {
                throw new MojoFailureException(String.format(
                        "Failing build because error percentage %s is above accepted threshold %s. JMeter logs are available at: '%s'",
                        logsDirectory.getAbsolutePath(),
                        decider.getErrorPercentage(),
                        decider.getErrorPercentageThreshold()
                ));
            }
        } else {
            getLog().info(" ");
            getLog().info("Results of Performance Test(s) have not been scanned.");
            getLog().info(" ");
        }
    }
1329709
public ExecutionResult withComplete() {
    return this.complete ? this : new ExecutionResult(result, failure, nonResult, waitNanos, true, success, successAll);
  }