Object descriptor = UIMAFramework.getXMLParser().parse(new XMLInputSource(tsUrl));
TypeSystemDescription tsDesc = (TypeSystemDescription) descriptor;
tsDesc.addType("uima.ruta.T1", "", "uima.tcas.Annotation");
tsDesc.addType("uima.ruta.T2", "", "uima.tcas.Annotation");
tsDesc.addType("uima.ruta.T3", "", "uima.tcas.Annotation");
tsDesc.resolveImports();
TypePriorities typePriorities = UIMAFramework.getXMLParser().parseTypePriorities(new XMLInputSource(typePrioritiesUrl));
CAS cas = CasCreationUtils.createCas(tsDesc, typePriorities, new FsIndexDescription[0]);
cas.setDocumentText("Some document.");