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 default TaskArguments.
    ExecuteTaskHelper​(boolean copyNonIdentical)
    Create so that all outputs occur, and with default TaskArguments.
    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>>
    void
    assertExpectedTaskOutputs​(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>>
    void
    assertExpectedTaskOutputs​(T input, V task, Path pathDirectoryOutput, String pathDirectorySaved, Iterable<String> pathsFileToCompare)
    Executes a task on a single-input.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ExecuteTaskHelper

      public ExecuteTaskHelper()
      Create so that all outputs occur, and with default TaskArguments.
    • ExecuteTaskHelper

      public ExecuteTaskHelper​(boolean copyNonIdentical)
      Create so that all outputs occur, and with default TaskArguments.
      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.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 type
      S - shared-state type
      V - 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 the src/test/resources) to a directory of saved-results to compare with.
      pathsFileToCompare - paths (relative to the src/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.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 type
      S - shared-state type
      V - 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 the src/test/resources) to a directory of saved-results to compare with.
      pathsFileToCompare - paths (relative to the src/test/resources) to check that are identical.
      Throws:
      org.anchoranalysis.core.exception.OperationFailedException - if anything goes wrong.