ProcessingResourceMetaData mergedMetaData = CasCreationUtils
.mergeDelegateAnalysisEngineMetaData(desc, UIMAFramework.newDefaultResourceManager(),
mergedTypes, null);
TypeSystemDescription typeSys = mergedMetaData.getTypeSystem();
TypePriorities pri = mergedMetaData.getTypePriorities();
FsIndexCollection indexColl = mergedMetaData.getFsIndexCollection();
// test results of merge
// Type System
Assert.assertEquals(8, typeSys.getTypes().length);
TypeDescription type0 = typeSys.getType("NamedEntity");
Assert.assertNotNull(type0);
Assert.assertEquals("uima.tcas.Annotation", type0.getSupertypeName());
Assert.assertEquals(1, type0.getFeatures().length);
TypeDescription type1 = typeSys.getType("Person");
Assert.assertNotNull(type1);
Assert.assertEquals("NamedEntity", type1.getSupertypeName());
Assert.assertEquals(1, type1.getFeatures().length);
TypeDescription type2 = typeSys.getType("Place");
Assert.assertNotNull(type2);
Assert.assertEquals("NamedEntity", type2.getSupertypeName());
Assert.assertEquals(3, type2.getFeatures().length);
TypeDescription type3 = typeSys.getType("Org");
Assert.assertNotNull(type3);
Assert.assertEquals("uima.tcas.Annotation", type3.getSupertypeName());
Assert.assertEquals(0, type3.getFeatures().length);
TypeDescription type4 = typeSys.getType("DocumentStructure");
Assert.assertNotNull(type4);
Assert.assertEquals("uima.tcas.Annotation", type4.getSupertypeName());
Assert.assertEquals(0, type4.getFeatures().length);
TypeDescription type5 = typeSys.getType("Paragraph");
Assert.assertNotNull(type5);
Assert.assertEquals("DocumentStructure", type5.getSupertypeName());
Assert.assertEquals(0, type5.getFeatures().length);
TypeDescription type6 = typeSys.getType("Sentence");
Assert.assertNotNull(type6);
Assert.assertEquals("DocumentStructure", type6.getSupertypeName());
Assert.assertEquals(0, type6.getFeatures().length);
TypeDescription type7 = typeSys.getType("test.flowController.Test");
Assert.assertNotNull(type7);
Assert.assertEquals("uima.tcas.Annotation", type7.getSupertypeName());
Assert.assertEquals(1, type7.getFeatures().length);
// Place has merged features, Person has different supertype
assertEquals(2, mergedTypes.size());
assertTrue(mergedTypes.containsKey("Place"));
assertTrue(mergedTypes.containsKey("Person"));
// Type Priorities
Assert.assertNotNull(pri);
TypePriorityList[] priLists = pri.getPriorityLists();
Assert.assertEquals(3, priLists.length);
String[] list0 = priLists[0].getTypes();
String[] list1 = priLists[1].getTypes();
String[] list2 = priLists[2].getTypes();
// order of the three lists is not defined
Assert.assertTrue((list0.length == 2 && list1.length == 2 && list2.length == 3)
|| (list0.length == 2 && list1.length == 3 && list2.length == 2)
|| (list0.length == 3 && list1.length == 2 && list2.length == 2));
// Indexes
FsIndexDescription[] indexes = indexColl.getFsIndexes();
Assert.assertEquals(3, indexes.length);
// order of indexes is not defined
String label0 = indexes[0].getLabel();
String label1 = indexes[1].getLabel();
String label2 = indexes[2].getLabel();