1 23 24 package com.sun.enterprise.tools.verifier.wsclient; 25 26 import javax.enterprise.deploy.shared.ModuleType ; 27 28 import com.sun.enterprise.deployment.Descriptor; 29 import com.sun.enterprise.deployment.ServiceReferenceDescriptor; 30 import com.sun.enterprise.deployment.BundleDescriptor; 31 import com.sun.enterprise.tools.verifier.*; 32 import com.sun.enterprise.tools.verifier.tests.ComponentNameConstructor; 33 34 37 public class WebServiceClientCheckMgrImpl extends CheckMgr implements JarCheck { 38 39 43 private static final String testsListFileName = "TestNamesWebServicesClient.xml"; private static final String sunONETestsListFileName = getSunPrefix() 45 .concat(testsListFileName); 46 private String moduleName; 47 48 public WebServiceClientCheckMgrImpl(FrameworkContext frameworkContext) { 49 this.frameworkContext = frameworkContext; 50 } 51 52 57 public void check(Descriptor descriptor) throws Exception { 58 ServiceReferenceDescriptor rootDescriptor = (ServiceReferenceDescriptor) descriptor; 59 ModuleType moduleType = rootDescriptor.getBundleDescriptor() 60 .getModuleType(); 61 if (moduleType == ModuleType.EJB) 62 moduleName = Result.EJB; 63 else if (moduleType == ModuleType.WAR) 64 moduleName = Result.WEB; 65 else if (moduleType == ModuleType.CAR) 66 moduleName = Result.APPCLIENT; 67 super.check(rootDescriptor); 68 } 69 70 76 protected String getTestsListFileName() { 77 return testsListFileName; 78 } 79 80 83 protected String getSunONETestsListFileName() { 84 return sunONETestsListFileName; 85 } 86 87 94 protected String getSchemaVersion(Descriptor descriptor) { 95 String wsclientVersion = null; 96 String version = ((ServiceReferenceDescriptor) descriptor).getBundleDescriptor() 97 .getSpecVersion(); 98 if(moduleName.equals(Result.EJB)){ 99 if("2.1".equals(version)) wsclientVersion = "1.1"; else if("3.0".equals(version)) wsclientVersion = "1.2"; } else if(moduleName.equals(Result.WEB)){ 102 if("2.4".equals(version)) wsclientVersion = "1.1"; else if("2.5".equals(version)) wsclientVersion = "1.2"; } else if(moduleName.equals(Result.APPCLIENT)){ 105 if("1.4".equals(version)) wsclientVersion = "1.1"; else if("5".equals(version)) wsclientVersion = "1.2"; } 108 if(wsclientVersion==null) { 109 wsclientVersion = ""; } 111 return wsclientVersion; 112 } 113 114 protected void setModuleName(Result r) { 115 r.setModuleName(moduleName); 116 } 117 118 protected BundleDescriptor getBundleDescriptor(Descriptor descriptor) { 119 return ((ServiceReferenceDescriptor)descriptor).getBundleDescriptor(); 120 } 121 protected ComponentNameConstructor getComponentNameConstructor( 122 Descriptor descriptor) { 123 return new ComponentNameConstructor((ServiceReferenceDescriptor)descriptor); 124 } 125 126 } 127 | Popular Tags |