Validator { public Document parse(InputStream xml) throws Exception { return parse(new InputSource(xml)); } Validator(String schema);  Validator(String schema, EntityResolver resolver); Document parse(InputStream xml); Document parse(Reader xml); Document parse(InputSource xml);  }
@Test public void testValidatorString() throws Exception { Validator v = createValidator(null); AdaptrisMessage msg = MessageHelper.createMessage(PROPERTIES.getProperty(XmlValidationServiceTest.KEY_INPUT_FILE)); try (InputStream in = msg.getInputStream()) { Document doc = v.parse(in); } try (Reader in = msg.getReader()) { Document doc = v.parse(in); } }
@Test public void testValidatorStringEntityResolver() throws Exception { Validator v = createValidator(new Resolver()); AdaptrisMessage msg = MessageHelper.createMessage(PROPERTIES.getProperty(XmlValidationServiceTest.KEY_INPUT_FILE)); try (InputStream in = msg.getInputStream()) { Document doc = v.parse(in); } try (Reader in = msg.getReader()) { Document doc = v.parse(in); } }