Result result = getInitializedResult();
ComponentNameConstructor compName = new ComponentNameConstructor(descriptor);
SunEjbJar ejbJar = descriptor.getEjbBundleDescriptor().getIasEjbObject();
String ejbName = null;
Ejb testCase = null;
boolean oneFailed = false;
if(ejbJar!=null)
{
getBeanCache(descriptor,ejbJar);
if(beanCache!=null)
{
try
{
String maxCacheSizeStr = beanCache.getMaxCacheSize();
if(maxCacheSizeStr!=null)
{
if(maxCacheSizeStr.length()==0)
{
result.failed(smh.getLocalString(getClass().getName()+".failed1",
"FAILED [AS-EJB bean-cache] : max-cache-size cannot be empty. It should be between 1 and MAX_INT"));
}
else
{
int maxCacheSize = Integer.valueOf(beanCache.getMaxCacheSize()).intValue();
if(maxCacheSize < 1 || maxCacheSize > Integer.MAX_VALUE)
{
result.failed(smh.getLocalString(getClass().getName()+".failed2",
"FAILED [AS-EJB bean-cache] : max-cache-size cannot be less than 1 or greater than MAX_INT"));
}
else
result.passed(smh.getLocalString(getClass().getName()+".passed1",
"PASSED [AS-EJB bean-cache] : max-cache-size is {0}",new Object[]{(new Integer(maxCacheSize))}));
}
}
else
{
result.notApplicable(smh.getLocalString(getClass().getName()+".notApplicable",
"NOT APPLICABLE [AS-EJB bean-cache] : max-cache-size is element not defined"));
}
}
catch(NumberFormatException nfex)
{
Verifier.debug(nfex);
result.failed(smh.getLocalString(getClass().getName()+".failed3",
"FAILED [AS-EJB bean-cache] : max-cache-size is invalid. It should be a valid integer"));
}
}
else
{
result.notApplicable(smh.getLocalString(getClass().getName()+".notApplicable",
"NOT APPLICABLE [AS-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;