Result result = getInitializedResult();
ComponentNameConstructor compName = new ComponentNameConstructor(descriptor);
SunEjbJar ejbJar = descriptor.getEjbBundleDescriptor().getIasEjbObject();
if(ejbJar!=null)
{
getBeanCache(descriptor,ejbJar);
if(beanCache!=null)
{
if(descriptor instanceof EjbEntityDescriptor
|| (descriptor instanceof EjbSessionDescriptor
&& ((EjbSessionDescriptor)descriptor).getSessionTypeString().equals(EjbSessionDescriptor.STATEFUL)))
{
result.passed(smh.getLocalString(getClass().getName()+".passed",
"PASSED [AS-EJB ejb] : bean-cache Element parsed"));
}
else
{
result.warning(smh.getLocalString(getClass().getName()+".warning1",
"WARNING [AS-EJB ejb] : bean-cache should be defined only for Stateful Session and Entity Beans"));
}
/*
if(descriptor instanceof EjbSessionDescriptor
&& ((EjbSessionDescriptor)descriptor).getSessionTypeString().equals(EjbSessionDescriptor.STATELESS))
{
result.warning(smh.getLocalString(getClass().getName()+".warning1",
"WARNING [AS-EJB ejb] : bean-cache should be defined for Stateful Session and Entity Beans"));
}
else
result.passed(smh.getLocalString(getClass().getName()+".passed",
"PASSED [AS-EJB ejb] : bean-cache Element parsed"));
*/
}
else
{
if(descriptor instanceof EjbEntityDescriptor
|| (descriptor instanceof EjbSessionDescriptor
&& ((EjbSessionDescriptor)descriptor).getSessionTypeString().equals(EjbSessionDescriptor.STATEFUL)))
{
result.warning(smh.getLocalString(getClass().getName()+".warning",
"WARNING [AS-EJB ejb] : bean-cache should be defined for Stateful Session and Entity Beans"));
}
else
result.notApplicable(smh.getLocalString(getClass().getName()+".notApplicable",
"NOT APPLICABLE [AS-EJB ejb] : bean-cache element not defined"));
}
}
else
{
result.addErrorDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.addErrorDetails(smh.getLocalString
(getClass().getName() + ".notRun",
"NOT RUN [AS-EJB] : Could not create an SunEjbJar object"));
}
return result;