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

MessageBeanTest

public abstract class MessageBeanTest extends com.sun.enterprise.tools.verifier.tests.ejb.EjbTest
Superclass for all the Message Bean tests
author
Jerome Dochez
version

Fields Summary
ComponentNameConstructor
compName
Constructors Summary
Methods Summary
public abstract 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

public com.sun.enterprise.tools.verifier.Resultcheck(com.sun.enterprise.deployment.EjbDescriptor descriptor)
Container-managed persistent fields test, iterates over all declared cmp fields and invoke the runIndividualCmpFieldTest nethod

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


                                           
        
        
        if (descriptor instanceof EjbMessageBeanDescriptor) {
            return check((EjbMessageBeanDescriptor) descriptor);
        } else {
            Result result = getInitializedResult();
	    compName = getVerifierContext().getComponentNameConstructor(); 
	    result.addNaDetails(smh.getLocalString
				   ("tests.componentNameConstructor",
				    "For [ {0} ]",
				    new Object[] {compName.toString()}));
	    result.notApplicable(smh.getLocalString
		("com.sun.enterprise.tools.verifier.tests.ejb.messagebean.MessageBeanTest.notApplicable",
		 "Test apply only to message-driven Bean components"));
            return result;                                
        }
    
protected java.lang.ClassloadMessageBeanClass(com.sun.enterprise.deployment.EjbMessageBeanDescriptor descriptor, com.sun.enterprise.tools.verifier.Result result)

load the declared message bean class from the archive

param
descriptor deployment descriptor for the message bean
param
result result to use if failure
return
the message bean class

        try {
	    compName = getVerifierContext().getComponentNameConstructor();
            Context context = getVerifierContext();
	    ClassLoader jcl = context.getClassLoader();
            return Class.forName(descriptor.getEjbClassName(), false, getVerifierContext().getClassLoader());
        } catch (ClassNotFoundException e) {
            Verifier.debug(e);
	    result.addErrorDetails(smh.getLocalString
				   ("tests.componentNameConstructor",
				    "For [ {0} ]",
				    new Object[] {compName.toString()}));
	    result.failed(smh.getLocalString
	       ("com.sun.enterprise.tools.verifier.tests.ejb.messagebean.classnotfoundexception",
               "Cannot load declared message-driven bean component [ {0} ]"));        
            return null;
        }