FileDocCategorySizeDatePackage
EjbLogicalName.javaAPI DocGlassfish v2 API3645Fri May 04 22:33:32 BST 2007com.sun.enterprise.tools.verifier.tests.ejb

EjbLogicalName

public class EjbLogicalName extends EjbTest implements EjbCheck
Enterprise bean's name test. The Bean provider must assign a logical name to each enterprise bean in the ejb-jar file.

Fields Summary
Constructors Summary
Methods Summary
public Resultcheck(com.sun.enterprise.deployment.EjbDescriptor descriptor)
Enterprise bean's name test. The Bean provider must assign a logical name to each enterprise bean in the ejb-jar file.

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


        Result result = getInitializedResult();
        String ejbName = descriptor.getName();
        ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
        if (!ejbName.equals("")) {
            // as long as it's not blank, test should pass
            //result.passed("EJB logical name is : "+ejbName);
            addGoodDetails(result, compName);
            result.passed(smh.getLocalString
                    (getClass().getName() + ".passed",
                            "EJB logical name is: [ {0} ]",
                            new Object[] {ejbName}));
        } else {
            addErrorDetails(result, compName);
            // it's blank, test should not pass
            result.failed(smh.getLocalString
                    (getClass().getName() + ".failed",
                            "Error: EJB logical name cannot be blank."));
        }
        return result;