GlobalAntExecutor { public void launchAntExecutor(final String generatorBuilderPath, final String fileName, final String deliverableFileName, final String temporaryDir, final PrintStream errorStreamWrapper, final PrintStream outputStreamWrapper) throws APIRestGeneratorException { String packageName = new StringBuilder(ConstantsOutput.COMMON_GEN_TYPE_PACKAGE) .append(ConstantsCommon.STRING_DOT) .append(this.translatorType) .append(ConstantsCommon.STRING_DOT) .append(ConstantsAnt.ANT_FOLDER).toString() ; InvokeModule invokeModule = InvokeModule.initInvokeModule(packageName, ConstantsAnt.ANT_LAUNCHER_CLASS) ; if (invokeModule != null) { Object[] constParams = {generatorBuilderPath, this.parserType, deliverableFileName} ; Class<?>[] consTypeParams = {String.class, String.class, String.class} ; Object executorInstance = invokeModule.createInstance(constParams, consTypeParams) ; Object[] methodParams = {fileName, errorStreamWrapper, outputStreamWrapper, temporaryDir} ; Class<?>[] methodTypeParams = {String.class, PrintStream.class, PrintStream.class, String.class} ; invokeModule.invokeMethod(executorInstance, "executeAntTask", methodParams, methodTypeParams) ; } } GlobalAntExecutor(final String parserType, final String translatorType); void launchAntExecutor(final String generatorBuilderPath,
                                  final String fileName,
                                  final String deliverableFileName,
                                  final String temporaryDir,
                                  final PrintStream errorStreamWrapper,
                                  final PrintStream outputStreamWrapper); String generateTemporaryOutputDirectory(final String generatorBuilderPath); String generateFullTemporaryDir(final String generatorBuilderPath, final String temporaryDir); void removeFullTemporaryDirectory(final String fullTemporaryDir); void validateFileExtension(final String fileName); String getDeliverableFileName(final String fileName, final String translatorType);  }
@Test(expected=APIRestGeneratorException.class) public void launchAntExecutorTest() throws APIRestGeneratorException { final GlobalAntExecutor globalAntExecutor = new GlobalAntExecutor(ConstantsTest.PARSER_TYPE, ConstantsTest.TRANSLATOR_TYPE) ; globalAntExecutor.launchAntExecutor(ConstantsTest.GENERATOR_BUILDER_PATH, ConstantsTest.SPECIF_FILE_PATH, "deliverableFileName", ConstantsTest.TEMPORARY_DIR, System.err, System.out) ; }