JCasIterator jCasIterator = new JCasIterator(reader);
jCas = jCasIterator.next();
assertNotNull(jCas);
assertEquals("Me and all my friends are non-conformists.", jCas.getDocumentText());
Token token = JCasUtil.selectByIndex(jCas, Token.class, 2);
assertEquals("all", token.getCoveredText());
assertEquals("A", token.getPos());
assertEquals("all", token.getStem());
reader = CollectionReaderFactory.createReader(
"org.apache.uima.fit.factory.testCrs.SingleFileXReader",
SingleFileXReader.PARAM_FILE_NAME, "src/test/resources/data/docs/test.xmi",
SingleFileXReader.PARAM_XML_SCHEME, SingleFileXReader.XMI);
jCasIterator = new JCasIterator(reader, typeSystemDescription);
jCas = jCasIterator.next();
assertNotNull(jCas);
assertEquals("Me and all my friends are non-conformists.", jCas.getDocumentText());
token = JCasUtil.selectByIndex(jCas, Token.class, 9);
assertEquals(".", token.getCoveredText());
assertEquals(".", token.getPos());
assertEquals(".", token.getStem());
reader = CollectionReaderFactory.createReaderFromPath(
"src/test/resources/org/apache/uima/fit/factory/testCrs/SingleFileXReader.xml",
SingleFileXReader.PARAM_FILE_NAME, "src/test/resources/data/docs/test.xmi",
SingleFileXReader.PARAM_XML_SCHEME, SingleFileXReader.XMI);
jCasIterator = new JCasIterator(reader, typeSystemDescription);
jCas = jCasIterator.next();
assertNotNull(jCas);
assertEquals("Me and all my friends are non-conformists.", jCas.getDocumentText());
token = JCasUtil.selectByIndex(jCas, Token.class, 4);
assertEquals("friends", token.getCoveredText());
assertEquals("F", token.getPos());
assertEquals("friend", token.getStem());
}