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

FindMethodsAbstract

public class FindMethodsAbstract extends QueryMethodTest
Finder method implementation test EJB 2.0 Spec 9.7.1 Entity bean class must not implement the ejbFind
author
Jerome Dochez
version

Fields Summary
Constructors Summary
Methods Summary
protected booleanrunIndividualQueryTest(java.lang.reflect.Method method, EjbCMPEntityDescriptor descriptor, java.lang.Class targetClass, com.sun.enterprise.tools.verifier.Result result)

Run an individual test against a finder method (single or multi)

param
method is the finder method reference
param
descriptor is the entity bean descriptor
param
targetClass is the class to apply to tests to
param
result is where to place the result
return
true if the test passes

        ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();                
        // single or multi finder
        String methodName = method.getName();
        String ejbMethodName = "ejb" + Character.toUpperCase(methodName.charAt(0)) + methodName.substring(1);
        Method ejbMethod = getMethod(targetClass, methodName, method.getParameterTypes());
        if (ejbMethod != null) {
	    result.addErrorDetails(smh.getLocalString
				       ("tests.componentNameConstructor",
					"For [ {0} ]",
					new Object[] {compName.toString()}));
            result.addErrorDetails(smh.getLocalString
		("com.sun.enterprise.tools.verifier.tests.ejb.entity.cmp2.FindMethodsAbstract.failed",
                "Error : [ {0} ] is defined in bean class [ {1} ]",
		new Object[] {ejbMethodName , targetClass.getName()}));       
            return false;
        } else {
	    result.addGoodDetails(smh.getLocalString
				       ("tests.componentNameConstructor",
					"For [ {0} ]",
					new Object[] {compName.toString()}));
            result.addGoodDetails(smh.getLocalString
		("com.sun.enterprise.tools.verifier.tests.ejb.entity.cmp2.FindMethodsAbstract.passed",
                "[ {0} ] is not defined in bean class [ {1} ]",
		new Object[] {ejbMethodName , targetClass.getName()}));       
            return true;
        }