Main { public static void main(final String[] args) throws IOException { Options options = createOptions(); CommandLineParser parser = new DefaultParser(); try { CommandLine cmd = parser.parse(options, args); if (cmd.hasOption("help")) { printHelp(options); System.exit(0); } Datenpaket datenpaket = importDatenpaket(cmd); formatDatenpaket(cmd, datenpaket); if (cmd.hasOption("validate")) { printViolations(datenpaket.validate()); } } catch (ParseException ex) { LOG.log(Level.SEVERE, "Cannot parse " + Arrays.toString(args), ex); System.err.println("Fehler beim Aufruf von " + Main.class); printHelp(options); System.exit(1); } } private  Main(); static void main(final String[] args);  }
@Test public void testMain() throws IOException, XMLStreamException { String[] args = { "-import", "src/test/resources/musterdatei_041222.txt", "-export", "target/musterdatei_041222.html", "-validate" }; Main.main(args); }
@Test public void testMainXml() throws IOException, XMLStreamException, SAXException { File generated = new File("target", "musterdatei_041222.xml"); String[] args = { "-import", new File("src/test/resources/musterdatei_041222.txt").toURI().toString(), "-xml", "-export", generated.toString()}; Main.main(args); XmlFormatterTest.validate(generated); }