@Test public void testInvalidFile() { File xmlFile = Files.fromResource("BrokenService.xml"); Document xml = XmlUtil.parse(xmlFile, resolver); try { new XmlValidator(resolver).validate(xml); fail("Should have thrown an exception"); } catch (Exception e) { assertTrue("Should have validation error about invalid element, instead got: " + e, e.getMessage().contains("AnInvalidElement")); } }
public void validate(Document doc) { try { doValidate(doc); } catch (Exception e) { throw new PluginException("Error validating document: " + e, e); } }
XmlValidator { public void validate(Document doc) { try { doValidate(doc); } catch (Exception e) { throw new PluginException("Error validating document: " + e, e); } } }
XmlValidator { public void validate(Document doc) { try { doValidate(doc); } catch (Exception e) { throw new PluginException("Error validating document: " + e, e); } } XmlValidator(InterceptingResolver resolver); }
XmlValidator { public void validate(Document doc) { try { doValidate(doc); } catch (Exception e) { throw new PluginException("Error validating document: " + e, e); } } XmlValidator(InterceptingResolver resolver); void validate(Document doc); }
XmlValidator { public void validate(Document doc) { try { doValidate(doc); } catch (Exception e) { throw new PluginException("Error validating document: " + e, e); } } XmlValidator(InterceptingResolver resolver); void validate(Document doc);  }