FileDocCategorySizeDatePackage
EjbClassFinalizeMethod.javaAPI DocGlassfish v2 API4045Fri May 04 22:33:32 BST 2007com.sun.enterprise.tools.verifier.tests.ejb.beanclass

EjbClassFinalizeMethod

public class EjbClassFinalizeMethod extends com.sun.enterprise.tools.verifier.tests.ejb.EjbTest
Enterprise Java Bean class constuctor test. The class must not define the finalize() method.

Fields Summary
Constructors Summary
Methods Summary
public com.sun.enterprise.tools.verifier.Resultcheck(com.sun.enterprise.deployment.EjbDescriptor descriptor)
Enterprise Java Bean class constuctor test. The class must not define the finalize() method.

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


	Result result = getInitializedResult();
	ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();

        Class c = loadEjbClass(descriptor, result);
        if (c!=null) {
            
            Method m = getDeclaredMethod(c, "finalize", null);

            if (m!=null) {
		result.addErrorDetails(smh.getLocalString
				       ("tests.componentNameConstructor",
					"For [ {0} ]",
					new Object[] {compName.toString()}));
                result.failed(smh.getLocalString
                    (getClass().getName() + ".failed",
                    "Error: The bean class [ {0} ] must not define the " +
                    "\n finalize() method.",
                    new Object[] {descriptor.getEjbClassName()}));
            } else {
		result.addGoodDetails(smh.getLocalString
				      ("tests.componentNameConstructor",
				       "For [ {0} ]",
				       new Object[] {compName.toString()}));
                result.passed(smh.getLocalString
                    (getClass().getName() + ".passed",
                    "Valid: This bean class [ {0} ] correctly does not " +
                    "\n define the finalize() method.",
                new Object[] {descriptor.getEjbClassName()}));
            }
        }
        return result;