SimulatedLauncher implements IsolatedLauncher { @Override public void execute(Map<String, String> props, LogOutput logOutput) { String filePath = props.get(InternalProperties.SCANNER_DUMP_TO_FILE); writeProperties(filePath, props); logger.info("Simulation mode. Configuration written to " + new File(filePath).getAbsolutePath()); } SimulatedLauncher(String version, Logger logger); @Override void execute(Map<String, String> props, LogOutput logOutput); @Override String getVersion();  }
@Test(expected = IllegalStateException.class) public void failIfInvalidFile() { Map<String, String> props = createProperties(); props.put(InternalProperties.SCANNER_DUMP_TO_FILE, temp.getRoot().getAbsolutePath()); launcher.execute(props, logOutput); }
@Test public void testDump() throws IOException { Map<String, String> props = createProperties(); launcher.execute(props, logOutput); assertDump(props); }
@Test(expected = IllegalStateException.class) public void error_dump() throws IOException { Map<String, String> prop = new HashMap<>(); prop.put(InternalProperties.SCANNER_DUMP_TO_FILE, "an invalid # file \\ launcher.execute(prop, logOutput); }