XMLTermTemplateIO implements TermTemplateIO { @Override public List<TermTemplate> readTemplates(InputStream inputStream) throws IOException { return reader.readTemplates(inputStream); } @Inject  XMLTermTemplateIO(OntologyConfiguration ontologyConfiguration); @Override void writeTemplates(Collection<TermTemplate> templates, OutputStream outputStream); @Override List<TermTemplate> readTemplates(InputStream inputStream);  }
@Test public void testTemplateIO() throws IOException { List<TermTemplate> templates0 = instance.readTemplates(loadResource("termgenie_rules_simple.xml")); String xmlString1 = write(templates0); List<TermTemplate> templates1 = read(xmlString1); assertTemplateList(templates0, templates1); String xmlString2 = write(templates1); List<TermTemplate> templates2 = read(xmlString1); assertTemplateList(templates0, templates2); assertEquals(xmlString1, xmlString2); }