ConnectionTestpublic abstract class ConnectionTest extends CCITest Utility methods for all tests related to java.resource.cci.Connection
interface implementation |
Methods Summary |
---|
protected java.lang.Class | getConnectionImpl(com.sun.enterprise.deployment.ConnectorDescriptor descriptor, Result result)
Get the Class object of the class declared as implementing
the javax.resource.cci.Connection interface and declared in the
archive deployment descriptors under the connection-impl-class
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 impl = connDefDesc.getConnectionImpl();
Class implClass = null;
try
{
implClass = Class.forName(impl, false, getVerifierContext().getClassLoader());
} catch(ClassNotFoundException cnfe) {
result.addErrorDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.failed(smh.getLocalString
("com.sun.enterprise.tools.verifier.tests.connector.cci.ConnectionTest.nonexist",
"Error: The class [ {0} ] as defined in the connection-impl-class deployment descriptor does not exist",
new Object[] {impl}));
return null;
}
if(isImplementorOf(implClass, "javax.resource.cci.Connection"))
return implClass;
}
return null;
| protected java.lang.Class | testConnectionImpl(com.sun.enterprise.deployment.ConnectorDescriptor descriptor, Result result)
Test whether the class declared in the deployemnt descriptor under the
connection-impl-class tag is available
Class mcf = getConnectionImpl(descriptor, result);
if (mcf == null) {
ComponentNameConstructor compName =
getVerifierContext().getComponentNameConstructor();
result.addErrorDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.failed(smh.getLocalString
("com.sun.enterprise.tools.verifier.tests.connector.cci.ConnectionTest.nonimpl",
"Error: The resource adapter must implement the javax.resource.cci.Connection interface and declare it in the connection-impl-class deployment descriptor."));
}
return mcf;
| protected boolean | testImplementationOf(com.sun.enterprise.deployment.ConnectorDescriptor descriptor, java.lang.String interfaceName, Result result)
Test wether the class declared in the deployemnt descriptor under the
connectionfactory-impl-class tag implements an interface
Class mcf = testConnectionImpl(descriptor, result);
if (mcf != null)
return testImplementationOf(mcf, interfaceName, result);
return false;
|
|