FileDocCategorySizeDatePackage
ASEjbResEnvRef.javaAPI DocGlassfish v2 API5273Fri May 04 22:35:16 BST 2007com.sun.enterprise.tools.verifier.tests.ejb.ias.resource

ASEjbResEnvRef

public class ASEjbResEnvRef extends com.sun.enterprise.tools.verifier.tests.ejb.EjbTest implements com.sun.enterprise.tools.verifier.tests.ejb.EjbCheck
ejb [0,n] resource-env-ref [0,n] resource-env-ref-name [String] jndi-name [String] The resource-env-ref holds all the runtime bindings for a resource environment reference
author
Irfan Ahmed

Fields Summary
public com.sun.enterprise.tools.common.dd.ejb.Ejb
testCase
public com.sun.enterprise.tools.common.dd.ResourceEnvRef[]
resRefs
public Result
result
public ComponentNameConstructor
compName
Constructors Summary
Methods Summary
public Resultcheck(com.sun.enterprise.deployment.EjbDescriptor descriptor)

        SunEjbJar ejbJar = descriptor.getEjbBundleDescriptor().getIasEjbObject();
        boolean oneFailed = false;
        
        if(ejbJar!=null)
        {
            getEjb(descriptor,ejbJar);
            if(resRefs.length > 0)
            {
                for(int j=0;j<resRefs.length;j++)
                {
                    String refName = resRefs[j].getResourceEnvRefName();
                    try
                    {
                        descriptor.getJmsDestinationReferenceByName(refName);
                        result.passed(smh.getLocalString(getClass().getName()+".passed",
                            "PASSED [AS-EJB resource-env-ref] : res-env-ref-name {0} is verified with ejb-jar.xml",
                            new Object[]{refName}));
                    }
                    catch(IllegalArgumentException iaex)
                    {
                        Verifier.debug(iaex);
                        result.failed(smh.getLocalString(getClass().getName()+".failed",
                            "FAILED [AS-EJB resource-env-ref] : The res-env-ref-name {0} is not defined in ejb-jar.xml for this bean",
                            new Object[]{refName}));
                    }
                }
            }
            else
            {
                 result.notApplicable(smh.getLocalString
                         (getClass().getName() + ".notApplicable",
                          "{0} Does not define any resource-env-ref Elements",
                          new Object[] {descriptor.getName()}));
            }
        }
        else
        {
            result.addErrorDetails(smh.getLocalString
                 (getClass().getName() + ".notRun",
                  "NOT RUN [AS-EJB] : Could not create an SunEjbJar object"));
        }
        return result;
    
public voidgetEjb(com.sun.enterprise.deployment.EjbDescriptor desc, com.sun.enterprise.tools.common.dd.ejb.SunEjbJar iasJar)

    
         
    
        testCase = super.getEjb(desc.getName(),iasJar);
        result = getInitializedResult();
        compName = new ComponentNameConstructor(desc);
        resRefs = testCase.getResourceEnvRef();