geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgenen...@apache.org
Subject svn commit: r180211 - in /geronimo/trunk/modules/tomcat-builder: ./ src/java/org/apache/geronimo/tomcat/deployment/ src/test-resources/deployables/war5/ src/test-resources/deployables/war5/META-INF/ src/test-resources/deployables/war5/WEB-INF/ src/test-resources/deployables/war5/WEB-INF/classes/ src/test-resources/deployables/war5/WEB-INF/classes/org/ src/test-resources/deployables/war5/WEB-INF/classes/org/apache/ src/test-resources/deployables/war5/WEB-INF/classes/org/apache/geronimo/ src/test-resources/deployables/war5/WEB-INF/classes/org/apache/geronimo/ws/ src/test-resources/deployables/war5/WEB-INF/wsdl/ src/test/org/apache/geronimo/tomcat/deployment/
Date Mon, 06 Jun 2005 04:20:24 GMT
Author: jgenender
Date: Sun Jun  5 21:20:23 2005
New Revision: 180211

URL: http://svn.apache.org/viewcvs?rev=180211&view=rev
Log:
Added webservice integration

Added:
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/META-INF/
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/META-INF/MANIFEST.MF
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/classes/
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/classes/org/
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/classes/org/apache/
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/classes/org/apache/geronimo/
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/classes/org/apache/geronimo/ws/
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/classes/org/apache/geronimo/ws/HelloWorld.class
  (with props)
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/classes/org/apache/geronimo/ws/HelloWorldWS.class
  (with props)
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/hello-mapping.xml
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/web.xml
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/webservices.xml
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/wsdl/
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/wsdl/hello.wsdl
Modified:
    geronimo/trunk/modules/tomcat-builder/project.xml
    geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
    geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java
    geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java

Modified: geronimo/trunk/modules/tomcat-builder/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/project.xml?rev=180211&r1=180210&r2=180211&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/project.xml (original)
+++ geronimo/trunk/modules/tomcat-builder/project.xml Sun Jun  5 21:20:23 2005
@@ -57,6 +57,12 @@
 
         <dependency>
             <groupId>geronimo</groupId>
+            <artifactId>geronimo-axis</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
             <artifactId>geronimo-kernel</artifactId>
             <version>${pom.currentVersion}</version>
         </dependency>
