public void testSetupTypeSystem() throws Exception {
try {
// test that duplicate feature names on supertype and subtype works
// regardless of the order in which the types appear in the TypeSystemDescription
TypeSystemDescription tsd1 = new TypeSystemDescription_impl();
TypeDescription supertype = tsd1.addType("test.Super", "", "uima.cas.TOP");
supertype.addFeature("testfeat", "", "uima.cas.Integer");
TypeDescription subtype = tsd1.addType("test.Sub", "", "test.Super");
subtype.addFeature("testfeat", "", "uima.cas.Integer");
CASMgr casMgr = CASFactory.createCAS();
CasCreationUtils.setupTypeSystem(casMgr, tsd1);
assertNotNull(casMgr.getTypeSystemMgr().getType("test.Super")
.getFeatureByBaseName("testfeat"));
TypeSystemDescription tsd2 = new TypeSystemDescription_impl();
tsd2.setTypes(new TypeDescription[] { subtype, supertype });
casMgr = CASFactory.createCAS();
CasCreationUtils.setupTypeSystem(casMgr, tsd2);
assertNotNull(casMgr.getTypeSystemMgr().getType("test.Super")
.getFeatureByBaseName("testfeat"));