Result result = getInitializedResult();
ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
String entBeanName = null;
String ejbName = null;
try{
ejbName = descriptor.getName();
entBeanName = getXPathValue("sun-ejb-jar/enterprise-beans/name");
if(entBeanName == null){
result.setStatus(Result.NOT_APPLICABLE);
result.addNaDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.notApplicable(smh.getLocalString
(getClass().getName() + ".notApplicable",
"{0} Does not define any enterprise bean name",
new Object[] {ejbName}));
return result;
}
if(entBeanName!=null && entBeanName.length()==0){
result.addErrorDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.warning(smh.getLocalString
(getClass().getName() + ".warning",
"WARNING [AS-EJB enterprise-beans] : name should not be empty."));
return result;
}else{
result.addGoodDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.passed(smh.getLocalString
(getClass().getName() + ".passed",
"PASSED [AS-EJB enterprise-beans] : name is {0}",
new Object[] {entBeanName}));
return result;
}
}catch(Exception ex){
result.addErrorDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.addErrorDetails(smh.getLocalString
(getClass().getName() + ".notRun",
"NOT RUN [AS-EJB] : Could not create a descriptor object"));
return result;
}