FileDocCategorySizeDatePackage
SelectMethodTest.javaAPI DocGlassfish v2 API4070Fri May 04 22:33:40 BST 2007com.sun.enterprise.tools.verifier.tests.ejb.entity.cmp2

SelectMethodTest

public abstract class SelectMethodTest extends CMPTest
author
dochez
version

Fields Summary
Constructors Summary
Methods Summary
public com.sun.enterprise.tools.verifier.Resultcheck(EjbCMPEntityDescriptor descriptor)

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

        
        boolean allIsWell = true;
        Result result = getInitializedResult();
	boolean found = false;        
	ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();

        Class ejbClass = loadEjbClass(descriptor, result);
        if (ejbClass!=null) {
            Method[] methods = ejbClass.getDeclaredMethods();
	    if (methods != null) {
		for (int i=0;i<methods.length;i++) {
		    String methodName = methods[i].getName();
		    if (methodName.startsWith("ejbSelect")) {
			found = true;
			if (!runIndividualSelectTest(methods[i], (EjbCMPEntityDescriptor) descriptor, result))
			    allIsWell=false;
		    }
		}
		if (found == false) {
		    result.addNaDetails(smh.getLocalString
				       ("tests.componentNameConstructor",
					"For [ {0} ]",
					new Object[] {compName.toString()}));
		    result.notApplicable(smh.getLocalString
					  ("com.sun.enterprise.tools.verifier.tests.ejb.entity.cmp2.SelectMethodTest.nptApplicable",
					   "Not Applicable : No select methods found",
					   new Object[] {}));     
		}
        if (result.getStatus() != Result.NOT_APPLICABLE) {    
            if (allIsWell) 
                result.setStatus(Result.PASSED);
            else 
                result.setStatus(Result.FAILED);            
            }
        }
	}    
	return result;
    
protected abstract booleanrunIndividualSelectTest(java.lang.reflect.Method m, EjbCMPEntityDescriptor descriptor, com.sun.enterprise.tools.verifier.Result result)