Result result = getInitializedResult();
ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
boolean oneFailed = false;
try
{
Set resRef = descriptor.getResourceReferenceDescriptors();
if(!(resRef.isEmpty()))
{
Iterator it = resRef.iterator();
while (it.hasNext())
{
ResourceReferenceDescriptor resDesc = ((ResourceReferenceDescriptor)it.next());
String refName = resDesc.getName();
if(refName == null || refName.length()==0)
{
addErrorDetails(result, compName);
result.failed(smh.getLocalString(getClass().getName()+".failed",
"FAILED [AS-EJB resource-ref] : resource-ref has empty res-ref-name"));
}
else
{
addGoodDetails(result, compName);
result.passed(smh.getLocalString(getClass().getName()+".passed",
"PASSED [AS-EJB resource-ref] : res-ref-name is {0}",new Object[]{refName}));
}
}
}
else
{
addNaDetails(result, compName);
result.notApplicable(smh.getLocalString
(getClass().getName() + ".notApplicable",
"{0} Does not define any resource-ref Elements",
new Object[] {descriptor.getName()}));
}
}catch(Exception ex)
{
addErrorDetails(result, compName);
result.addErrorDetails(smh.getLocalString
(getClass().getName() + ".notRun",
"NOT RUN [AS-EJB] : Could not create the descriptor object"));
}
return result;