PortCompRefSEIClassCheckpublic class PortCompRefSEIClassCheck extends WSClientTest implements WSClientCheck
Fields Summary |
---|
ComponentNameConstructor | compName |
Methods Summary |
---|
public Result | check(ServiceReferenceDescriptor descriptor)
Result result = getInitializedResult();
compName = getVerifierContext().getComponentNameConstructor();
boolean pass = true;
Collection ports = descriptor.getPortsInfo();
for (Iterator it=ports.iterator(); it.hasNext();) {
ServiceRefPortInfo ref = (ServiceRefPortInfo)it.next();
if (!loadSEIClass(ref,result)) {
//result.fail ref.getName(), ref.getServiceEndpointInterface
result.addErrorDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]", new Object[] {compName.toString()}));
result.failed(smh.getLocalString
(getClass().getName() + ".failed",
"Error: Service Endpoint Interface class [ {0} ] not found.",
new Object[] {ref.getServiceEndpointInterface()}));
pass = false;
}
else {
//result.pass
result.addGoodDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]", new Object[] {compName.toString()}));
result.passed(smh.getLocalString (getClass().getName() + ".passed",
"Service Endpoint Interface class [ {0} ] found.",
new Object[] {ref.getServiceEndpointInterface()}));
}
}
return result;
| private boolean | loadSEIClass(ServiceRefPortInfo ref, Result result)
boolean pass = true;
if (ref.hasServiceEndpointInterface()) {
try {
Class.forName(ref.getServiceEndpointInterface(), false, getVerifierContext().getClassLoader());
} catch (ClassNotFoundException e) {
Verifier.debug(e);
pass = false;
}
}
else {
//result.not applicable (SEI not specified)
result.addNaDetails(smh.getLocalString
("tests.componentNameConstructor", "For [ {0} ]",
new Object[] {compName.toString()}));
result.notApplicable(smh.getLocalString
( getClass().getName() + ".notapp",
"Not applicable since Service reference does not specify an SEI."));
}
return pass;
|
|