@@ -241,6 +247,19 @@
             <groupId>geronimo-spec</groupId>
             <artifactId>geronimo-spec-saaj</artifactId>
             <version>${geronimo_spec_saaj_version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>axis</groupId>
+            <artifactId>axis</artifactId>
+            <version>${axis_version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>commons-discovery</groupId>
+            <artifactId>commons-discovery</artifactId>
+            <version>${commons_discovery_version}</version>
+            <url>http://jakarta.apache.org/commons/discovery/</url>
         </dependency>
 
         <dependency>

Modified: geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java?rev=180211&r1=180210&r2=180211&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
(original)
+++ geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
Sun Jun  5 21:20:23 2005
@@ -36,14 +36,26 @@
 import java.util.Set;
 import java.util.jar.JarFile;
 import java.util.zip.ZipEntry;
+
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
 import javax.security.jacc.WebResourcePermission;
 import javax.security.jacc.WebRoleRefPermission;
 import javax.security.jacc.WebUserDataPermission;
 import javax.transaction.UserTransaction;
+import javax.wsdl.WSDLException;
 
-import org.apache.geronimo.axis.builder.WSDescriptorParser;
+import org.apache.axis.description.JavaServiceDesc;
+import org.apache.axis.handlers.HandlerInfoChainFactory;
+import org.apache.axis.handlers.soap.SOAPService;
+import org.apache.axis.providers.java.RPCProvider;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.axis.builder.AxisServiceBuilder;
+import org.apache.geronimo.axis.builder.PortInfo;
+import org.apache.geronimo.axis.server.AxisWebServiceContainer;
+import org.apache.geronimo.axis.server.POJOProvider;
+import org.apache.geronimo.axis.server.ServiceInfo;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.service.ServiceConfigBuilder;
 import org.apache.geronimo.deployment.util.DeploymentUtil;
@@ -56,10 +68,13 @@
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.ModuleBuilder;
 import org.apache.geronimo.j2ee.deployment.WebModule;
+import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContextImpl;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.kernel.ClassLoaderReference;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.StoredObject;
 import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.geronimo.naming.deployment.ENCConfigBuilder;
 import org.apache.geronimo.naming.deployment.GBeanResourceEnvironmentBuilder;
@@ -75,6 +90,7 @@
 import org.apache.geronimo.tomcat.ValveGBean;
 import org.apache.geronimo.tomcat.util.SecurityHolder;
 import org.apache.geronimo.transaction.context.OnlineUserTransaction;
+import org.apache.geronimo.webservices.WebServiceContainer;
 import org.apache.geronimo.xbeans.geronimo.tomcat.TomcatWebAppDocument;
 import org.apache.geronimo.xbeans.geronimo.tomcat.TomcatWebAppType;
 import org.apache.geronimo.xbeans.j2ee.FilterMappingType;
@@ -97,18 +113,24 @@
 * @version $Rev: 161588 $ $Date: 2005-04-16 12:06:59 -0600 (Sat, 16 Apr 2005) $
 */
 public class TomcatModuleBuilder implements ModuleBuilder {
+   private static Log log = LogFactory.getLog(TomcatModuleBuilder.class);
+
    private final URI defaultParentId;
    private final ObjectName tomcatContainerObjectName;
 
+   private final WebServiceBuilder webServiceBuilder;
+
    private final Repository repository;
    private final Kernel kernel;
 
    public TomcatModuleBuilder(URI defaultParentId,
                              ObjectName tomcatContainerObjectName,
+                             WebServiceBuilder webServiceBuilder,
                              Repository repository,
                              Kernel kernel) {
        this.defaultParentId = defaultParentId;
        this.tomcatContainerObjectName = tomcatContainerObjectName;
+       this.webServiceBuilder = webServiceBuilder;
        this.repository = repository;
        this.kernel = kernel;
 
@@ -155,11 +177,13 @@
 
        //look for a webservices dd
        Map portMap = Collections.EMPTY_MAP;
-       try {
-           URL wsDDUrl = DeploymentUtil.createJarURL(moduleFile, "WEB-INF/webservices.xml");
-           portMap = WSDescriptorParser.parseWebServiceDescriptor(wsDDUrl, moduleFile, false);
-       } catch (MalformedURLException e) {
-           //no descriptor
+       if (webServiceBuilder != null){
+           try {
+               URL wsDDUrl = DeploymentUtil.createJarURL(moduleFile, "WEB-INF/webservices.xml");
+               portMap = webServiceBuilder.parseWebServiceDescriptor(wsDDUrl, moduleFile,
false);
+           } catch (MalformedURLException e) {
+               //no descriptor
+           }
        }
 
        // parse vendor dd
@@ -192,7 +216,7 @@
    TomcatWebAppType getTomcatWebApp(Object plan, JarFile moduleFile, boolean standAlone,
String targetPath, WebAppType webApp) throws DeploymentException {
        TomcatWebAppType tomcatWebApp = null;
        try {
-           // load the geronimo-jetty.xml from either the supplied plan or from the earFile
+           // load the geronimo-tomcat.xml from either the supplied plan or from the earFile
            try {
                if (plan instanceof XmlObject) {
                    tomcatWebApp = (TomcatWebAppType) SchemaConversionUtils.getNestedObjectAsType((XmlObject)
plan,
@@ -256,7 +280,7 @@
            id = webApp.getId();
        }
        tomcatWebApp.setConfigId(id);
-       tomcatWebApp.setContextRoot(id);
+       tomcatWebApp.setContextRoot("/" + id);
        return tomcatWebApp;
    }
 
@@ -346,7 +370,7 @@
            webModuleData.setAttribute("componentContext", compContext);
            webModuleData.setAttribute("userTransaction", userTransaction);
            //classpath may have been augmented with enhanced classes
-           webModuleData.setAttribute("webClassPath", webModule.getWebClasspath());
+           webModuleData.setAttribute("webClassPath", getFinalWebClasspath(webModule));
            // unsharableResources, applicationManagedSecurityResources
            GBeanResourceEnvironmentBuilder rebuilder = new GBeanResourceEnvironmentBuilder(webModuleData);
            ENCConfigBuilder.setResourceEnvironment(earContext, webModule.getModuleURI(),
rebuilder, webApp.getResourceRefArray(), tomcatWebApp.getResourceRefArray());
@@ -376,12 +400,36 @@
                }           
            }
            
-           //Handle the role permissions on the servlets.
+           Map portMap = webModule.getPortMap();
+
+           //Handle the role permissions and webservices on the servlets.
            ServletType[] servletTypes = webApp.getServletArray();
+           Map webServices = new HashMap();
            for (int i = 0; i < servletTypes.length; i++) {
                ServletType servletType = servletTypes[i];
+               
+               //Handle the Role Ref Permissions
                processRoleRefPermissions(servletType, securityRoles, rolePermissions);
+                              
+               //Do we have webservices configured?
+               if (portMap != null){
+                   //Check if the Servlet is a Webservice
+                   String servletName = servletType.getServletName().getStringValue().trim();
+                   if (portMap.containsKey(servletName)){
+                       //Yes, this servlet is a web service so let the web service builder

+                       // deal with configuring the web service stack
+                       String servletClassName = servletType.getServletClass().getStringValue().trim();
+                       Object portInfo = portMap.get(servletName);
+                       if (portInfo == null) {
+                           throw new DeploymentException("No web service deployment info
for servlet name " + servletName);
+                       }
+                       
+                       StoredObject wsContainer = configurePOJO(webModule.getModuleFile(),
portInfo, servletClassName, webClassLoader);
+                       webServices.put(servletName, wsContainer);
+                   }
+               }
            }
+           webModuleData.setAttribute("webServices", webServices);
            
            if (tomcatWebApp.isSetSecurityRealmName()) {
                
@@ -770,6 +818,23 @@
        }
    }
 
+   private static URI[] getFinalWebClasspath(WebModule webModule) throws Exception{
+   
+       URI oldClassPath[] = webModule.getWebClasspath();
+       String target = webModule.getTargetPath();
+       URI cleanClassPath[] = new URI[oldClassPath.length];
+       
+       for (int i = 0; i < oldClassPath.length; i++){
+           String uri = oldClassPath[i].toString();
+           if (uri.startsWith(target)){
+               cleanClassPath[i] = new URI(uri.substring(target.length() + 1));
+           } else {
+               cleanClassPath[i] = oldClassPath[i];
+           }
+       }
+       return cleanClassPath;
+   }
+   
    private static void checkString(String pattern) throws DeploymentException {
        //j2ee_1_4.xsd explicitly requires preserving all whitespace. Do not trim.
        if (pattern.indexOf(0x0D) >= 0) throw new DeploymentException("<url-pattern>
must not contain CR(#xD)");
@@ -782,6 +847,52 @@
        if (webApp.getLoginConfigArray().length > 1) throw new DeploymentException("Multiple
<login-config> elements found");
    }
 
+   public StoredObject configurePOJO(JarFile moduleFile, Object portInfoObject, String seiClassName,
ClassLoader classLoader) throws DeploymentException, IOException {
+
+       PortInfo portInfo = (PortInfo) portInfoObject;
+       ServiceInfo serviceInfo = AxisServiceBuilder.createServiceInfo(portInfo, classLoader);
+       JavaServiceDesc serviceDesc = serviceInfo.getServiceDesc();
+
+       try {
+           classLoader.loadClass(seiClassName);
+       } catch (ClassNotFoundException e) {
+           throw new DeploymentException("Unable to load servlet class for pojo webservice:
" + seiClassName, e);
+       }
+
+       RPCProvider provider = new POJOProvider();
+
+       SOAPService service = new SOAPService(null, provider, null);
+       service.setServiceDescription(serviceDesc);
+       service.setOption("className", seiClassName);
+
+       HandlerInfoChainFactory handlerInfoChainFactory = new HandlerInfoChainFactory(serviceInfo.getHandlerInfos());
+       service.setOption(org.apache.axis.Constants.ATTR_HANDLERINFOCHAIN, handlerInfoChainFactory);
+
+       URI location = null;
+       try {
+           location = new URI(serviceDesc.getEndpointURL());
+       } catch (URISyntaxException e) {
+           throw new DeploymentException("Invalid webservice endpoint URI", e);
+       }
+       URI wsdlURI = null;
+       try {
+           wsdlURI = new URI(serviceDesc.getWSDLFile());
+       } catch (URISyntaxException e) {
+           throw new DeploymentException("Invalid wsdl URI", e);
+
+       }
+
+       classLoader = new ClassLoaderReference(classLoader);
+       AxisWebServiceContainer axisWebServiceContainer = null;
+       try {
+           axisWebServiceContainer = new AxisWebServiceContainer(location, wsdlURI, service,
serviceInfo.getWsdlMap(), classLoader);
+       } catch (WSDLException e) {
+           throw new DeploymentException("Could not construct AxisWebServiceContainer", e);
+       }
+
+       return new StoredObject(axisWebServiceContainer);
+   }   
+   
    class UncheckedItem {
        final static int NA = 0x00;
        final static int INTEGRAL = 0x01;
@@ -838,6 +949,7 @@
        GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder(TomcatModuleBuilder.class, NameFactory.MODULE_BUILDER);
        infoBuilder.addAttribute("defaultParentId", URI.class, true);
        infoBuilder.addAttribute("tomcatContainerObjectName", ObjectName.class, true);
+       infoBuilder.addReference("WebServiceBuilder", WebServiceBuilder.class, NameFactory.MODULE_BUILDER);
        infoBuilder.addReference("Repository", Repository.class, NameFactory.GERONIMO_SERVICE);
        infoBuilder.addAttribute("kernel", Kernel.class, false);
        infoBuilder.addInterface(ModuleBuilder.class);
@@ -845,6 +957,7 @@
        infoBuilder.setConstructor(new String[]{
            "defaultParentId",
            "tomcatContainerObjectName",
+           "WebServiceBuilder",
            "Repository",
            "kernel"});
        GBEAN_INFO = infoBuilder.getBeanInfo();

Added: geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/META-INF/MANIFEST.MF?rev=180211&view=auto
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/META-INF/MANIFEST.MF
(added)
+++ geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/META-INF/MANIFEST.MF
Sun Jun  5 21:20:23 2005
@@ -0,0 +1,4 @@
+Manifest-Version: 1.0
+Ant-Version: Apache Ant 1.6.2
+Created-By: 1.4.2-50 ("Apple Computer, Inc.")
+

Added: geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/classes/org/apache/geronimo/ws/HelloWorld.class
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/classes/org/apache/geronimo/ws/HelloWorld.class?rev=180211&view=auto
==============================================================================
Binary file - no diff available.

Propchange: geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/classes/org/apache/geronimo/ws/HelloWorld.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/classes/org/apache/geronimo/ws/HelloWorldWS.class
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/classes/org/apache/geronimo/ws/HelloWorldWS.class?rev=180211&view=auto
==============================================================================
Binary file - no diff available.

Propchange: geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/classes/org/apache/geronimo/ws/HelloWorldWS.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/hello-mapping.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/hello-mapping.xml?rev=180211&view=auto
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/hello-mapping.xml
(added)
+++ geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/hello-mapping.xml
Sun Jun  5 21:20:23 2005
@@ -0,0 +1,12 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<java-wsdl-mapping
+    xmlns="http://java.sun.com/xml/ns/j2ee"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+    http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd"
+    version="1.1">
+    <package-mapping>
+        <package-type>org.apache.geronimo.ws</package-type>
+        <namespaceURI>http://geronimo.apache.org/HelloWorld</namespaceURI>
+    </package-mapping>
+</java-wsdl-mapping>

Added: geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/web.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/web.xml?rev=180211&view=auto
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/web.xml
(added)
+++ geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/web.xml
Sun Jun  5 21:20:23 2005
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app
+    xmlns="http://java.sun.com/xml/ns/j2ee"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+    version="2.4"
+    id="hello">
+
+    <servlet>
+        <servlet-name>HelloWorldServlet</servlet-name>
+        <servlet-class>org.apache.geronimo.ws.HelloWorldWS</servlet-class>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>HelloWorldServlet</servlet-name>
+        <url-pattern>/ws</url-pattern>
+    </servlet-mapping>
+
+</web-app>

Added: geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/webservices.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/webservices.xml?rev=180211&view=auto
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/webservices.xml
(added)
+++ geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/webservices.xml
Sun Jun  5 21:20:23 2005
@@ -0,0 +1,23 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<webservices
+    xmlns="http://java.sun.com/xml/ns/j2ee"
+    xmlns:impl="http://com.myapp/ws4ee"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+    http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd"
+    version="1.1">
+
+    <webservice-description>
+        <webservice-description-name>HelloWorldService</webservice-description-name>
+        <wsdl-file>WEB-INF/wsdl/hello.wsdl</wsdl-file>
+        <jaxrpc-mapping-file>WEB-INF/hello-mapping.xml</jaxrpc-mapping-file>
+        <port-component>
+            <port-component-name>HelloWorld</port-component-name>
+            <wsdl-port>HelloWorld</wsdl-port>
+            <service-endpoint-interface>org.apache.geronimo.ws.HelloWorld</service-endpoint-interface>
+            <service-impl-bean>
+                <servlet-link>HelloWorldServlet</servlet-link>
+            </service-impl-bean>
+        </port-component>
+    </webservice-description>
+</webservices>

Added: geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/wsdl/hello.wsdl
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/wsdl/hello.wsdl?rev=180211&view=auto
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/wsdl/hello.wsdl
(added)
+++ geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war5/WEB-INF/wsdl/hello.wsdl
Sun Jun  5 21:20:23 2005
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions targetNamespace="http://ws.geronimo.apache.org" xmlns:impl="http://ws.geronimo.apache.org"
xmlns:intf="http://ws.geronimo.apache.org" xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/">
+<!--WSDL created by Apache Axis version: #axisVersion#
+Built on #today#-->
+
+   <wsdl:message name="getHelloWorldResponse">
+
+      <wsdl:part name="getHelloWorldReturn" type="xsd:string"/>
+
+   </wsdl:message>
+
+   <wsdl:message name="getHelloWorldRequest">
+
+      <wsdl:part name="in0" type="xsd:string"/>
+
+   </wsdl:message>
+
+   <wsdl:portType name="HelloWorld">
+
+      <wsdl:operation name="getHelloWorld" parameterOrder="in0">
+
+         <wsdl:input name="getHelloWorldRequest" message="impl:getHelloWorldRequest"/>
+
+         <wsdl:output name="getHelloWorldResponse" message="impl:getHelloWorldResponse"/>
+
+      </wsdl:operation>
+
+   </wsdl:portType>
+
+   <wsdl:binding name="HelloWorldSoapBinding" type="impl:HelloWorld">
+
+      <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+
+      <wsdl:operation name="getHelloWorld">
+
+         <wsdlsoap:operation soapAction=""/>
+
+         <wsdl:input name="getHelloWorldRequest">
+
+            <wsdlsoap:body use="literal" namespace="http://ws.geronimo.apache.org"/>
+
+         </wsdl:input>
+
+         <wsdl:output name="getHelloWorldResponse">
+
+            <wsdlsoap:body use="literal" namespace="http://ws.geronimo.apache.org"/>
+
+         </wsdl:output>
+
+      </wsdl:operation>
+
+   </wsdl:binding>
+
+   <wsdl:service name="HelloWorldService">
+
+      <wsdl:port name="HelloWorld" binding="impl:HelloWorldSoapBinding">
+
+         <wsdlsoap:address location="http://localhost:8080/hello/ws?WSDL"/>
+
+      </wsdl:port>
+
+   </wsdl:service>
+
+</wsdl:definitions>

Modified: geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java?rev=180211&r1=180210&r2=180211&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java
(original)
+++ geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java
Sun Jun  5 21:20:23 2005
@@ -14,7 +14,7 @@
  */
 public class PlanParsingTest extends TestCase {
     ObjectName tomcatContainerObjectName = JMXUtil.getObjectName("test:type=TomcatContainer");
-    private TomcatModuleBuilder builder = new TomcatModuleBuilder(null, tomcatContainerObjectName,
null, null);
+    private TomcatModuleBuilder builder = new TomcatModuleBuilder(null, tomcatContainerObjectName,
null, null, null);
     private File basedir = new File(System.getProperty("basedir", "."));
 
     public void testResourceRef() throws Exception {

Modified: geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java?rev=180211&r1=180210&r2=180211&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
(original)
+++ geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
Sun Jun  5 21:20:23 2005
@@ -41,6 +41,7 @@
 import junit.framework.TestCase;
 
 import org.apache.commons.io.FileUtils;
+import org.apache.geronimo.axis.builder.AxisBuilder;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTrackingCoordinator;
 import org.apache.geronimo.deployment.DeploymentContext;
@@ -54,20 +55,21 @@
 import org.apache.geronimo.j2ee.deployment.RefContext;
 import org.apache.geronimo.j2ee.deployment.ResourceReferenceBuilder;
 import org.apache.geronimo.j2ee.deployment.ServiceReferenceBuilder;
+import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContextImpl;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.j2ee.management.impl.J2EEServerImpl;
-import org.apache.geronimo.kernel.KernelFactory;
 import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.config.ConfigurationManagerImpl;
+import org.apache.geronimo.kernel.KernelFactory;
 import org.apache.geronimo.kernel.config.Configuration;
+import org.apache.geronimo.kernel.config.ConfigurationData;
+import org.apache.geronimo.kernel.config.ConfigurationManager;
+import org.apache.geronimo.kernel.config.ConfigurationManagerImpl;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.config.InvalidConfigException;
 import org.apache.geronimo.kernel.config.NoSuchConfigException;
-import org.apache.geronimo.kernel.config.ConfigurationData;
-import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.security.SecurityServiceImpl;
@@ -141,16 +143,25 @@
     private URI parentId = URI.create("org/apache/geronimo/Foo");
 
     public void testDeployWar4() throws Exception {
+        deployWar("war4", "org/apache/geronimo/test");
+    }
+    
+    public void testDeployWar5() throws Exception {
+        deployWar("war5", "hello");
+    }
+
+    public void deployWar(String warName, String name) throws Exception {
+        
         File outputPath = new File(basedir,
-                "target/test-resources/deployables/war4");
+                "target/test-resources/deployables/" + warName);
         recursiveDelete(outputPath);
         outputPath.mkdirs();
-        File path = new File(basedir, "src/test-resources/deployables/war4");
-        File dest = new File(basedir, "target/test-resources/deployables/war4/war");
+        File path = new File(basedir, "src/test-resources/deployables/" + warName);
+        File dest = new File(basedir, "target/test-resources/deployables/" + warName + "/war");
         recursiveCopy(path, dest);
         UnpackedJarFile jarFile = new UnpackedJarFile(path);
         Module module = builder.createModule(null, jarFile);
-        URI id = new URI("war4");
+        URI id = new URI(warName);
         
         ObjectName jaccBeanName = NameFactory.getComponentName(null, null, null, null, "foo",
NameFactory.JACC_MANAGER, moduleContext);
         GBeanData jaccBeanData = new GBeanData(jaccBeanName, ApplicationPolicyConfigurationManager.GBEAN_INFO);
@@ -182,7 +193,7 @@
             fail("gbean not started: " + configData.getName());
         }
 
-        assertEquals(State.RUNNING_INDEX, kernel.getGBeanState(ObjectName.getInstance("test:J2EEApplication=null,J2EEServer=bar,j2eeType=WebModule,name=org/apache/geronimo/test")));
+        assertEquals(State.RUNNING_INDEX, kernel.getGBeanState(ObjectName.getInstance("test:J2EEApplication=null,J2EEServer=bar,j2eeType=WebModule,name="
+ name)));
 
         Set names = kernel.listGBeans(ObjectName.getInstance("test:J2EEApplication=null,J2EEServer=bar,*"));
         System.out.println("Object names: " + names);
@@ -302,7 +313,7 @@
             File file = (File) iterator.next(); 
             if (file.getAbsolutePath().indexOf(".svn") < 0){
                 String pathToFile = file.getPath();
-                String relativePath = pathToFile.substring(src.getPath().length(), pathToFile.length());
+                String relativePath = pathToFile.substring(src.getPath().length(), pathToFile.length()
- (file.getName().length()));
                 FileUtils.copyFileToDirectory(file,new File(dest.getPath() + relativePath));
             }
         }
@@ -365,8 +376,9 @@
                 "org.apache.geronimo.security.jacc.GeronimoPolicy");
         start(securityServiceGBean);
 
-        builder = new TomcatModuleBuilder(new URI("null"), containerName, null,
-                kernel);
+        WebServiceBuilder webServiceBuilder = new AxisBuilder();
+        
+        builder = new TomcatModuleBuilder(new URI("null"), containerName, webServiceBuilder,
null, kernel);
 
         // Default Realm
         Map initParams = new HashMap();



Mime
View raw message