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

SelectMethodReturnType

public class SelectMethodReturnType extends SelectMethodTest
Select methods must not return the entity bean class
author
Jerome Dochez
version

Fields Summary
Constructors Summary
Methods Summary
protected booleanrunIndividualSelectTest(java.lang.reflect.Method m, EjbCMPEntityDescriptor descriptor, com.sun.enterprise.tools.verifier.Result result)

run an individual test against a declared ejbSelect method

param
m is the ejbSelect method
param
descriptor is the entity declaring the ejbSelect
param
result is where to put the result
return
true if the test passes

        ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
        if (m.getReturnType().getName().equals(descriptor.getEjbClassName())) {
	    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.SelectMethodReturnType.failed",
                "Error : [ {0} ] ejbSelect method returns the {1} class",
		new Object[] {m.getName(), "entity bean"}));                                                    
            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.SelectMethodReturnType.passed",
            "[ {0} ] ejbSelect method does not return the {1} class",
		new Object[] {m.getName(), "entity bean"}));                                                    
            return true;        
        }