1 2 24 package com.sun.enterprise.tools.verifier.tests.webservices; 25 26 import com.sun.enterprise.deployment.*; 27 import com.sun.enterprise.tools.verifier.*; 28 import java.util.*; 29 import com.sun.enterprise.tools.verifier.tests.*; 30 31 34 35 62 public class JAXRPCServiceImplBeanChk extends WSTest implements WSCheck { 63 64 68 public Result check (WebServiceEndpoint descriptor) { 69 70 Result result = getInitializedResult(); 71 ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor(); 72 73 boolean pass = true; 74 75 if (descriptor.implementedByWebComponent()) { 76 77 Class <?> bean = loadImplBeanClass(descriptor, result); 78 if (bean == null) { 79 result.addErrorDetails(smh.getLocalString ("tests.componentNameConstructor", 80 "For [ {0} ]", new Object [] {compName.toString()})); 81 result.failed(smh.getLocalString 82 ("com.sun.enterprise.tools.verifier.tests.webservices.failed", "[{0}]", 83 new Object [] {"Could not Load the Service Implementation Bean class for the JAX-RPC Endpoint"})); 84 85 } 86 else { 87 88 String s = descriptor.getServiceEndpointInterface(); 90 91 if ((s == null) || (s.length() == 0)){ 92 result.addErrorDetails(smh.getLocalString 94 ("com.sun.enterprise.tools.verifier.tests.webservices.Error", 95 "Error: Unexpected error occurred [ {0} ]", 96 new Object [] {"SEI Class Name is Null"})); 97 } 98 99 Class <?> sei = loadSEIClass(descriptor, result); 100 101 if (sei == null) { 102 result.addErrorDetails(smh.getLocalString ("tests.componentNameConstructor", 103 "For [ {0} ]", new Object [] {compName.toString()})); 104 result.failed(smh.getLocalString 105 ("com.sun.enterprise.tools.verifier.tests.webservices.WSTest.SEIClassExists", 106 "Error: Service Endpoint Interface class [ {0} ] not found.", 107 new Object [] {descriptor.getServiceEndpointInterface()})); 108 } 109 else { 110 boolean implementsSEI = sei.isAssignableFrom(bean); 111 EndPointImplBeanClassChecker checker = 112 new EndPointImplBeanClassChecker(sei,bean,result,false); 113 if (implementsSEI) { 114 result.addGoodDetails(smh.getLocalString 116 ("tests.componentNameConstructor", 117 "For [ {0} ]", 118 new Object [] {compName.toString()})); 119 result.passed(smh.getLocalString ( 120 "com.sun.enterprise.tools.verifier.tests.webservices.passed", "[{0}]", 121 new Object [] {"The Service Impl Bean implements SEI"})); 122 123 } 124 else { 125 126 Vector notImpl = checker.getSEIMethodsNotImplemented(); 129 if (notImpl.size() > 0) { 130 result.addErrorDetails(smh.getLocalString ("tests.componentNameConstructor", 132 "For [ {0} ]", new Object [] {compName.toString()})); 133 result.failed(smh.getLocalString 134 ("com.sun.enterprise.tools.verifier.tests.webservices.failed", "[{0}]", 135 new Object [] {"The Service Implementation Bean Does not Implement ALL SEI Methods"})); 136 137 } 138 else { 139 result.addGoodDetails(smh.getLocalString 141 ("tests.componentNameConstructor", 142 "For [ {0} ]", 143 new Object [] {compName.toString()})); 144 result.passed(smh.getLocalString ( 145 "com.sun.enterprise.tools.verifier.tests.webservices.passed", "[{0}]", 146 new Object [] {"The Service Impl Bean implements all Methods of the SEI"})); 147 148 } 149 } 150 151 if (checker.check(compName)) { 154 result.setStatus(Result.PASSED); 156 } 157 else { 158 result.setStatus(Result.FAILED); 160 } 161 } 162 } 163 } 164 else { 165 result.addNaDetails(smh.getLocalString 167 ("tests.componentNameConstructor", "For [ {0} ]", 168 new Object [] {compName.toString()})); 169 result.notApplicable(smh.getLocalString 170 ("com.sun.enterprise.tools.verifier.tests.webservices.notapp", 171 "[{0}]", new Object [] {"Not Applicable since this is an EJB Service Endpoint"})); 172 } 173 174 return result; 175 } 176 177 } 178 179 | Popular Tags |