FilesCollectionReader extends JCasCollectionReader_ImplBase { public static CollectionReaderDescription getDescriptionWithView(String dir, String viewName) throws ResourceInitializationException { return CollectionReaderFactory.createReaderDescription( FilesCollectionReader.class, PARAM_ROOT_FILE, dir, PARAM_VIEW_NAME, viewName); }  static CollectionReaderDescription getDescription(String fileOrDir); static CollectionReader getCollectionReader(String fileOrDir); static CollectionReaderDescription getDescriptionWithView(String dir, String viewName); static CollectionReader getCollectionReaderWithView(String dir, String viewName); static CollectionReaderDescription getDescriptionWithPatterns(
      String dir,
      String viewName,
      String... patterns); static CollectionReader getCollectionReaderWithPatterns(
      String dir,
      String viewName,
      String... patterns); static CollectionReaderDescription getDescriptionWithSuffixes(
      String dir,
      String viewName,
      String... suffixes); static CollectionReader getCollectionReaderWithSuffixes(
      String dir,
      String viewName,
      String... suffixes); @Override void initialize(UimaContext context); void getNext(JCas jCas); Progress[] getProgress(); boolean hasNext(); void close(); static final String PARAM_ROOT_FILE; static final String PARAM_VIEW_NAME; static final String PARAM_LANGUAGE; static final String PARAM_ENCODING; static final String PARAM_SUFFIXES; static final String PARAM_PATTERNS; static final String PARAM_NAME_FILES_FILE_NAMES; static final String PARAM_FILE_NAMES; static final String PARAM_IGNORE_SYSTEM_FILES; }
@Test public void testViewText() throws Exception { for (String viewName : new String[] { "TestView", "OtherTestView" }) { CollectionReaderDescription desc = FilesCollectionReader.getDescriptionWithView( this.inputDir, viewName); for (JCas jc : new JCasIterable(desc)) { JCas view = jc.getView(viewName); String jCasText = view.getDocumentText(); String docText = this.getFileText(view); assertEquals(jCasText, docText); } } }