FileDocCategorySizeDatePackage
ASEntBeanName.javaAPI DocGlassfish v2 API5042Fri May 04 22:34:04 BST 2007com.sun.enterprise.tools.verifier.tests.ejb.runtime

ASEntBeanName

public class ASEntBeanName extends com.sun.enterprise.tools.verifier.tests.ejb.EjbTest implements com.sun.enterprise.tools.verifier.tests.ejb.EjbCheck
enterprise-bean name ? [String] This is the name of the enterprise bean module
author
Irfan Ahmmed

Fields Summary
Constructors Summary
Methods Summary
public Resultcheck(com.sun.enterprise.deployment.EjbDescriptor descriptor)

param
descriptor the Enterprise Java Bean deployment descriptor
return
Result the results for this assertion


	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;
        }