private void validateInputParameters() { logger.debug("Checking required input parameters for conversion..."); ImfUtilityInputParametersValidator.validateInputParameters(inputParameters); logger.debug("Checked required input parameters for conversion: OK\n"); }
@Test public void testValidateInputParamsCorrectAbsoluteCpl() throws Exception { String[] args = new String[]{ "--imp", ImpUtils.getImpFolder().getAbsolutePath(), "--cpl", ImpUtils.getCorrectCpl().getAbsolutePath(), "-w", TemplateParameterContextCreator.getWorkingDir().getAbsolutePath() }; ImfUtilityInputParameters inputParameters = new FakeInputParameters( CliFactory.parseArguments(ImfUtilityCmdLineArgs.class, args), new FakeDefaultTools()); ImfUtilityInputParametersValidator.validateInputParameters(inputParameters); }
@Test(expected = ArgumentValidationException.class) public void testValidateCplNotExistentFile() throws Exception { String[] args = new String[]{ "--imp", ImpUtils.getImpFolder().getAbsolutePath(), "--cpl", "someFile", "-w", TemplateParameterContextCreator.getWorkingDir().getAbsolutePath() }; ImfUtilityInputParameters inputParameters = new FakeInputParameters( CliFactory.parseArguments(ImfUtilityCmdLineArgs.class, args), new FakeDefaultTools()); ImfUtilityInputParametersValidator.validateInputParameters(inputParameters); }
@Test(expected = ArgumentValidationException.class) public void testValidateImpNotExistentFolder() throws Exception { String[] args = new String[]{ "--imp", "someFolder", "--cpl", ImpUtils.getCorrectCpl().getName(), "-w", TemplateParameterContextCreator.getWorkingDir().getAbsolutePath() }; ImfUtilityInputParameters inputParameters = new FakeInputParameters( CliFactory.parseArguments(ImfUtilityCmdLineArgs.class, args), new FakeDefaultTools()); ImfUtilityInputParametersValidator.validateInputParameters(inputParameters); }
@Test public void testValidateInputParamsCorrectRelativeCpl() throws Exception { String[] args = new String[]{ "--imp", ImpUtils.getImpFolder().getAbsolutePath(), "--cpl", ImpUtils.getCorrectCpl().getName(), "-w", TemplateParameterContextCreator.getWorkingDir().getAbsolutePath() }; ImfUtilityInputParameters inputParameters = new FakeInputParameters( CliFactory.parseArguments(ImfUtilityCmdLineArgs.class, args), new FakeDefaultTools()); ImfUtilityInputParametersValidator.validateInputParameters(inputParameters); }
@Test(expected = ArgumentValidationException.class) public void testValidateImpNotSpecified() throws Exception { String[] args = new String[]{ "--cpl", ImpUtils.getCorrectCpl().getName(), "-w", TemplateParameterContextCreator.getWorkingDir().getAbsolutePath() }; ImfUtilityInputParameters inputParameters = new FakeInputParameters( CliFactory.parseArguments(ImfUtilityCmdLineArgs.class, args), new FakeDefaultTools()); ImfUtilityInputParametersValidator.validateInputParameters(inputParameters); }
@Test(expected = ArgumentValidationException.class) public void testValidateCplNotSpecified() throws Exception { String[] args = new String[]{ "--imp", ImpUtils.getImpFolder().getAbsolutePath(), "-w", TemplateParameterContextCreator.getWorkingDir().getAbsolutePath() }; ImfUtilityInputParameters inputParameters = new FakeInputParameters( CliFactory.parseArguments(ImfUtilityCmdLineArgs.class, args), new FakeDefaultTools()); ImfUtilityInputParametersValidator.validateInputParameters(inputParameters); }
@Test(expected = ArgumentValidationException.class) public void testValidateWorkingDirNotSpecified() throws Exception { String[] args = new String[]{ "--imp", ImpUtils.getImpFolder().getAbsolutePath(), "--cpl", ImpUtils.getCorrectCpl().getName() }; ImfUtilityInputParameters inputParameters = new FakeInputParameters( CliFactory.parseArguments(ImfUtilityCmdLineArgs.class, args), new FakeDefaultTools()); ImfUtilityInputParametersValidator.validateInputParameters(inputParameters); }