Result result = getInitializedResult();
ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
boolean oneFailed = false;
try{
if (descriptor.getUsesCallerIdentity() == false){
RunAsIdentityDescriptor runAsIdDesc = descriptor.getRunAsIdentity();
if (runAsIdDesc != null){
String principal = runAsIdDesc.getPrincipal();
if (principal == null){
addNaDetails(result, compName);
result.notApplicable(smh.getLocalString(getClass().getName()+".notApplicable",
"NOT APPLICABLE [AS-EJB ejb] : principal element not defined"));
}else{
if(principal.length()==0){
addErrorDetails(result, compName);
result.failed(smh.getLocalString(getClass().getName()+".failed",
"FAILED [AS-EJB principal] : name cannot be an empty String"));
}else{
addGoodDetails(result, compName);
result.passed(smh.getLocalString(getClass().getName()+".passed",
"PASSED [AS-EJB principal] : name is {0}", new Object[]{principal}));
}
}
}
}else{
addNaDetails(result, compName);
result.notApplicable(smh.getLocalString(getClass().getName()+".notApplicable",
"NOT APPLICABLE [AS-EJB ejb] run-as Element is not defined"));
}
}catch(Exception ex){
addErrorDetails(result, compName);
result.addErrorDetails(smh.getLocalString
(getClass().getName() + ".notRun",
"NOT RUN [AS-EJB] : Could not create an SunEjbJar object"));
}
return result;