FileDocCategorySizeDatePackage
EjbCreateModifiers.javaAPI DocGlassfish v2 API5144Fri May 04 22:34:04 BST 2007com.sun.enterprise.tools.verifier.tests.ejb.messagebean

EjbCreateModifiers

public class EjbCreateModifiers extends MessageBeanTest
Verify that message beans implement the ejbCreate method with a void return type
author
Jerome Dochez
version

Fields Summary
Constructors Summary
Methods Summary
public com.sun.enterprise.tools.verifier.Resultcheck(com.sun.enterprise.deployment.EjbMessageBeanDescriptor descriptor)
Run a verifier test against an individual declared message drive bean component

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

        
        Result result = getInitializedResult();
	ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
        Class mbc = loadMessageBeanClass(descriptor, result);
        if (mbc!=null) {
            Method m = getMethod(mbc, getMethodName(),null);
            if (m!=null) {
                int modifiers = m.getModifiers();
                if (Modifier.isPublic(modifiers) && !Modifier.isStatic(modifiers) && !Modifier.isFinal(modifiers)) {
                    result.addGoodDetails(smh.getLocalString
					  ("tests.componentNameConstructor",
					   "For [ {0} ]",
					   new Object[] {compName.toString()}));	
			
		    result.passed(smh.getLocalString
    		        ("com.sun.enterprise.tools.verifier.tests.ejb.messagebean.EjbCreateModifiers.passed",
                        "Message-Drive bean [ {0} ] provide an {1} implementation declared public and not static or final",
	                new Object[] {(descriptor).getEjbClassName(), getMethodName()}));                    
                } else {
		    result.addErrorDetails(smh.getLocalString
					   ("tests.componentNameConstructor",
					    "For [ {0} ]",
					    new Object[] {compName.toString()}));
		    result.failed(smh.getLocalString
		        ("com.sun.enterprise.tools.verifier.tests.ejb.messagebean.EjbCreateModifiers.failed",
                        "Error: Message-Drive bean [ {0} ] {1} implementation is either not public or is static or final",
	                new Object[] {(descriptor).getEjbClassName(), getMethodName()}));                       
                } 
            } else {
		result.addErrorDetails(smh.getLocalString
				       ("tests.componentNameConstructor",
					"For [ {0} ]",
					new Object[] {compName.toString()}));
		result.failed(smh.getLocalString
		    ("com.sun.enterprise.tools.verifier.tests.ejb.messagebean.EjbCreateExists.failed",
                    "Error: Message-Drive bean [ {0} ] does not implement an {1} with no arguments",
	            new Object[] {(descriptor).getEjbClassName(), getMethodName()}));                       
            }                
        }         
        return result;
    
protected java.lang.StringgetMethodName()

return
the name of the method on the message bean this test applies to

        return "ejbCreate";