Resource Ref Name must be of finite length.
Set resourceRefs;
ResourceReferenceDescriptor resrefDes;
Iterator itr;
String resrefName;
Result result = getInitializedResult();
ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
//boolean foundIt = false;
boolean oneFailed = false;
boolean notApp = false;
if (!descriptor.getResourceReferenceDescriptors().isEmpty()) {
// get the Resource Reference Descriptors set
resourceRefs = descriptor.getResourceReferenceDescriptors();
itr = resourceRefs.iterator();
// test the Resource Reference Descriptor
while (itr.hasNext()) {
resrefDes = (ResourceReferenceDescriptor)itr.next();
resrefName = resrefDes.getName();
if (resrefName.length() != 0) {
// foundIt = true;
result.addGoodDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.addGoodDetails(smh.getLocalString
(getClass().getName() + ".passed",
"Resource Reference exists in the web application."));
} else {
if (!oneFailed)
oneFailed = true;
result.addErrorDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.addErrorDetails(smh.getLocalString
(getClass().getName() + ".failed",
"Error: Resource reference entry must be of finite length."));
}
}
} else {
notApp = true;
result.addNaDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.notApplicable(smh.getLocalString
(getClass().getName() + ".notApplicable",
"There are no resource references defined within the web archive [ {0} ]",
new Object[] {descriptor.getName()}));
}
if (oneFailed) {
result.setStatus(Result.FAILED);
} else if(notApp) {
result.setStatus(Result.NOT_APPLICABLE);
}else {
result.setStatus(Result.PASSED);
}
return result;