Test for each connection-definition, that "connectionfactory-impl-class"
implements javax.resource.Referenceable
Result result = getInitializedResult();
ComponentNameConstructor compName =
getVerifierContext().getComponentNameConstructor();
// test NA for inboundRA
if(!descriptor.getOutBoundDefined())
{
result.addNaDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.notApplicable(smh.getLocalString
("com.sun.enterprise.tools.verifier.tests.connector.managed.notApplicableForInboundRA",
"Resource Adapter does not provide outbound communication"));
return result;
}
OutboundResourceAdapter outboundRA =
descriptor.getOutboundResourceAdapter();
if(outboundRA == null)
{
return null;
}
boolean oneFailed = false;
Set connDefs = outboundRA.getConnectionDefs();
Iterator iter = connDefs.iterator();
while(iter.hasNext())
{
ConnectionDefDescriptor connDefDesc = (ConnectionDefDescriptor)
iter.next();
String connectionImpl = connDefDesc.getConnectionFactoryImpl();
Class implClass = null;
try
{
implClass = Class.forName(connectionImpl, false, getVerifierContext().getClassLoader());
}
catch(ClassNotFoundException e)
{
result.addErrorDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.failed(smh.getLocalString
(getClass().getName() + ".nonexist",
"Error: The class [ {0} ] as defined under connectionfactory-impl-class in the deployment descriptor does not exist",
new Object[] {connectionImpl}));
return result;
}
if(!isImplementorOf(implClass, "javax.resource.Referenceable"))
{
oneFailed = true;
result.addErrorDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.failed(smh.getLocalString(getClass().getName() + ".failed",
"Error: connectionfactory-impl-class [ {0} ] does not implement javax.resource.Referenceable",
new Object[] {implClass.getName()}));
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 connectionfactory-impl-class implement javax.resource.Referenceable"));
}
return result;