FileDocCategorySizeDatePackage
ASEjbCommitOption.javaAPI DocGlassfish v2 API5382Fri May 04 22:35:12 BST 2007com.sun.enterprise.tools.verifier.tests.ejb.ias

ASEjbCommitOption

public class ASEjbCommitOption extends com.sun.enterprise.tools.verifier.tests.ejb.EjbTest implements com.sun.enterprise.tools.verifier.tests.ejb.EjbCheck
author
Irfan Ahmed irfan@sun.com

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

param
descriptor
return

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

        SunEjbJar ejbJar = descriptor.getEjbBundleDescriptor().getIasEjbObject();
        boolean oneFailed = false;
        
        if(ejbJar!=null)
        {
            Ejb testCase = getEjb(descriptor.getName(),ejbJar);
            String commitOption = testCase.getCommitOption();
            if(commitOption!=null)
            {
                if(commitOption.length()==0)
                {
                    result.failed(smh.getLocalString(getClass().getName()+".failed",
                        "FAILED [AS-EJB ejb] : commit-option cannot be an empty String"));
                }
                else
                {
                    if(!commitOption.equals("A") && !commitOption.equals("B") //4699329
                        && !commitOption.equals("C"))
                    {
                        result.failed(smh.getLocalString(getClass().getName()+".failed1",//4699329
                            "FAILED [AS-EJB ejb] : commit-option cannot be {0}. " +
                            "It must be one of A, B and "+
                            "C", new Object[]{commitOption}));
                    }
                    else
                    {
                        if(descriptor instanceof EjbEntityDescriptor)
                        {
                            result.passed(smh.getLocalString(getClass().getName()+".passed",
                                "PASSED [AS-EJB ejb] : commit-option is {0}", new Object[]{commitOption}));
                        }
                        else
                        {
                            result.warning(smh.getLocalString(getClass().getName()+".warning",
                                "WARNING [AS-EJB ejb] : commit-option should be defined only for an Entity Bean"));
                        }
                    }
                }
            }
            else
            {
                result.notApplicable(smh.getLocalString(getClass().getName()+".notApplicable",
                    "NOT APPLICABLE [AS-EJB ejb] commit-option Element is not defined"));
            }
        }
        else
        {
            result.addErrorDetails(smh.getLocalString
                 (getClass().getName() + ".notRun",
                  "NOT RUN [AS-EJB] : Could not create an SunEjbJar object"));
        }
        return result;