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();
// check if this test is applicable first
if (!ref.hasPortComponentLinkName()) {
//result.notapplicable, since port-comp-link does not exist in port-comp-ref
result.addNaDetails(smh.getLocalString
("tests.componentNameConstructor", "For [ {0} ]",
new Object[] {compName.toString()}));
result.notApplicable(smh.getLocalString
( getClass().getName() + ".notapp",
"Not applicable since port-comp-link does not exist in port-comp-ref [{0}].",
new Object[] {ref.getName()}));
}
else if (ref.getPortComponentLink() != null) {
pass = true;
}
else if (!isLinkValid(ref)) {
//result.fail ref.getName(), ref.getPortComponentLinkName()
result.addErrorDetails(smh.getLocalString ("tests.componentNameConstructor",
"For [ {0} ]", new Object[] {compName.toString()}));
result.failed(smh.getLocalString (getClass().getName() + ".failed",
"Invalid port-component-link [{0}] in WebService client [{1}].",
new Object[] {ref.getPortComponentLinkName(),compName.toString()}));
pass = false;
}
}
if (pass) {
//result.pass
result.addGoodDetails(smh.getLocalString ("tests.componentNameConstructor",
"For [ {0} ]", new Object[] {compName.toString()}));
result.passed(smh.getLocalString (getClass().getName() + ".passed",
"All port-component-link(s) in this service reference are valid."));
}
return result;