1 23 24 package com.sun.enterprise.tools.verifier.tests.ejb.messagebean; 25 26 import java.lang.reflect.Method ; 27 import com.sun.enterprise.deployment.EjbMessageBeanDescriptor; 28 import com.sun.enterprise.tools.verifier.Result; 29 import com.sun.enterprise.tools.verifier.tests.*; 30 31 32 39 public class EjbCreateExists extends MessageBeanTest { 40 41 46 protected String getMethodName() { 47 return "ejbCreate"; 48 } 49 50 58 public Result check(EjbMessageBeanDescriptor descriptor) { 59 60 Result result = getInitializedResult(); 61 ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor(); 62 Class mbc = loadMessageBeanClass(descriptor, result); 63 if (mbc!=null) { 64 Method m = getMethod(mbc, getMethodName(),null); 65 if (m!=null) { 66 result.addGoodDetails(smh.getLocalString 67 ("tests.componentNameConstructor", 68 "For [ {0} ]", 69 new Object [] {compName.toString()})); 70 result.passed(smh.getLocalString 71 ("com.sun.enterprise.tools.verifier.tests.ejb.messagebean.EjbCreateExists.passed", 72 "Message-Drive bean [ {0} ] provide an {1} implementation with no argument", 73 new Object [] {(descriptor).getEjbClassName(),getMethodName()})); 74 } else { 75 result.addErrorDetails(smh.getLocalString 76 ("tests.componentNameConstructor", 77 "For [ {0} ]", 78 new Object [] {compName.toString()})); 79 result.failed(smh.getLocalString 80 ("com.sun.enterprise.tools.verifier.tests.ejb.messagebean.EjbCreateExists.failed", 81 "Error: Message-Drive bean [ {0} ] does not implement an {1} with no arguments", 82 new Object [] {(descriptor).getEjbClassName(), getMethodName()})); 83 } 84 } 85 return result; 86 } 87 } 88 | Popular Tags |