1 package com.sun.enterprise.tools.verifier.tests.ejb.ias; 2 3 25 26 import com.sun.enterprise.tools.verifier.tests.ejb.EjbTest; 27 import java.util.*; 28 import com.sun.enterprise.deployment.EjbDescriptor; 29 import com.sun.enterprise.deployment.EjbSessionDescriptor; 30 import com.sun.enterprise.tools.verifier.*; 31 import com.sun.enterprise.tools.verifier.tests.*; 32 33 import com.sun.enterprise.tools.verifier.tests.ejb.EjbCheck; 34 35 import com.sun.enterprise.tools.common.dd.*; 36 import com.sun.enterprise.tools.common.dd.ejb.*; 37 import com.sun.enterprise.deployment.ResourceReferenceDescriptor; 38 import com.sun.enterprise.deployment.EjbMessageBeanDescriptor; 39 40 41 51 public class ASEjbJMSDurableSubscriptionName extends EjbTest implements EjbCheck { 52 53 public Result check(EjbDescriptor descriptor) 54 { 55 Result result = getInitializedResult(); 56 ComponentNameConstructor compName = new ComponentNameConstructor(descriptor); 57 58 SunEjbJar ejbJar = descriptor.getEjbBundleDescriptor().getIasEjbObject(); 59 boolean oneFailed = false; 60 61 if(ejbJar!=null) 62 { 63 Ejb testCase = super.getEjb(descriptor.getName(),ejbJar); 64 String jmsDurableName = testCase.getJmsDurableSubscriptionName(); 65 if(jmsDurableName != null) 66 { 67 if(jmsDurableName.length()==0) 68 { 69 result.failed(smh.getLocalString(getClass().getName()+".failed", 70 "FAILED [AS-EJB ejb] : jms-durable-subscription-name cannot be an empty string value")); 71 } 72 else 73 { 74 result.passed(smh.getLocalString(getClass().getName()+".passed", 75 "PASSED [AS-EJB ejb] : jms-durable-subscription-name is {0}", new Object []{jmsDurableName})); 76 } 77 } 78 else 79 { 80 if(descriptor instanceof EjbMessageBeanDescriptor) 81 { 82 EjbMessageBeanDescriptor msgBeanDesc = (EjbMessageBeanDescriptor)descriptor; 83 if(msgBeanDesc.hasTopicDest() && msgBeanDesc.hasDurableSubscription()) 84 { 85 result.failed(smh.getLocalString(getClass().getName()+".failed", 86 "FAILED [AS-EJB ejb] : jms-durable-subscription-name should be defined for an MDB with"+ 87 " destination type Topic and Durable subscription type")); 88 } 89 else 90 { 91 result.notApplicable(smh.getLocalString(getClass().getName()+".notApplicable", 92 "NOT APPLICABLE [AS-EJB ejb] : jms-durable-subscription-name element is not defined")); 93 } 94 } 95 else 96 { 97 result.notApplicable(smh.getLocalString(getClass().getName()+".notApplicable", 98 "NOT APPLICABLE [AS-EJB ejb] : jms-durable-subscription-name element is not defined")); 99 } 100 } 101 } 102 else 103 { 104 result.addErrorDetails(smh.getLocalString 105 (getClass().getName() + ".notRun", 106 "NOT RUN [AS-EJB] : Could not create an SunEjbJar object")); 107 } 108 return result; 109 } 110 } 111 | Popular Tags |