Class ExperimentLauncherFromShell

Object
ExperimentLauncherFromShell

public class ExperimentLauncherFromShell extends Object
Launches an experiment by calling the application 'anchor' via the shell.

This is particularly useful for unit-tests that call experiments, but want to do it with all the libraries and plugins instantiated, as they would be from the shell.

  • Constructor Details

    • ExperimentLauncherFromShell

      public ExperimentLauncherFromShell(TestLoader loader)
      Create with a specific loader.
      Parameters:
      loader - the loader, that loads resources for tests.
  • Method Details

    • runExperiment

      public void runExperiment(String testPathToExperiment)
      Runs an experiment identified by an XML found in the resources
      Parameters:
      testPathToExperiment - path to the resources where the experiment XML is found
    • runExperiment

      public void runExperiment(String testPathToExperiment, Optional<String> testPathToInput, Optional<String> testPathToOutput)
      Runs an experiment identified by an XML found in the resources
      Parameters:
      testPathToExperiment - path to the resources where the experiment XML is found
      testPathToInput - if non-null, the path to a replacement input-manager. if null, ignored.
      testPathToOutput - if non-null, the path to a replacement output-manager. if null, ignored.
    • runExperimentInTemporaryDirectory

      public TestLoader runExperimentInTemporaryDirectory(String testPathToExperiment, Path temporaryDirectory)
      Creates a temporary-folder, copies data all data from the associated test-loader, and runs an experiment
      Parameters:
      testPathToExperiment - path to the resources where the experiment XML is found
      temporaryDirectory - the temporary folder to copy files to
      Returns:
      a test-loader bounded to the temporary folder
    • runExperimentInTemporaryDirectory

      public TestLoader runExperimentInTemporaryDirectory(String testPathToExperiment, Optional<String> testPathToInput, Optional<String> testPathToOutput, Path temporaryDirectory, String[] specificSubdirectories)
      Creates a temporary-folder, copies data all data from the associated test-loader, and runs an experiment
      Parameters:
      testPathToExperiment - path to the resources where the experiment XML is found
      testPathToInput - if defined, the path to a replacement input-manager. if empty(), ignored.
      testPathToOutput - if defined, the path to a replacement output-manager. if empty(), ignored.
      temporaryDirectory - the temporary folder to copy files to
      specificSubdirectories - if non-null, specific subdirectories to copy. if null, ignored.
      Returns:
      a test-loader bounded to the temporary folder