@Test public void givenExecuteScanClamAVWhenVirusFoundButNotCorrectedThenReturn2() throws Exception { assertEquals(1, JavaExecuteScript.executeCommand(SCRIPT_SCAN_CLAMAV, PropertiesUtils.getResourceFile(FIXED_VIRUS_FILE).getPath(), timeoutScanDelay).getExitCode()); assertEquals(2, JavaExecuteScript.executeCommand(SCRIPT_SCAN_CLAMAV, PropertiesUtils.getResourceFile(UNFIXED_VIRUS_FILE).getPath(), timeoutScanDelay).getExitCode()); assertEquals(0, JavaExecuteScript.executeCommand(SCRIPT_SCAN_CLAMAV, PropertiesUtils.getResourceFile(NO_VIRUS_FILE).getPath(), timeoutScanDelay).getExitCode()); }
public static ExecutionOutput executeCommand(String cmd, String arg, long timeoutScanDelay) throws JavaExecuteScriptException { String scriptPath; try { scriptPath = PropertiesUtils.findFile(cmd).getPath(); } catch (final FileNotFoundException e) { LOGGER.error(cmd + " does not exit"); throw new JavaExecuteScriptException(e); } return exec(scriptPath, arg, timeoutScanDelay); }
JavaExecuteScript { public static ExecutionOutput executeCommand(String cmd, String arg, long timeoutScanDelay) throws JavaExecuteScriptException { String scriptPath; try { scriptPath = PropertiesUtils.findFile(cmd).getPath(); } catch (final FileNotFoundException e) { LOGGER.error(cmd + " does not exit"); throw new JavaExecuteScriptException(e); } return exec(scriptPath, arg, timeoutScanDelay); } }
JavaExecuteScript { public static ExecutionOutput executeCommand(String cmd, String arg, long timeoutScanDelay) throws JavaExecuteScriptException { String scriptPath; try { scriptPath = PropertiesUtils.findFile(cmd).getPath(); } catch (final FileNotFoundException e) { LOGGER.error(cmd + " does not exit"); throw new JavaExecuteScriptException(e); } return exec(scriptPath, arg, timeoutScanDelay); }  }
JavaExecuteScript { public static ExecutionOutput executeCommand(String cmd, String arg, long timeoutScanDelay) throws JavaExecuteScriptException { String scriptPath; try { scriptPath = PropertiesUtils.findFile(cmd).getPath(); } catch (final FileNotFoundException e) { LOGGER.error(cmd + " does not exit"); throw new JavaExecuteScriptException(e); } return exec(scriptPath, arg, timeoutScanDelay); }  static ExecutionOutput executeCommand(String cmd, String arg, long timeoutScanDelay); }
JavaExecuteScript { public static ExecutionOutput executeCommand(String cmd, String arg, long timeoutScanDelay) throws JavaExecuteScriptException { String scriptPath; try { scriptPath = PropertiesUtils.findFile(cmd).getPath(); } catch (final FileNotFoundException e) { LOGGER.error(cmd + " does not exit"); throw new JavaExecuteScriptException(e); } return exec(scriptPath, arg, timeoutScanDelay); }  static ExecutionOutput executeCommand(String cmd, String arg, long timeoutScanDelay);  }