Class ExecuteTaskHelper
Object
org.anchoranalysis.test.experiment.task.ExecuteTaskHelper
public class ExecuteTaskHelper extends Object
Executes a task on a single-input outputting into a specific directory.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors Constructor Description ExecuteTaskHelper()Create so that all outputs occur, and with defaultTaskArguments.ExecuteTaskHelper(boolean copyNonIdentical)Create so that all outputs occur, and with defaultTaskArguments.ExecuteTaskHelper(Optional<String> specificOutput, org.anchoranalysis.experiment.arguments.TaskArguments taskArguments, boolean copyNonIdentical)Create with specific arguments, not necessarily the defaults. -
Method Summary
Modifier and Type Method Description <T extends org.anchoranalysis.io.input.InputFromManager, S, V extends org.anchoranalysis.experiment.bean.task.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 org.anchoranalysis.io.input.InputFromManager, S, V extends org.anchoranalysis.experiment.bean.task.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, org.anchoranalysis.experiment.arguments.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 org.anchoranalysis.io.input.InputFromManager, S, V extends org.anchoranalysis.experiment.bean.task.Task<T, S>> void assertExpectedTaskOutputs(T input, V task, Path pathDirectoryOutput, String pathDirectorySaved, Iterable<String> pathsFileToCompare) throws org.anchoranalysis.core.exception.OperationFailedExceptionExecutes 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:
org.anchoranalysis.core.exception.OperationFailedException- if anything goes wrong.
-
assertExpectedTaskOutputs
public <T extends org.anchoranalysis.io.input.InputFromManager, S, V extends org.anchoranalysis.experiment.bean.task.Task<T, S>> void assertExpectedTaskOutputs(List<T> inputs, V task, Path pathDirectoryOutput, String pathDirectorySaved, Iterable<String> pathsFileToCompare) throws org.anchoranalysis.core.exception.OperationFailedExceptionExecutes 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:
org.anchoranalysis.core.exception.OperationFailedException- if anything goes wrong.
-