private void validateCmdLineArguments() { logger.debug("Checking required command line arguments for conversion..."); ImfUtilityInputParametersValidator.validateCmdLineArguments(inputParameters); doValidateCmdLineArguments(); logger.debug("Checked required command line arguments for conversion: OK\n"); }
@Test public void testValidateConfigCorrect() throws Exception { @SuppressWarnings("ConstantConditions") String[] args = new String[]{ "-c", ConfigUtils.getCorrectConfigXmlFile().getAbsolutePath() }; ImfUtilityInputParameters inputParameters = new FakeInputParameters( CliFactory.parseArguments(ImfUtilityCmdLineArgs.class, args), new FakeDefaultTools()); ImfUtilityInputParametersValidator.validateCmdLineArguments(inputParameters); }
@Test(expected = ArgumentValidationException.class) public void testValidateConfigNotSpecified() throws Exception { String[] args = new String[]{}; ImfUtilityInputParameters inputParameters = new FakeInputParameters( CliFactory.parseArguments(ImfUtilityCmdLineArgs.class, args), new FakeDefaultTools()); ImfUtilityInputParametersValidator.validateCmdLineArguments(inputParameters); }
@Test(expected = ArgumentValidationException.class) public void testValidateConfigNotExistentFile() throws Exception { String[] args = new String[]{ "-c", "someFile" }; ImfUtilityInputParameters inputParameters = new FakeInputParameters( CliFactory.parseArguments(ImfUtilityCmdLineArgs.class, args), new FakeDefaultTools()); ImfUtilityInputParametersValidator.validateCmdLineArguments(inputParameters); }