Class ExecuteTaskHelper
Object
ExecuteTaskHelper
Executes a task on a single-input outputting into a specific directory.
- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionCreate so that all outputs occur, and with defaultTaskArguments.ExecuteTaskHelper(boolean copyNonIdentical) Create so that all outputs occur, and with defaultTaskArguments.ExecuteTaskHelper(Optional<String> specificOutput, TaskArguments taskArguments, boolean copyNonIdentical) Create with specific arguments, not necessarily the defaults. -
Method Summary
Modifier and TypeMethodDescription<T extends InputFromManager,S, V extends Task<T, S>>
voidassertExpectedTaskOutputs(List<T> inputs, V task, Path pathDirectoryOutput, String pathDirectorySaved, Iterable<String> pathsFileToCompare) Executes a task on a multiple inputs and asserts expected outputs - with task arguments.<T extends InputFromManager,S, V extends Task<T, S>>
voidassertExpectedTaskOutputs(T input, V task, Path pathDirectoryOutput, String pathDirectorySaved, Iterable<String> pathsFileToCompare) Executes a task on a single-input.
-
Constructor Details
-
ExecuteTaskHelper
public ExecuteTaskHelper()Create so that all outputs occur, and with defaultTaskArguments. -
ExecuteTaskHelper
public ExecuteTaskHelper(boolean copyNonIdentical) Create so that all outputs occur, and with defaultTaskArguments.- Parameters:
copyNonIdentical- when true, and two files are not identical, the version in the output directory is copied into the resources directory.
-
ExecuteTaskHelper
public ExecuteTaskHelper(Optional<String> specificOutput, TaskArguments taskArguments, boolean copyNonIdentical) Create with specific arguments, not necessarily the defaults.- Parameters:
specificOutput- when defined, only this outputs are permitted to occur. Otherwise, all outputs occur as per defaults in the task.taskArguments- the arguments to use when executing the task.copyNonIdentical- when true, and two files are not identical, the version in the output directory is copied into the resources directory.
-
-
Method Details
-
assertExpectedTaskOutputs
public <T extends InputFromManager,S, void assertExpectedTaskOutputsV extends Task<T, S>> (T input, V task, Path pathDirectoryOutput, String pathDirectorySaved, Iterable<String> pathsFileToCompare) throws OperationFailedException Executes a task on a single-input.Expected outputs exist in a resources directory, and the produced outputs are compared against them, to check that they are identical.
- Type Parameters:
T- input typeS- shared-state typeV- task type- Parameters:
input- the input for the task.task- the task to run.pathDirectoryOutput- an absolute path to a directory where outputs of the task will be placed.pathDirectorySaved- a path (relative to thesrc/test/resources) to a directory of saved-results to compare with.pathsFileToCompare- paths (relative to thesrc/test/resources) to check that are identical.- Throws:
OperationFailedException- if anything goes wrong.
-
assertExpectedTaskOutputs
public <T extends InputFromManager,S, void assertExpectedTaskOutputsV extends Task<T, S>> (List<T> inputs, V task, Path pathDirectoryOutput, String pathDirectorySaved, Iterable<String> pathsFileToCompare) throws OperationFailedException Executes a task on a multiple inputs and asserts expected outputs - with task arguments.Expected outputs exist in a resources directory, and the produced outputs are compared against them, to check that they are identical.
- Type Parameters:
T- input typeS- shared-state typeV- task type- Parameters:
inputs- the inputs for the task.task- the task to run.pathDirectoryOutput- an absolute path to a directory where outputs of the task will be placed.pathDirectorySaved- a path (relative to thesrc/test/resources) to a directory of saved-results to compare with.pathsFileToCompare- paths (relative to thesrc/test/resources) to check that are identical.- Throws:
OperationFailedException- if anything goes wrong.
-