SelectMethodExpositionpublic class SelectMethodExposition extends SelectMethodTest Select methods must not be exposed through the bean home or remote interface |
Fields Summary |
---|
ComponentNameConstructor | compName
run an individual test against a declared ejbSelect method
|
Methods Summary |
---|
private boolean | commonToBothInterfaces(java.lang.String home, java.lang.String remote, EjbDescriptor descriptor, com.sun.enterprise.tools.verifier.Result result, java.lang.reflect.Method m)This method is responsible for the logic of the test. It is called for both local and remote interfaces.
try {
// we must not find this method exposed in the home or remote interface
Context context = getVerifierContext();
ClassLoader jcl = context.getClassLoader();
Method m1 = getMethod(Class.forName(home, false,
getVerifierContext().getClassLoader()),m.getName(), m.getParameterTypes());
Method m2 = getMethod(Class.forName(remote, false,
getVerifierContext().getClassLoader()), m.getName(), m.getParameterTypes());
if (m1 == null && m2 == null) {
result.addGoodDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.addGoodDetails(smh.getLocalString
("com.sun.enterprise.tools.verifier.tests.ejb.entity.cmp2.SelectMethodExposition.passed",
"[ {0} ] is not declared in the home or remote interface",
new Object[] {m.getName()}));
return true;
} else {
result.addErrorDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.addErrorDetails(smh.getLocalString
("com.sun.enterprise.tools.verifier.tests.ejb.entity.cmp2.SelectMethodExposition.failed",
"Error : [ {0} ] is declared in the home or remote interface",
new Object[] {m.getName()}));
return false;
}
} catch (ClassNotFoundException e) {
result.addErrorDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.addErrorDetails(smh.getLocalString
("com.sun.enterprise.tools.verifier.tests.ejb.entity.cmp2.SelectMethodExposition.failedException",
"Error: home or remote interface not found.",
new Object[] {}));
Verifier.debug(e);
return false;
}
| protected boolean | runIndividualSelectTest(java.lang.reflect.Method m, EjbCMPEntityDescriptor descriptor, com.sun.enterprise.tools.verifier.Result result)
boolean allIsWell = true;
compName = getVerifierContext().getComponentNameConstructor();
// String methodReturnType = m.getReturnType().getName();
if(descriptor.getRemoteClassName() != null && !"".equals(descriptor.getRemoteClassName()) &&
descriptor.getHomeClassName() != null && !"".equals(descriptor.getHomeClassName()))
allIsWell = commonToBothInterfaces(descriptor.getHomeClassName(),descriptor.getRemoteClassName(),descriptor, result, m);
if(allIsWell == true) {
if(descriptor.getLocalClassName() != null && !"".equals(descriptor.getLocalClassName()) &&
descriptor.getLocalHomeClassName() != null && !"".equals(descriptor.getLocalHomeClassName()))
allIsWell = commonToBothInterfaces(descriptor.getLocalHomeClassName(),descriptor.getLocalClassName(),descriptor, result, m);
}
return allIsWell;
|
|