@Test public void withMultiPackages() throws Exception { cli.run(new String[]{"-p", "\"com.nitorcreations.testdomain.person, com.nitorcreations.testdomain.another\""}); assertThat(cli.domainMapper.getClasses().size(), is(5)); }
public void run(final String[] args) throws ClassNotFoundException, IOException { CommandLineParser parser = new BasicParser(); Options options = new Options(); options.addOption("f", "file", true, "write to file"); options.addOption("p", "package", true, "comma separated list of domain packages"); options.addOption(OptionBuilder.withArgName("package").hasArgs().isRequired().create('p')); try { CommandLine line = parser.parse(options, args); String[] packages = line.getOptionValue("p").split(",[ ]*"); log.debug("Scanning domain for packages:"); for (String packageName : packages) { log.debug(packageName); } domainMapper = DomainMapper.create(Arrays.asList(packages)); if (line.hasOption('f')) { String filename = line.getOptionValue('f'); Files.write(Paths.get(filename), domainMapper.describeDomain().getBytes()); log.info("Wrote dot to file " + filename); } else { log.info(domainMapper.describeDomain()); } } catch (ParseException exp) { log.info(exp.getMessage()); HelpFormatter formatter = new HelpFormatter(); formatter.printHelp("java -jar drm-core.jar", options); } }
DomainMapperCli { public void run(final String[] args) throws ClassNotFoundException, IOException { CommandLineParser parser = new BasicParser(); Options options = new Options(); options.addOption("f", "file", true, "write to file"); options.addOption("p", "package", true, "comma separated list of domain packages"); options.addOption(OptionBuilder.withArgName("package").hasArgs().isRequired().create('p')); try { CommandLine line = parser.parse(options, args); String[] packages = line.getOptionValue("p").split(",[ ]*"); log.debug("Scanning domain for packages:"); for (String packageName : packages) { log.debug(packageName); } domainMapper = DomainMapper.create(Arrays.asList(packages)); if (line.hasOption('f')) { String filename = line.getOptionValue('f'); Files.write(Paths.get(filename), domainMapper.describeDomain().getBytes()); log.info("Wrote dot to file " + filename); } else { log.info(domainMapper.describeDomain()); } } catch (ParseException exp) { log.info(exp.getMessage()); HelpFormatter formatter = new HelpFormatter(); formatter.printHelp("java -jar drm-core.jar", options); } } }
DomainMapperCli { public void run(final String[] args) throws ClassNotFoundException, IOException { CommandLineParser parser = new BasicParser(); Options options = new Options(); options.addOption("f", "file", true, "write to file"); options.addOption("p", "package", true, "comma separated list of domain packages"); options.addOption(OptionBuilder.withArgName("package").hasArgs().isRequired().create('p')); try { CommandLine line = parser.parse(options, args); String[] packages = line.getOptionValue("p").split(",[ ]*"); log.debug("Scanning domain for packages:"); for (String packageName : packages) { log.debug(packageName); } domainMapper = DomainMapper.create(Arrays.asList(packages)); if (line.hasOption('f')) { String filename = line.getOptionValue('f'); Files.write(Paths.get(filename), domainMapper.describeDomain().getBytes()); log.info("Wrote dot to file " + filename); } else { log.info(domainMapper.describeDomain()); } } catch (ParseException exp) { log.info(exp.getMessage()); HelpFormatter formatter = new HelpFormatter(); formatter.printHelp("java -jar drm-core.jar", options); } }  }
DomainMapperCli { public void run(final String[] args) throws ClassNotFoundException, IOException { CommandLineParser parser = new BasicParser(); Options options = new Options(); options.addOption("f", "file", true, "write to file"); options.addOption("p", "package", true, "comma separated list of domain packages"); options.addOption(OptionBuilder.withArgName("package").hasArgs().isRequired().create('p')); try { CommandLine line = parser.parse(options, args); String[] packages = line.getOptionValue("p").split(",[ ]*"); log.debug("Scanning domain for packages:"); for (String packageName : packages) { log.debug(packageName); } domainMapper = DomainMapper.create(Arrays.asList(packages)); if (line.hasOption('f')) { String filename = line.getOptionValue('f'); Files.write(Paths.get(filename), domainMapper.describeDomain().getBytes()); log.info("Wrote dot to file " + filename); } else { log.info(domainMapper.describeDomain()); } } catch (ParseException exp) { log.info(exp.getMessage()); HelpFormatter formatter = new HelpFormatter(); formatter.printHelp("java -jar drm-core.jar", options); } }  static void main(final String[] args); void run(final String[] args); }
DomainMapperCli { public void run(final String[] args) throws ClassNotFoundException, IOException { CommandLineParser parser = new BasicParser(); Options options = new Options(); options.addOption("f", "file", true, "write to file"); options.addOption("p", "package", true, "comma separated list of domain packages"); options.addOption(OptionBuilder.withArgName("package").hasArgs().isRequired().create('p')); try { CommandLine line = parser.parse(options, args); String[] packages = line.getOptionValue("p").split(",[ ]*"); log.debug("Scanning domain for packages:"); for (String packageName : packages) { log.debug(packageName); } domainMapper = DomainMapper.create(Arrays.asList(packages)); if (line.hasOption('f')) { String filename = line.getOptionValue('f'); Files.write(Paths.get(filename), domainMapper.describeDomain().getBytes()); log.info("Wrote dot to file " + filename); } else { log.info(domainMapper.describeDomain()); } } catch (ParseException exp) { log.info(exp.getMessage()); HelpFormatter formatter = new HelpFormatter(); formatter.printHelp("java -jar drm-core.jar", options); } }  static void main(final String[] args); void run(final String[] args);  }