1 23 package com.sun.enterprise.tools.verifier.tests.wsclients; 24 25 import com.sun.enterprise.deployment.*; 26 import com.sun.enterprise.tools.verifier.*; 27 import com.sun.enterprise.tools.verifier.tests.*; 28 import java.util.*; 29 30 33 34 42 43 public class PortCompRefSEIClassCheck extends WSClientTest implements WSClientCheck { 44 ComponentNameConstructor compName; 45 46 50 public Result check (ServiceReferenceDescriptor descriptor) { 51 52 Result result = getInitializedResult(); 53 compName = getVerifierContext().getComponentNameConstructor(); 54 55 boolean pass = true; 56 57 Collection ports = descriptor.getPortsInfo(); 58 59 for (Iterator it=ports.iterator(); it.hasNext();) { 60 ServiceRefPortInfo ref = (ServiceRefPortInfo)it.next(); 61 if (!loadSEIClass(ref,result)) { 62 result.addErrorDetails(smh.getLocalString 64 ("tests.componentNameConstructor", 65 "For [ {0} ]", new Object [] {compName.toString()})); 66 result.failed(smh.getLocalString 67 (getClass().getName() + ".failed", 68 "Error: Service Endpoint Interface class [ {0} ] not found.", 69 new Object [] {ref.getServiceEndpointInterface()})); 70 71 pass = false; 72 } 73 else { 74 result.addGoodDetails(smh.getLocalString 76 ("tests.componentNameConstructor", 77 "For [ {0} ]", new Object [] {compName.toString()})); 78 result.passed(smh.getLocalString (getClass().getName() + ".passed", 79 "Service Endpoint Interface class [ {0} ] found.", 80 new Object [] {ref.getServiceEndpointInterface()})); 81 82 } 83 } 84 85 return result; 86 } 87 88 private boolean loadSEIClass(ServiceRefPortInfo ref, Result result) { 89 90 boolean pass = true; 91 92 if (ref.hasServiceEndpointInterface()) { 93 try { 94 Class.forName(ref.getServiceEndpointInterface(), false, getVerifierContext().getClassLoader()); 95 } catch (ClassNotFoundException e) { 96 Verifier.debug(e); 97 pass = false; 98 } 99 } 100 else { 101 result.addNaDetails(smh.getLocalString 103 ("tests.componentNameConstructor", "For [ {0} ]", 104 new Object [] {compName.toString()})); 105 result.notApplicable(smh.getLocalString 106 ( getClass().getName() + ".notapp", 107 "Not applicable since Service reference does not specify an SEI.")); 108 109 } 110 return pass; 111 } 112 } 113 114 | Popular Tags |