FSIndex ind = irep.getIndex("Index1");
Assert.assertNotNull(ind);
Assert.assertEquals("Type1", ind.getType().getName());
Assert.assertEquals(FSIndex.SORTED_INDEX, ind.getIndexingStrategy());
FeatureStructure fs1 = cas.createFS(t1);
fs1.setIntValue(f1, 0);
FeatureStructure fs2 = cas.createFS(t1);
fs2.setIntValue(f1, 1);
Assert.assertTrue(ind.compare(fs1, fs2) < 0);
FSIndex ind2 = irep.getIndex("Index2");
Assert.assertNotNull(ind2);
Assert.assertEquals("Type2", ind2.getType().getName());
Assert.assertEquals(FSIndex.SET_INDEX, ind2.getIndexingStrategy());
FeatureStructure fs3 = cas.createFS(t2);
fs3.setStringValue(f2, "One");
FeatureStructure fs4 = cas.createFS(t2);
fs4.setStringValue(f2, "Two");
Assert.assertTrue(ind2.compare(fs3, fs4) > 0);
FSIndex ind3 = irep.getIndex("Index3");
Assert.assertNotNull(ind3);
Assert.assertEquals("uima.tcas.Annotation", ind3.getType().getName());
Assert.assertEquals(FSIndex.SORTED_INDEX, ind3.getIndexingStrategy());
AnnotationFS fs5 = cas.createAnnotation(t1, 0, 0);
AnnotationFS fs6 = cas.createAnnotation(t2, 0, 0);
AnnotationFS fs7 = cas.createAnnotation(t1, 0, 0);
Assert.assertTrue(ind3.compare(fs5, fs6) < 0);
Assert.assertTrue(ind3.compare(fs6, fs7) > 0);
// only way to check if allowed values is correct is to try to set an
// invalid value?
CASRuntimeException ex = null;
try {
fs4.setStringValue(f2, "Three");
} catch (CASRuntimeException e) {
ex = e;
}
Assert.assertNotNull(ex);
} catch (Exception e) {