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

HasValidMessageSelector

public class HasValidMessageSelector extends MessageBeanTest
Verify that message beans message-selector is valid
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();
        String messageSelector = descriptor.getJmsMessageSelector();
        if (messageSelector != null) {
            try {
                IASJmsUtil.validateJMSSelector(messageSelector);
        	result.addGoodDetails(smh.getLocalString
				       ("tests.componentNameConstructor",
					"For [ {0} ]",
					new Object[] {compName.toString()}));	
		result.passed(smh.getLocalString
	            ("com.sun.enterprise.tools.verifier.tests.ejb.messagebean.HasValidMessageSelector.failed",
                    "Message-driven bean [ {0} ] defines a valid message selector",
                    new Object[] {descriptor.getName()}));                                            
            } catch (Exception 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.HasValidMessageSelector.failed",
                    "Error : Message-driven bean [ {0} ] defines an invalid message selector",
                    new Object[] {descriptor.getName()}));                            
            }           
        } else {
	    result.addNaDetails(smh.getLocalString
				       ("tests.componentNameConstructor",
					"For [ {0} ]",
					new Object[] {compName.toString()}));
	    result.notApplicable(smh.getLocalString
		("com.sun.enterprise.tools.verifier.tests.ejb.messagebean.HasValidMessageSelector.notApplicable",
                 "Message-driven bean [ {0} ] does not define a message selector",
                new Object[] {descriptor.getName()}));            
        }
        return result;