Result result = getInitializedResult();
ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
boolean pass = true;
if (descriptor.implementedByWebComponent()) {
String servletClass=null;
ClassLoader loader = getVerifierContext().getClassLoader();
WebComponentDescriptor wcd = descriptor.getWebComponentImpl();
if (wcd!=null)
servletClass = wcd.getWebComponentImplementation();
if ((servletClass == null) || (!descriptor.getWebComponentImpl().isServlet())) {
//result.fail, webcomponentimpl for webservice is not servlet
result.addErrorDetails(smh.getLocalString ("tests.componentNameConstructor",
"For [ {0} ]", new Object[] {compName.toString()}));
result.failed(smh.getLocalString (getClass().getName() + ".failed1",
"The Web Component Implementation for this JAX-RPC Service Endpoint [{0}] is not a Servlet.",
new Object[] {compName.toString()}));
}
else {
try {
Class cl = Class.forName(servletClass, false, getVerifierContext().getClassLoader());
//result.pass
result.addGoodDetails(smh.getLocalString ("tests.componentNameConstructor",
"For [ {0} ]", new Object[] {compName.toString()}));
result.passed(smh.getLocalString (getClass().getName() + ".passed",
"The Servlet Implementation Class [{0}] was loaded successfully.",
new Object[] {servletClass}));
}catch (ClassNotFoundException e) {
//result.fail could not find servlet class
result.addErrorDetails(smh.getLocalString ("tests.componentNameConstructor",
"For [ {0} ]", new Object[] {compName.toString()}));
result.failed(smh.getLocalString (getClass().getName() + ".failed",
"The Servlet Implementation Class [{0}] was not found.",
new Object[] {servletClass}));
pass = false;
}
}
}
else {
//result.Not Applicable
result.addNaDetails(smh.getLocalString
("tests.componentNameConstructor", "For [ {0} ]",
new Object[] {compName.toString()}));
result.notApplicable(smh.getLocalString (getClass().getName() + ".notapp",
"Not Applicable since this not a JAX-RPC Service Endpoint."));
}
return result;