}
}
public void testUndefinedType() throws Exception {
//create jcas with no type system
JCas jcas = CasCreationUtils.createCas(new TypeSystemDescription_impl(), null, null).getJCas();
jcas.setDocumentText("This is a test.");
try {
//this should throw an exception
jcas.getType(Sentence.type);
fail();
} catch(CASRuntimeException e) {
}
//check that this does not leave JCAS in an inconsistent state
//(a check for bug UIMA-738)
Iterator<Annotation> iter = jcas.getAnnotationIndex().iterator();
assertTrue(iter.hasNext());
Annotation annot = iter.next();
assertEquals("This is a test.", annot.getCoveredText());
}