ToolManager { public ToolManager(Path toolDirectory) throws AnalysisToolException { this.toolDirectory = toolDirectory; this.tools = new HashMap<>(); this.logger = LoggerFactory.getLogger(ToolManager.class); checkToolDirectory(); } ToolManager(Path toolDirectory); String createCommandLine(String tool, String executionName, Map<String, String> paramsMap); Manifest getManifest(String tool); List<Param> getInputParams(String tool, String executionName); List<Param> getOutputParams(String tool, String executionName); void runCommandLine(String commandLine, Path outdir); void runCommandLine(String commandLine, Path outdir, boolean redirectLogs);  }
@Test public void testToolManager() throws URISyntaxException, AnalysisToolException, IOException { Path testBam = Paths.get(getClass().getResource("/test.bam").toURI()); ToolManager toolManager = new ToolManager(toolPath); Map<String, String> params = new HashMap<>(); params.put("input", testBam.toAbsolutePath().toString()); params.put("output", tmpFolder.resolve("test.bam.bai").toString()); String commandLine = toolManager.createCommandLine("samtools", "index", params); System.out.println(commandLine); Executor.execute(commandLine, tmpFolder, true); ObjectReader reader = new ObjectMapper().reader(Status.class); Status status = reader.readValue(tmpFolder.resolve("status.json").toFile()); assertEquals(Status.DONE, status.getName()); assertTrue(tmpFolder.resolve("test.bam.bai").toFile().exists()); }