"org.apache.xml.security.test.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");
try {
uriAttr.setValue("http://xmldsig.pothole.com/xml-stylesheet.txt");
res.resolve(uriAttr, null);
} 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);
fail(uriAttr.getValue() + " should not be resolvable by the OfflineResolver");
} catch (Exception e) {
//
}
}