1 23 package com.sun.enterprise.tools.verifier.tests.ejb.beanclass; 24 25 import java.lang.reflect.Method ; 26 import com.sun.enterprise.deployment.EjbDescriptor; 27 import com.sun.enterprise.tools.verifier.Result; 28 import com.sun.enterprise.tools.verifier.tests.ejb.EjbTest; 29 import com.sun.enterprise.tools.verifier.tests.*; 30 31 35 public class EjbClassFinalizeMethod extends EjbTest { 36 37 38 39 47 public Result check(EjbDescriptor descriptor) { 48 49 Result result = getInitializedResult(); 50 ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor(); 51 52 Class c = loadEjbClass(descriptor, result); 53 if (c!=null) { 54 55 Method m = getDeclaredMethod(c, "finalize", null); 56 57 if (m!=null) { 58 result.addErrorDetails(smh.getLocalString 59 ("tests.componentNameConstructor", 60 "For [ {0} ]", 61 new Object [] {compName.toString()})); 62 result.failed(smh.getLocalString 63 (getClass().getName() + ".failed", 64 "Error: The bean class [ {0} ] must not define the " + 65 "\n finalize() method.", 66 new Object [] {descriptor.getEjbClassName()})); 67 } else { 68 result.addGoodDetails(smh.getLocalString 69 ("tests.componentNameConstructor", 70 "For [ {0} ]", 71 new Object [] {compName.toString()})); 72 result.passed(smh.getLocalString 73 (getClass().getName() + ".passed", 74 "Valid: This bean class [ {0} ] correctly does not " + 75 "\n define the finalize() method.", 76 new Object [] {descriptor.getEjbClassName()})); 77 } 78 } 79 return result; 80 } 81 } 82 | Popular Tags |