Result result = getInitializedResult();
ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
boolean oneFailed = false;
String refName;
EjbRef[] ejbRefs = (descriptor.getSunDescriptor()).getEjbRef();
if (ejbRefs!=null && ejbRefs.length > 0) {
for (int rep=0; rep<ejbRefs.length; rep++ ) {
refName = ejbRefs[rep].getEjbRefName();
if (validEjbRefName(refName,descriptor)) {
addGoodDetails(result, compName);
result.passed(smh.getLocalString
(getClass().getName() + ".passed",
"PASSED [AS-WEB ejb-ref] ejb-ref-name [ {0} ] properly defined in the war file.",
new Object[] {refName}));
} else {
oneFailed = true;
addErrorDetails(result, compName);
result.failed(smh.getLocalString
(getClass().getName() + ".failed",
"FAILED [AS-WEB ejb-ref] ejb-ref-name [ {0} ] is not valid, either empty or not defined in web.xml.",
new Object[] {refName}));
}
}
} else {
addNaDetails(result, compName);
result.notApplicable(smh.getLocalString
(getClass().getName() + ".notApplicable",
"NOT APPLICABLE [AS-WEB sun-web-app] ejb-ref element(s) not defined in the web archive [ {0} ].",
new Object[] {descriptor.getName()}));
return result;
}
if (oneFailed)
{
result.setStatus(Result.FAILED);
} else {
addGoodDetails(result, compName);
result.passed
(smh.getLocalString
(getClass().getName() + ".passed2",
"PASSED [AS-WEB sun-web-app] ejb-ref element(s) defined are valid within the web archive [ {0} ].",
new Object[] {descriptor.getName()} ));
}
return result;