.tld file exists test.
Result result = getInitializedResult();
ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
boolean passed = true;
TagLibConfigurationDescriptor taglibDescriptor;
String taglibLocation;
Enumeration taglibConfig = (new Vector()).elements();
if (descriptor.getJspConfigDescriptor() != null) {
taglibConfig = descriptor.getJspConfigDescriptor().getTagLibs();
}
if (taglibConfig.hasMoreElements()){
while (taglibConfig.hasMoreElements()) {
// test all the Tag lib descriptors.
taglibDescriptor = (TagLibConfigurationDescriptor) taglibConfig.nextElement();
taglibLocation = taglibDescriptor.getTagLibLocation();
if(passed == false)
check(descriptor, taglibLocation, result);
else
passed = check(descriptor, taglibLocation, result);
}
} else {
result.addNaDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.notApplicable(smh.getLocalString
(getClass().getName() + ".notApplicable",
"There are no TagLibConfigurationDescriptors within the web archive [ {0} ]",
new Object[] {descriptor.getName()}));
result.setStatus(Result.NOT_APPLICABLE);
return result;
}
if ( passed) {
result.setStatus(Result.PASSED);
} else {
result.setStatus(Result.FAILED);
}
return result;