Result result = getInitializedResult();
ComponentNameConstructor compName = new ComponentNameConstructor(descriptor);
SunEjbJar ejbJar = descriptor.getEjbBundleDescriptor().getIasEjbObject();
boolean oneFailed = false;
if(ejbJar!=null)
{
Ejb testCase = super.getEjb(descriptor.getName(),ejbJar);
String jmsDurableName = testCase.getJmsDurableSubscriptionName();
if(jmsDurableName != null)
{
if(jmsDurableName.length()==0)
{
result.failed(smh.getLocalString(getClass().getName()+".failed",
"FAILED [AS-EJB ejb] : jms-durable-subscription-name cannot be an empty string value"));
}
else
{
result.passed(smh.getLocalString(getClass().getName()+".passed",
"PASSED [AS-EJB ejb] : jms-durable-subscription-name is {0}", new Object[]{jmsDurableName}));
}
}
else
{
if(descriptor instanceof EjbMessageBeanDescriptor)
{
EjbMessageBeanDescriptor msgBeanDesc = (EjbMessageBeanDescriptor)descriptor;
if(msgBeanDesc.hasTopicDest() && msgBeanDesc.hasDurableSubscription())
{
result.failed(smh.getLocalString(getClass().getName()+".failed",
"FAILED [AS-EJB ejb] : jms-durable-subscription-name should be defined for an MDB with"+
" destination type Topic and Durable subscription type"));
}
else
{
result.notApplicable(smh.getLocalString(getClass().getName()+".notApplicable",
"NOT APPLICABLE [AS-EJB ejb] : jms-durable-subscription-name element is not defined"));
}
}
else
{
result.notApplicable(smh.getLocalString(getClass().getName()+".notApplicable",
"NOT APPLICABLE [AS-EJB ejb] : jms-durable-subscription-name element is not defined"));
}
}
}
else
{
result.addErrorDetails(smh.getLocalString
(getClass().getName() + ".notRun",
"NOT RUN [AS-EJB] : Could not create an SunEjbJar object"));
}
return result;