1 23 24 25 package com.sun.enterprise.tools.verifier.tests.ejb.messagebean; 26 27 import com.sun.enterprise.deployment.EjbMessageBeanDescriptor; 28 import com.sun.enterprise.tools.verifier.Result; 29 import com.sun.enterprise.jms.IASJmsUtil; 30 import com.sun.enterprise.tools.verifier.tests.*; 31 32 33 39 public class HasValidMessageSelector extends MessageBeanTest { 40 41 49 public Result check(EjbMessageBeanDescriptor descriptor) { 50 51 Result result = getInitializedResult(); 52 ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor(); 53 String messageSelector = descriptor.getJmsMessageSelector(); 54 if (messageSelector != null) { 55 try { 56 IASJmsUtil.validateJMSSelector(messageSelector); 57 result.addGoodDetails(smh.getLocalString 58 ("tests.componentNameConstructor", 59 "For [ {0} ]", 60 new Object [] {compName.toString()})); 61 result.passed(smh.getLocalString 62 ("com.sun.enterprise.tools.verifier.tests.ejb.messagebean.HasValidMessageSelector.failed", 63 "Message-driven bean [ {0} ] defines a valid message selector", 64 new Object [] {descriptor.getName()})); 65 } catch (Exception e) { 66 result.addErrorDetails(smh.getLocalString 67 ("tests.componentNameConstructor", 68 "For [ {0} ]", 69 new Object [] {compName.toString()})); 70 result.failed(smh.getLocalString 71 ("com.sun.enterprise.tools.verifier.tests.ejb.messagebean.HasValidMessageSelector.failed", 72 "Error : Message-driven bean [ {0} ] defines an invalid message selector", 73 new Object [] {descriptor.getName()})); 74 } 75 } else { 76 result.addNaDetails(smh.getLocalString 77 ("tests.componentNameConstructor", 78 "For [ {0} ]", 79 new Object [] {compName.toString()})); 80 result.notApplicable(smh.getLocalString 81 ("com.sun.enterprise.tools.verifier.tests.ejb.messagebean.HasValidMessageSelector.notApplicable", 82 "Message-driven bean [ {0} ] does not define a message selector", 83 new Object [] {descriptor.getName()})); 84 } 85 return result; 86 } 87 } 88 | Popular Tags |