+ @Test
+ public void testReadAndValidateOkUseClasspath() throws Exception {
+
+ XMLDocument xmldoc = xmldocument("test.xml", getResource("test.xml")).validate(
+ "test.xsd", new ClasspathUriResolver("org/wamblee/xml"));
+ Document doc = xmldoc.getDocument();
+ Element element = doc.getDocumentElement();
+ assertEquals("http://wamblee.org/test", element.getNamespaceURI());
+
+ String val = xmldoc.print(false);
+ // parse the written document
+ Document doc2 = xmldocument("input.xml", new ByteArrayInputStream(val.getBytes())).getDocument();
+ XmlUtils.assertEquals("", doc, doc2);
+ }
+
+ @Test(expected = XMLException.class)
+ public void testSchemaNotFoundUseClasspath() throws Exception {
+
+ XMLDocument xmldoc = xmldocument("test.xml", getResource("test.xml")).validate(
+ "test.xsd.unknown", new ClasspathUriResolver("org/wamblee/xml"));
+ }
+
+