final String baseLink = "lenya-document:" + target.getUUID() + ",lang="
+ target.getLanguage();
final String relativeLink = baseLink;
final String absoluteLink = relativeLink + ",pub=test";
SourceResolver sourceResolver = null;
LinkResolver resolver = null;
try {
resolver = (LinkResolver) getManager().lookup(LinkResolver.ROLE);
assertFalse(resolver.resolve(source, relativeLink).exists());
assertTrue(resolver.resolve(source, absoluteLink).exists());
sourceResolver = (SourceResolver) getManager().lookup(SourceResolver.ROLE);
String relativeUri = relativeLink + queryString;
String absoluteUri = absoluteLink + queryString;
Exception e = null;
try {
sourceResolver.resolveURI(relativeUri);
} catch (SourceNotFoundException ex) {
e = ex;
}
assertNotNull("SourceNotFoundException thrown", e);
sourceResolver.resolveURI(absoluteUri);
} finally {
if (resolver != null) {
getManager().release(resolver);
}