@Test public void testMain() { File file = new File(OUTPUT_DIRECTORY + OUTPUT_FILENAME); if (file.exists()) { file.delete(); } DocGen.main(DOC_GEN_TEST_MAIN_ARGS); assertTrue(file.exists()); file.delete(); }
public static void main(final String[] args) { final OptionParser parser = new OptionParser(); final OptionSpec<File> domainFileSpec = optionSpec(parser, ARGUMENT_DOMAIN_FILE, "Domain file", File.class); final OptionSpec<File> xmiFileSpec = optionSpec(parser, ARGUMENT_XMI, "XMI file", File.class); final OptionSpec<String> outFileSpec = optionSpec(parser, ARGUMENT_OUT_FILE, "Output file", String.class); final OptionSpec<File> outFolderSpec = optionSpec(parser, ARGUMENT_OUT_FOLDER, "Output folder", File.class); try { if (HELP_PARSER.parse(args).has(HELP_SPEC)) { try { parser.printHelpOn(System.out); } catch (final IOException e) { throw new DocumentGeneratorRuntimeException(e); } } else { OptionSet options = parser.parse(args); try { final File xmiFile = options.valueOf(xmiFileSpec); final ModelIndex model = new DefaultModelIndex(XmiReader.readModel(xmiFile)); final File domainFile = options.valueOf(domainFileSpec); final Documentation<Type> domains = DocumentationReader.readDocumentation(domainFile, model); final File outFolder = options.valueOf(outFolderSpec); final String outFile = options.valueOf(outFileSpec); final File outLocation = new File(outFolder, outFile); DocumentationWriter.writeDocument(domains, model, outLocation); } catch (final FileNotFoundException e) { throw new DocumentGeneratorRuntimeException(e); } } } catch (final OptionException e) { LOG.warn(e.getMessage()); } }
DocGen { public static void main(final String[] args) { final OptionParser parser = new OptionParser(); final OptionSpec<File> domainFileSpec = optionSpec(parser, ARGUMENT_DOMAIN_FILE, "Domain file", File.class); final OptionSpec<File> xmiFileSpec = optionSpec(parser, ARGUMENT_XMI, "XMI file", File.class); final OptionSpec<String> outFileSpec = optionSpec(parser, ARGUMENT_OUT_FILE, "Output file", String.class); final OptionSpec<File> outFolderSpec = optionSpec(parser, ARGUMENT_OUT_FOLDER, "Output folder", File.class); try { if (HELP_PARSER.parse(args).has(HELP_SPEC)) { try { parser.printHelpOn(System.out); } catch (final IOException e) { throw new DocumentGeneratorRuntimeException(e); } } else { OptionSet options = parser.parse(args); try { final File xmiFile = options.valueOf(xmiFileSpec); final ModelIndex model = new DefaultModelIndex(XmiReader.readModel(xmiFile)); final File domainFile = options.valueOf(domainFileSpec); final Documentation<Type> domains = DocumentationReader.readDocumentation(domainFile, model); final File outFolder = options.valueOf(outFolderSpec); final String outFile = options.valueOf(outFileSpec); final File outLocation = new File(outFolder, outFile); DocumentationWriter.writeDocument(domains, model, outLocation); } catch (final FileNotFoundException e) { throw new DocumentGeneratorRuntimeException(e); } } } catch (final OptionException e) { LOG.warn(e.getMessage()); } } }
DocGen { public static void main(final String[] args) { final OptionParser parser = new OptionParser(); final OptionSpec<File> domainFileSpec = optionSpec(parser, ARGUMENT_DOMAIN_FILE, "Domain file", File.class); final OptionSpec<File> xmiFileSpec = optionSpec(parser, ARGUMENT_XMI, "XMI file", File.class); final OptionSpec<String> outFileSpec = optionSpec(parser, ARGUMENT_OUT_FILE, "Output file", String.class); final OptionSpec<File> outFolderSpec = optionSpec(parser, ARGUMENT_OUT_FOLDER, "Output folder", File.class); try { if (HELP_PARSER.parse(args).has(HELP_SPEC)) { try { parser.printHelpOn(System.out); } catch (final IOException e) { throw new DocumentGeneratorRuntimeException(e); } } else { OptionSet options = parser.parse(args); try { final File xmiFile = options.valueOf(xmiFileSpec); final ModelIndex model = new DefaultModelIndex(XmiReader.readModel(xmiFile)); final File domainFile = options.valueOf(domainFileSpec); final Documentation<Type> domains = DocumentationReader.readDocumentation(domainFile, model); final File outFolder = options.valueOf(outFolderSpec); final String outFile = options.valueOf(outFileSpec); final File outLocation = new File(outFolder, outFile); DocumentationWriter.writeDocument(domains, model, outLocation); } catch (final FileNotFoundException e) { throw new DocumentGeneratorRuntimeException(e); } } } catch (final OptionException e) { LOG.warn(e.getMessage()); } } DocGen(); }
DocGen { public static void main(final String[] args) { final OptionParser parser = new OptionParser(); final OptionSpec<File> domainFileSpec = optionSpec(parser, ARGUMENT_DOMAIN_FILE, "Domain file", File.class); final OptionSpec<File> xmiFileSpec = optionSpec(parser, ARGUMENT_XMI, "XMI file", File.class); final OptionSpec<String> outFileSpec = optionSpec(parser, ARGUMENT_OUT_FILE, "Output file", String.class); final OptionSpec<File> outFolderSpec = optionSpec(parser, ARGUMENT_OUT_FOLDER, "Output folder", File.class); try { if (HELP_PARSER.parse(args).has(HELP_SPEC)) { try { parser.printHelpOn(System.out); } catch (final IOException e) { throw new DocumentGeneratorRuntimeException(e); } } else { OptionSet options = parser.parse(args); try { final File xmiFile = options.valueOf(xmiFileSpec); final ModelIndex model = new DefaultModelIndex(XmiReader.readModel(xmiFile)); final File domainFile = options.valueOf(domainFileSpec); final Documentation<Type> domains = DocumentationReader.readDocumentation(domainFile, model); final File outFolder = options.valueOf(outFolderSpec); final String outFile = options.valueOf(outFileSpec); final File outLocation = new File(outFolder, outFile); DocumentationWriter.writeDocument(domains, model, outLocation); } catch (final FileNotFoundException e) { throw new DocumentGeneratorRuntimeException(e); } } } catch (final OptionException e) { LOG.warn(e.getMessage()); } } DocGen(); static void main(final String[] args); }
DocGen { public static void main(final String[] args) { final OptionParser parser = new OptionParser(); final OptionSpec<File> domainFileSpec = optionSpec(parser, ARGUMENT_DOMAIN_FILE, "Domain file", File.class); final OptionSpec<File> xmiFileSpec = optionSpec(parser, ARGUMENT_XMI, "XMI file", File.class); final OptionSpec<String> outFileSpec = optionSpec(parser, ARGUMENT_OUT_FILE, "Output file", String.class); final OptionSpec<File> outFolderSpec = optionSpec(parser, ARGUMENT_OUT_FOLDER, "Output folder", File.class); try { if (HELP_PARSER.parse(args).has(HELP_SPEC)) { try { parser.printHelpOn(System.out); } catch (final IOException e) { throw new DocumentGeneratorRuntimeException(e); } } else { OptionSet options = parser.parse(args); try { final File xmiFile = options.valueOf(xmiFileSpec); final ModelIndex model = new DefaultModelIndex(XmiReader.readModel(xmiFile)); final File domainFile = options.valueOf(domainFileSpec); final Documentation<Type> domains = DocumentationReader.readDocumentation(domainFile, model); final File outFolder = options.valueOf(outFolderSpec); final String outFile = options.valueOf(outFileSpec); final File outLocation = new File(outFolder, outFile); DocumentationWriter.writeDocument(domains, model, outLocation); } catch (final FileNotFoundException e) { throw new DocumentGeneratorRuntimeException(e); } } } catch (final OptionException e) { LOG.warn(e.getMessage()); } } DocGen(); static void main(final String[] args);  }