"org.apache.xml.security.test.dom.utils.resolver.OfflineResolver";
ResourceResolver.registerAtStart(className);
Document doc = XMLUtils.createDocumentBuilder(false).newDocument();
Attr uriAttr = doc.createAttribute("URI");
uriAttr.setValue("http://www.apache.org");
ResourceResolver res =
ResourceResolver.getInstance(uriAttr, "http://www.apache.org", true);
try {
uriAttr.setValue("http://xmldsig.pothole.com/xml-stylesheet.txt");
res.resolve(uriAttr, null, true);
} catch (Exception e) {
e.printStackTrace();
fail(uriAttr.getValue()
+ " should be resolvable by the OfflineResolver");
}
try {
uriAttr.setValue("http://www.apache.org");
res.resolve(uriAttr, null, true);
fail(uriAttr.getValue() + " should not be resolvable by the OfflineResolver");
} catch (Exception e) {
//
}
}