}
public void testCreateAnalysisProcessData() throws Exception {
try {
// create simple primitive TAE with type system and indexes
TaeDescription desc = new TaeDescription_impl();
desc.setPrimitive(true);
desc.getMetaData().setName("Test Primitive TAE");
desc.setAnnotatorImplementationName("org.apache.uima.analysis_engine.impl.TestAnnotator");
TypeSystemDescription typeSystem = new TypeSystemDescription_impl();
TypeDescription type1 = typeSystem.addType("Type1", "Test Type One",
CAS.TYPE_NAME_ANNOTATION);
FeatureDescription feat1 = new FeatureDescription_impl();
feat1.setName("Feature1");
feat1.setRangeTypeName(CAS.TYPE_NAME_INTEGER);
type1.setFeatures(new FeatureDescription[] { feat1 });
TypeDescription type2 = typeSystem.addType("Type2", "Test Type Two",
CAS.TYPE_NAME_ANNOTATION);
FeatureDescription feat2 = new FeatureDescription_impl();
feat2.setName("Feature2");
feat2.setRangeTypeName("EnumType");
type2.setFeatures(new FeatureDescription[] { feat2 });
TypeDescription enumType = typeSystem.addType("EnumType", "Test Enumerated Type",
"uima.cas.String");
enumType.setAllowedValues(new AllowedValue[] { new AllowedValue_impl("One", "First Value"),
new AllowedValue_impl("Two", "Second Value") });
desc.getAnalysisEngineMetaData().setTypeSystem(typeSystem);
TypePriorities typePriorities = new TypePriorities_impl();
TypePriorityList priorityList = typePriorities.addPriorityList();
priorityList.addType("Type1");
priorityList.addType("Type2");
desc.getAnalysisEngineMetaData().setTypePriorities(typePriorities);
FsIndexDescription index1 = new FsIndexDescription_impl();
index1.setLabel("Index1");
index1.setTypeName("Type1");
FsIndexKeyDescription key1 = new FsIndexKeyDescription_impl();
key1.setFeatureName("Feature1");
key1.setComparator(FSIndexComparator.STANDARD_COMPARE);
index1.setKeys(new FsIndexKeyDescription[] { key1 });
FsIndexDescription index2 = new FsIndexDescription_impl();
index2.setLabel("Index2");
index2.setTypeName("Type2");
index2.setKind(FsIndexDescription.KIND_SET);
FsIndexKeyDescription key2 = new FsIndexKeyDescription_impl();
key2.setFeatureName("Feature2");
key2.setComparator(FSIndexComparator.REVERSE_STANDARD_COMPARE);
index2.setKeys(new FsIndexKeyDescription[] { key2 });
FsIndexDescription index3 = new FsIndexDescription_impl();
index3.setLabel("Index3");
index3.setTypeName("uima.tcas.Annotation");
index3.setKind(FsIndexDescription.KIND_SORTED);
FsIndexKeyDescription key3 = new FsIndexKeyDescription_impl();
key3.setFeatureName("begin");
key3.setComparator(FSIndexComparator.STANDARD_COMPARE);
FsIndexKeyDescription key4 = new FsIndexKeyDescription_impl();
key4.setTypePriority(true);
index3.setKeys(new FsIndexKeyDescription[] { key3, key4 });
desc.getAnalysisEngineMetaData().setFsIndexes(
new FsIndexDescription[] { index1, index2, index3 });
// instantiate TextAnalysisEngine
PrimitiveAnalysisEngine_impl tae = new PrimitiveAnalysisEngine_impl();
tae.initialize(desc, null); // this calls createAnalysisProcessData