FileDocCategorySizeDatePackage
ASEjbPrincipal.javaAPI DocGlassfish v2 API4330Fri May 04 22:35:14 BST 2007com.sun.enterprise.tools.verifier.tests.ejb.ias

ASEjbPrincipal

public class ASEjbPrincipal extends com.sun.enterprise.tools.verifier.tests.ejb.EjbTest implements com.sun.enterprise.tools.verifier.tests.ejb.EjbCheck
ejb [0,n] principal ? name [String] The principal tag defines a username on the platform
author
Irfan Ahmed

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

	Result result = getInitializedResult();
	ComponentNameConstructor compName = new ComponentNameConstructor(descriptor);

        SunEjbJar ejbJar = descriptor.getEjbBundleDescriptor().getIasEjbObject();
        Ejb testCase = null;
        boolean oneFailed = false;
        
        if(ejbJar!=null)
        {
            testCase = super.getEjb(descriptor.getName(),ejbJar);
            
            Principal principal = testCase.getPrincipal();
            if(principal == null)
            {
                result.notApplicable(smh.getLocalString(getClass().getName()+".notApplicable",
                    "NOT APPLICABLE [AS-EJB ejb] : principal element not defined"));
            }
            else
            {
                String principalName = principal.getName();
                if(principalName.length()==0)
                {
                    result.failed(smh.getLocalString(getClass().getName()+".failed",
                        "FAILED [AS-EJB principal] : name cannot be an empty String"));
                }
                else
                {
                    result.passed(smh.getLocalString(getClass().getName()+".passed",
                        "PASSED [AS-EJB principal] : name is {0}", new Object[]{principalName}));
                }
            }
        }
        else
        {
            result.addErrorDetails(smh.getLocalString
                 (getClass().getName() + ".notRun",
                  "NOT RUN [AS-EJB] : Could not create an SunEjbJar object"));
        }
        return result;