Main { void run() throws Exception { final StringBuilder sb = new StringBuilder(); sb.append("Indexing "); if (config.isGzipped) { sb.append("gzipped "); } sb.append(config.fileType); sb.append(" file from "); sb.append(config.urlSource != null ? "URL" : "file"); sb.append(' ').append(config.source); System.out.println(sb.toString()); indexWithLucene(); zipLuceneIndex(); if (config.upload) { upload(); } final String aedictDir = config.fileType.getAndroidSdcardRelativeLoc(config.name); System.out.println("Finished - the index file '" + config.getTargetFileName() + "' was created."); System.out.println("To use the indexed file with Aedict, you'll have to:"); System.out.println("1. Connect your phone as a mass storage device to your computer"); System.out.println("2. Browse the SDCard contents and delete the aedict/ directory if it is present"); System.out.println("3. Create the " + aedictDir + " directory"); System.out.println("4. Unzip the " + config.getTargetFileName() + " file to the " + aedictDir + " directory"); System.out.println("See http: } Main(final String[] args); static void main(String[] args); final Config config; }
@Test(expected = ParseException.class) public void failOnMissingSwitch() throws Exception { new Main(new String[0]).run(); }