CCITestpublic abstract class CCITest extends com.sun.enterprise.tools.verifier.tests.connector.ConnectorTest Contains helper methods for all tests pertinent to CCI |
Methods Summary |
---|
protected java.lang.String | getConnectionInterface(com.sun.enterprise.deployment.ConnectorDescriptor descriptor, Result result)
Returns the connection-interface that implements
"javax.resource.cci.Connection"
ComponentNameConstructor compName =
getVerifierContext().getComponentNameConstructor();
OutboundResourceAdapter outboundRA =
descriptor.getOutboundResourceAdapter();
if(outboundRA == null)
{
return null;
}
Set connDefs = outboundRA.getConnectionDefs();
Iterator iter = connDefs.iterator();
while(iter.hasNext())
{
ConnectionDefDescriptor connDefDesc = (ConnectionDefDescriptor)
iter.next();
String intf = connDefDesc.getConnectionIntf();
Context context = getVerifierContext();
ClassLoader jcl = context.getRarClassLoader();
Class intfClass = null;
try
{
intfClass = Class.forName(intf, 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.ConnectorTest.isClassLoadable.failed",
"The class [ {0} ] is not contained in the archive file",
new Object[] {intf}));
continue;
}
if(isImplementorOf(intfClass, "javax.resource.cci.Connection"))
{
return intf;
}
}
return null;
| protected boolean | isCCIImplemented(com.sun.enterprise.deployment.ConnectorDescriptor descriptor, Result result)
Checks whether the resource adapater is implementing the CCI interfaces
ComponentNameConstructor compName =
getVerifierContext().getComponentNameConstructor();
OutboundResourceAdapter outboundRA =
descriptor.getOutboundResourceAdapter();
if(outboundRA == null)
{
return false;
}
Set connDefs = outboundRA.getConnectionDefs();
Iterator iter = connDefs.iterator();
while(iter.hasNext())
{
ConnectionDefDescriptor connDefDesc = (ConnectionDefDescriptor)
iter.next();
// check if intf implements javax.resource.cci.ConnectionFactory
String intf = connDefDesc.getConnectionFactoryIntf();
Class implClass = null;
try
{
implClass = Class.forName(intf, 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.ConnectorTest.isClassLoadable.failed",
"The class [ {0} ] is not contained in the archive file",
new Object[] {intf}));
continue;
}
if(isImplementorOf(implClass, "javax.resource.cci.ConnectionFactory"))
{
return true;
}
}
return false;
|
|