all connector tests should implement this method. it run an individual
test against the resource adapter deployment descriptor.
Result result = getInitializedResult();
ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
if(isCCIImplemented(descriptor, result))
{
Class cf = testConnectionFactoryImpl(descriptor, result);
if (cf == null)
return result;
String className = cf.getName();
do {
Method[] allMethods = cf.getMethods();
for (int i=0;i<allMethods.length;i++) {
if (allMethods[i].getName().equals("getConnection")) {
// found it, check the return type
String connection = getConnectionInterface(descriptor, result);
if (isSubclassOf(allMethods[i].getReturnType(), connection)) {
result.addGoodDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.passed(smh.getLocalString(
getClass().getName() + ".passed",
"The getConnection method of the [ {0} ] returns the [ {1} ] interface",
new Object[] {cf.getName(), connection} ));
} else {
result.addErrorDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.failed(smh.getLocalString(
getClass().getName() + ".failed",
"Error: The getConnection method of the [ {0} ] does not return the [ {1} ] interface",
new Object[] {cf.getName(), connection} ));
}
return result;
}
}
cf = cf.getSuperclass();
} while (cf!=null);
result.addWarningDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.warning(smh.getLocalString(
getClass().getName() + ".warning",
"Warning: The getConnection method is not defined by [ {0} ]",
new Object[] {className} ));
}
else
{
result.addNaDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.notApplicable(smh.getLocalString
("com.sun.enterprise.tools.verifier.tests.connector.cci.notApp",
"The CCI interfaces do not seem to be implemented by this resource adapter"));
}
return result;