1 23 24 package com.sun.enterprise.tools.verifier.webservices; 25 26 import javax.enterprise.deploy.shared.ModuleType ; 27 import java.util.Iterator ; 28 29 import com.sun.enterprise.deployment.*; 30 import com.sun.enterprise.tools.verifier.CheckMgr; 31 import com.sun.enterprise.tools.verifier.FrameworkContext; 32 import com.sun.enterprise.tools.verifier.JarCheck; 33 import com.sun.enterprise.tools.verifier.Result; 34 import com.sun.enterprise.tools.verifier.tests.ComponentNameConstructor; 35 36 39 public class WebServiceCheckMgrImpl extends CheckMgr implements JarCheck { 40 41 45 private final String testsListFileName = "TestNamesWebServices.xml"; private final String sunONETestsListFileName = getSunPrefix().concat( 47 testsListFileName); 48 private String moduleName; 49 50 public WebServiceCheckMgrImpl(FrameworkContext frameworkContext) { 51 this.frameworkContext = frameworkContext; 52 } 53 54 59 public void check(Descriptor descriptor) throws Exception { 60 WebServicesDescriptor rootDescriptor = (WebServicesDescriptor) descriptor; 61 ModuleType moduleType = rootDescriptor.getBundleDescriptor() 62 .getModuleType(); 63 if (moduleType == ModuleType.EJB) 64 moduleName = Result.EJB; 65 else if (moduleType == ModuleType.WAR) 66 moduleName = Result.WEB; 67 for (Iterator itr = rootDescriptor.getWebServices().iterator(); 68 itr.hasNext();) { 69 WebService wsDescriptor = (WebService) itr.next(); 70 for (Iterator endPtItr = wsDescriptor.getEndpoints().iterator(); 72 endPtItr.hasNext();) { 73 super.check((WebServiceEndpoint) endPtItr.next()); 74 } 75 } 76 } 77 78 84 protected String getTestsListFileName() { 85 return testsListFileName; 86 } 87 88 91 protected String getSunONETestsListFileName() { 92 return sunONETestsListFileName; 93 } 94 95 protected String getSchemaVersion(Descriptor descriptor) { 96 return ((WebServiceEndpoint) descriptor).getWebService(). 97 getWebServicesDescriptor().getSpecVersion(); 98 } 99 100 protected void setModuleName(Result r) { 101 r.setModuleName(moduleName); 102 } 103 104 protected BundleDescriptor getBundleDescriptor(Descriptor descriptor) { 105 return ((WebServiceEndpoint) descriptor).getBundleDescriptor(); 106 } 107 108 protected ComponentNameConstructor getComponentNameConstructor( 109 Descriptor descriptor) { 110 return new ComponentNameConstructor((WebServiceEndpoint)descriptor); 111 } 112 113 } 114 | Popular Tags |