UIMAXMLConverterHelper { public JCas deserialize(InputStream inputStream, JCas newElement) throws IOException, UIMAException, InterruptedException, SAXException { try { newElement.reset(); XCASDeserializer.deserialize(inputStream, newElement.getCas()); return newElement; } finally { IOUtils.closeQuietly(inputStream); } } UIMAXMLConverterHelper(boolean formattedOutput); String serialize(JCas jCas); boolean serialize(JCas jCas, OutputStream outputStream); JCas deserialize(InputStream inputStream, JCas newElement); static String sanitizeString(String input); JCas deserialize(String input, JCas newElement);  }
@Test public void testConvert() throws Exception { testCas.reset(); URL input = Resources.getResource("sampleCAS/websitesamplecas.xml"); converterHelper.deserialize(Resources.toString(input, Charsets.UTF_8), testCas); Collection<NamedEntity> namedEntities = JCasUtil.select(testCas, NamedEntity.class); for (NamedEntity namedEntity : namedEntities) { System.out.println(namedEntity.getType() + " " + namedEntity.getCoveredText()); } System.out.println(Joiner.on("").join(namedEntities)); Assert.assertThat(namedEntities, is(not(empty()))); }