use of nl.nn.adapterframework.testutil.TestScopeProvider in project iaf by ibissource.
the class XmlUtilsTest method testIdentityTransformWithDefaultEntityResolver.
@Test
public void testIdentityTransformWithDefaultEntityResolver() throws Exception {
// External EntityResolving is still possible with the XMLEntityResolver
Resource resource = Resource.getResource(new TestScopeProvider(), "XmlUtils/EntityResolution/in-file-entity-c-temp.xml");
SAXException thrown = assertThrows(SAXException.class, () -> {
XmlUtils.parseXml(resource, new XmlWriter());
});
String errorMessage = "Cannot get resource for publicId [null] with systemId [file:///c:/temp/test.xml] in scope [URLResource ";
assertTrue("SaxParseException should start with [Cannot get resource ...] but is [" + thrown.getMessage() + "]", thrown.getMessage().startsWith(errorMessage));
}
Aggregations