Test for each adminobject, that "adminobject-class"
implements "java.io.Serializable".
Result result = getInitializedResult();
ComponentNameConstructor compName =
getVerifierContext().getComponentNameConstructor();
if(!descriptor.hasAdminObjects())
{
result.addNaDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.notApplicable(smh.getLocalString
("com.sun.enterprise.tools.verifier.tests.connector.admin.notApp",
"Resource Adapter does not define any administered objects"));
return result;
}
Set adminObjects = descriptor.getAdminObjects();
boolean oneFailed = false;
Iterator iter = adminObjects.iterator();
while(iter.hasNext())
{
AdminObject adminObj = (AdminObject) iter.next();
String impl = adminObj.getAdminObjectClass();
Class implClass = null;
try
{
implClass = Class.forName(impl, false, getVerifierContext().getClassLoader());
}
catch(ClassNotFoundException e)
{
result.addErrorDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.failed(smh.getLocalString
("com.sun.enterprise.tools.verifier.tests.connector.admin.nonexist",
"Error: The class [ {0} ] as defined under adminobject-class in the deployment descriptor does not exist",
new Object[] {impl}));
return result;
}
if(!isImplementorOf(implClass, "java.io.Serializable"))
{
oneFailed = true;
result.addErrorDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.failed(smh.getLocalString(getClass().getName() + ".failed",
"Error: adminobject-class [ {0} ] does not implement java.io.Serializable",
new Object[] {impl}));
return result;
}
}
if(!oneFailed)
{
result.addGoodDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.passed(smh.getLocalString(getClass().getName() + ".passed",
"Success: all adminobject-class implement java.io.Serializable"));
}
return result;