TokenizedWriterPipeline { public static void main(String[] args) throws IOException, UIMAException { CollectionReaderDescription reader = createReaderDescription(TextReader.class, TextReader.PARAM_SOURCE_LOCATION, SOURCE_DIR, TextReader.PARAM_LANGUAGE, LANGUAGE); AnalysisEngineDescription segmenter = createEngineDescription(OpenNlpSegmenter.class); AnalysisEngineDescription writer = createEngineDescription(TokenizedTextWriter.class, TokenizedTextWriter.PARAM_TARGET_LOCATION, TARGET_FILE, TokenizedTextWriter.PARAM_SINGULAR_TARGET, SINGULAR_TARGET); SimplePipeline.runPipeline(reader, segmenter, writer); }  static void main(String[] args);  }
@Test public void testMain() throws IOException, UIMAException { File expectedOutput = new File("src/test/resources/tokenized.txt"); TokenizedWriterPipeline.TARGET_FILE.delete(); TokenizedWriterPipeline.main(new String[] {}); assertTrue("Output file not generated.", TokenizedWriterPipeline.TARGET_FILE.exists()); assertEquals("Output file content does not match.", FileUtils.readFileToString(expectedOutput), FileUtils.readFileToString(TokenizedWriterPipeline.TARGET_FILE)); }