@PublicApi public class TaskResultBuilder extends Object
TaskType
s to produce a TaskResult
Modifier and Type | Method and Description |
---|---|
TaskResult |
build() |
TaskResultBuilder |
checkInterceptorMatches(ContentMatchingInterceptor interceptor,
int maximumAge) |
TaskResultBuilder |
checkInterceptorNotMatches(ContentMatchingInterceptor interceptor,
int maximumAge) |
TaskResultBuilder |
checkReturnCode(com.atlassian.utils.process.ExternalProcess externalProcess)
Checks that the return code of the
ExternalProcess was zero
Will only check return codes if the build state has not been set to Failed for some other reason. |
TaskResultBuilder |
checkReturnCode(com.atlassian.utils.process.ExternalProcess externalProcess,
int expectedReturnCode)
Checks that the return code of the
ExternalProcess was of the expected type. |
TaskResultBuilder |
checkTestFailures()
Checks whether any test failures have been recorded against the buildResult and updates the state accordingly
Will only check tests if the build state has not been set to Failed for some other reason.
|
static TaskResult |
copyWithNewState(TaskResult taskResult,
TaskState newTaskState)
Copies a taskResult and changes the state
|
static TaskResultBuilder |
create(TaskContext taskContext)
Deprecated.
since 5.0 use
newBuilder(CommonTaskContext) |
static TaskResult |
createFailedWithErrorResult(TaskIdentifier taskIdentifier)
Method to create error result bypassing the builder.
|
TaskResultBuilder |
failed()
Sets the Task Result Status as
TaskState.FAILED |
TaskResultBuilder |
failedWithError()
Sets the Task Result Status as
TaskState.ERROR |
TaskState |
getTaskState() |
static TaskResultBuilder |
newBuilder(CommonTaskContext taskContext)
Creates a new TaskResultBuilder for a
CommonTaskContext |
TaskResultBuilder |
setState(TaskState taskState) |
TaskResultBuilder |
success()
Sets the Task Result Status as
TaskState.SUCCESS |
public static TaskResultBuilder newBuilder(@NotNull CommonTaskContext taskContext)
CommonTaskContext
taskContext
- of the executing TaskType
@Deprecated public static TaskResultBuilder create(@NotNull TaskContext taskContext)
newBuilder(CommonTaskContext)
CommonTaskContext
taskContext
- of the executing TaskType
public static TaskResult copyWithNewState(@NotNull TaskResult taskResult, @NotNull TaskState newTaskState)
taskResult
- to copynewTaskState
- to replace the old taskStatepublic static TaskResult createFailedWithErrorResult(TaskIdentifier taskIdentifier)
taskIdentifier
- identifying the task that failedpublic TaskResultBuilder success()
TaskState.SUCCESS
public TaskResultBuilder failed()
TaskState.FAILED
public TaskResultBuilder failedWithError()
TaskState.ERROR
public TaskResultBuilder checkReturnCode(@NotNull com.atlassian.utils.process.ExternalProcess externalProcess)
ExternalProcess
was zero
Will only check return codes if the build state has not been set to Failed for some other reason.externalProcess
- - to check return code ofpublic TaskResultBuilder checkReturnCode(@NotNull com.atlassian.utils.process.ExternalProcess externalProcess, int expectedReturnCode)
ExternalProcess
was of the expected type.
Will only check return codes if the build state has not been set to Failed for some other reason.externalProcess
- - process to check return code fromexpectedReturnCode-
- the return code to be considered a success.public TaskResultBuilder checkTestFailures()
public TaskResultBuilder checkInterceptorMatches(@NotNull ContentMatchingInterceptor interceptor, int maximumAge)
public TaskResultBuilder checkInterceptorNotMatches(@NotNull ContentMatchingInterceptor interceptor, int maximumAge)
public TaskResult build()
public TaskState getTaskState()
public TaskResultBuilder setState(TaskState taskState)
Copyright © 2017 Atlassian Software Systems Pty Ltd. All rights reserved.