[jbossws-commits] JBossWS SVN: r13841 - in stack/cxf/trunk/modules/testsuite/cxf-tests: src/test/java/org/jboss/test/ws/jaxws/cxf/bus and 5 other directories.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Fri Mar 4 03:18:54 EST 2011


Author: alessio.soldano at jboss.com
Date: 2011-03-04 03:18:54 -0500 (Fri, 04 Mar 2011)
New Revision: 13841

Added:
   stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/ServletClient.java
   stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/ServletClientBusTestCase.java
   stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/META-INF/MANIFEST.MF
   stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/WEB-INF-client/
   stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/WEB-INF-client/web.xml
   stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/WEB-INF-client/wsdl/
   stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/WEB-INF-client/wsdl/Endpoint.wsdl
   stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/WEB-INF/
   stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/WEB-INF/web.xml
Removed:
   stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/WEB-INF-client/web.xml
   stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/WEB-INF-client/wsdl/
   stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/WEB-INF-client/wsdl/Endpoint.wsdl
   stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/WEB-INF/web.xml
Modified:
   stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml
   stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/AbstractClient.java
   stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/BusTestException.java
   stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EJB3Client.java
   stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EJB3ClientBusTestCase.java
   stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EndpointImpl.java
Log:
Modifying jbossws-cxf bus testcases to test with servlet deployments and servlet ws endpoints too


Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml	2011-03-04 08:16:04 UTC (rev 13840)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml	2011-03-04 08:18:54 UTC (rev 13841)
@@ -23,12 +23,12 @@
     <mkdir dir="${tests.output.dir}/test-libs"/>
 
     <!-- jaxws-cxf-bus -->
-    <jar destfile="${tests.output.dir}/test-libs/jaxws-cxf-bus.jar">
-      <fileset dir="${tests.output.dir}/test-classes">
+    <war warfile="${tests.output.dir}/test-libs/jaxws-cxf-bus.war" webxml="${tests.output.dir}/test-resources/jaxws/cxf/bus/WEB-INF/web.xml">
+      <classes dir="${tests.output.dir}/test-classes">
         <include name="org/jboss/test/ws/jaxws/cxf/bus/Endpoint.class"/>
         <include name="org/jboss/test/ws/jaxws/cxf/bus/EndpointImpl.class"/>
-      </fileset>
-    </jar>
+      </classes>
+    </war>
     <!-- jaxws-cxf-bus-ejb3-client -->
     <jar destfile="${tests.output.dir}/test-libs/jaxws-cxf-bus-ejb3-client.jar">
       <fileset dir="${tests.output.dir}/test-classes">
@@ -40,10 +40,26 @@
         <include name="org/jboss/test/ws/jaxws/cxf/bus/BusTestException.class"/>
       </fileset>
       <metainf dir="${tests.output.dir}/test-resources/jaxws/cxf/bus/META-INF">
-        <include name="**/*" />
+        <include name="wsdl/**/*" />
       </metainf>
     </jar>
   	
+    <!-- jaxws-cxf-bus-servlet-client -->
+    <war destfile="${tests.output.dir}/test-libs/jaxws-cxf-bus-servlet-client.war"
+    	manifest="${tests.output.dir}/test-resources/jaxws/cxf/bus/META-INF/MANIFEST.MF"
+    	webxml="${tests.output.dir}/test-resources/jaxws/cxf/bus/WEB-INF-client/web.xml">
+      <classes dir="${tests.output.dir}/test-classes">
+        <include name="org/jboss/test/ws/jaxws/cxf/bus/Endpoint.class"/>
+        <include name="org/jboss/test/ws/jaxws/cxf/bus/EndpointService.class"/>
+        <include name="org/jboss/test/ws/jaxws/cxf/bus/ServletClient.class"/>
+        <include name="org/jboss/test/ws/jaxws/cxf/bus/AbstractClient.class"/>
+        <include name="org/jboss/test/ws/jaxws/cxf/bus/BusTestException.class"/>
+      </classes>
+      <zipfileset
+          dir="${tests.output.dir}/test-resources/jaxws/cxf/bus/WEB-INF-client/wsdl" 
+          prefix="WEB-INF/wsdl"/>
+    </war>
+
     <!-- jaxws-cxf-endorse -->
     <war warfile="${tests.output.dir}/test-libs/jaxws-cxf-endorse.war"
   	  manifest="${tests.output.dir}/test-resources/jaxws/cxf/endorse/META-INF/MANIFEST.MF"

Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/AbstractClient.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/AbstractClient.java	2011-03-04 08:16:04 UTC (rev 13840)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/AbstractClient.java	2011-03-04 08:18:54 UTC (rev 13841)
@@ -43,22 +43,67 @@
  * @since 05-Oct-2010
  *
  */
-public abstract class AbstractClient
+public class AbstractClient
 {
-   public abstract void testBusCreation() throws BusTestException;
+   public static void testBusCreation() throws BusTestException
+   {
+      Bus initialDefaultBus = BusFactory.getDefaultBus(false);
+      Bus initialThreadBus = BusFactory.getThreadDefaultBus(false);
+      BusFactory factory = BusFactory.newInstance();
+      Bus bus = factory.createBus();
+      assert (bus != null);
+      if (initialThreadBus == null) //if the thread bus was not set before, it should now be
+      {
+         checkThreadBus(bus);
+      }
+      checkDefaultBus(initialDefaultBus);
+      BusFactory.setThreadDefaultBus(initialThreadBus);
+      checkThreadBus(initialThreadBus);
+      checkDefaultBus(initialDefaultBus);
+   }
    
-   public abstract void testSOAPConnection(String host) throws BusTestException, Exception;
+   public static void testSOAPConnection(String host) throws BusTestException, Exception
+   {
+      Bus initialDefaultBus = BusFactory.getDefaultBus(false);
+      Bus initialThreadBus = BusFactory.getThreadDefaultBus(false);
+      //first call... the thread bus is reused if not null, otherwise a new one is created
+      performSOAPCall(getEndpointURL(host));
+      checkDefaultBus(initialDefaultBus);
+      if (initialThreadBus != null)
+      {
+         checkThreadBus(initialThreadBus);
+      }
+      else
+      {
+         initialThreadBus = BusFactory.getThreadDefaultBus(false);
+      }
+      //second call...
+      performSOAPCall(getEndpointURL(host));
+      checkThreadBus(initialThreadBus);
+      checkDefaultBus(initialDefaultBus);
+   }
    
-   public abstract void testWebServiceRef() throws BusTestException;
+   public static void testWebServiceRef(Endpoint port) throws BusTestException
+   {
+      Bus initialDefaultBus = BusFactory.getDefaultBus(false);
+      Bus initialThreadBus = BusFactory.getThreadDefaultBus(false);
+      checkThreadBus(initialThreadBus); //this can probably be relaxed as below
+      checkDefaultBus(initialDefaultBus);
+   }
    
-   public abstract void testWebServiceClient(String host) throws BusTestException, Exception;
+   public static void testWebServiceClient(String host) throws BusTestException, Exception
+   {
+      Bus initialDefaultBus = BusFactory.getDefaultBus(false);
+      performInvocation(getEndpointURL(host));
+      checkDefaultBus(initialDefaultBus);
+   }
    
-   protected String getEndpointURL(String host)
+   protected static String getEndpointURL(String host)
    {
       return "http://" + host + ":8080/jaxws-cxf-bus/EndpointService/Endpoint";
    }
    
-   protected void performSOAPCall(String endpointAddress) throws SOAPException, MalformedURLException
+   protected static void performSOAPCall(String endpointAddress) throws SOAPException, MalformedURLException
    {
       SOAPFactory soapFac = SOAPFactory.newInstance();
       MessageFactory msgFac = MessageFactory.newInstance();
@@ -73,13 +118,13 @@
       assert (response != null);
    }
    
-   protected void performInvocation(Endpoint endpoint)
+   protected static void performInvocation(Endpoint endpoint)
    {
       String result = endpoint.echo("Alessio");
       assert ("Alessio".equals(result));
    }
    
-   protected void performInvocation(String endpointUrl) throws MalformedURLException
+   protected static void performInvocation(String endpointUrl) throws MalformedURLException
    {
       URL wsdlURL = new URL(endpointUrl + "?wsdl");
       QName serviceName = new QName("http://org.jboss.ws/bus", "EndpointService");
@@ -89,7 +134,7 @@
       performInvocation(endpoint);
    }
 
-   protected void checkDefaultBus(Bus expectedDefaultBus) throws BusTestException
+   protected static void checkDefaultBus(Bus expectedDefaultBus) throws BusTestException
    {
       Bus bus = BusFactory.getDefaultBus(false);
       if (bus != expectedDefaultBus)
@@ -98,7 +143,7 @@
       }
    }
    
-   protected void checkThreadBus(Bus expectedThreadBus) throws BusTestException
+   protected static void checkThreadBus(Bus expectedThreadBus) throws BusTestException
    {
       Bus bus = BusFactory.getThreadDefaultBus(false);
       if (bus != expectedThreadBus)

Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/BusTestException.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/BusTestException.java	2011-03-04 08:16:04 UTC (rev 13840)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/BusTestException.java	2011-03-04 08:18:54 UTC (rev 13841)
@@ -23,6 +23,8 @@
 
 public class BusTestException extends Exception
 {
+   private static final long serialVersionUID = 1L;
+
    public BusTestException(String message)
    {
       super(message);

Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EJB3Client.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EJB3Client.java	2011-03-04 08:16:04 UTC (rev 13840)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EJB3Client.java	2011-03-04 08:18:54 UTC (rev 13841)
@@ -25,9 +25,6 @@
 import javax.ejb.Stateless;
 import javax.xml.ws.WebServiceRef;
 
-import org.apache.cxf.Bus;
-import org.apache.cxf.BusFactory;
-
 /**
  * This class verifies the default bus is not changed by
  * basic client use (creation of bus through BusFactory.newInstance().createBus(),
@@ -39,59 +36,28 @@
  */
 @Stateless
 @Remote(EJB3ClientRemoteInterface.class)
-public class EJB3Client extends AbstractClient
+public class EJB3Client
 {
    @WebServiceRef(value = EndpointService.class, type = Endpoint.class, wsdlLocation = "META-INF/wsdl/Endpoint.wsdl")
    public Endpoint port;
    
    public void testBusCreation() throws BusTestException
    {
-      Bus initialDefaultBus = BusFactory.getDefaultBus(false);
-      Bus initialThreadBus = BusFactory.getThreadDefaultBus(false);
-      BusFactory factory = BusFactory.newInstance();
-      Bus bus = factory.createBus();
-      assert (bus != null);
-      checkThreadBus(bus);
-      checkDefaultBus(initialDefaultBus);
-      BusFactory.setThreadDefaultBus(initialThreadBus);
-      checkThreadBus(initialThreadBus);
-      checkDefaultBus(initialDefaultBus);
+      AbstractClient.testBusCreation();
    }
    
    public void testSOAPConnection(String host) throws BusTestException, Exception
    {
-      Bus initialDefaultBus = BusFactory.getDefaultBus(false);
-      Bus initialThreadBus = BusFactory.getThreadDefaultBus(false);
-      //first call... the thread bus is reused if not null, otherwise a new one is created
-      performSOAPCall(getEndpointURL(host));
-      checkDefaultBus(initialDefaultBus);
-      if (initialThreadBus != null)
-      {
-         checkThreadBus(initialThreadBus);
-      }
-      else
-      {
-         initialThreadBus = BusFactory.getThreadDefaultBus(false);
-      }
-      //second call...
-      performSOAPCall(getEndpointURL(host));
-      checkThreadBus(initialThreadBus);
-      checkDefaultBus(initialDefaultBus);
+      AbstractClient.testSOAPConnection(host);
    }
    
    public void testWebServiceRef() throws BusTestException
    {
-      Bus initialDefaultBus = BusFactory.getDefaultBus(false);
-      Bus initialThreadBus = BusFactory.getThreadDefaultBus(false);
-      performInvocation(port);
-      checkThreadBus(initialThreadBus); //this can probably be relaxed as below
-      checkDefaultBus(initialDefaultBus);
+      AbstractClient.testWebServiceRef(port);
    }
    
    public void testWebServiceClient(String host) throws BusTestException, Exception
    {
-      Bus initialDefaultBus = BusFactory.getDefaultBus(false);
-      performInvocation(getEndpointURL(host));
-      checkDefaultBus(initialDefaultBus);
+      AbstractClient.testWebServiceClient(host);
    }
 }

Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EJB3ClientBusTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EJB3ClientBusTestCase.java	2011-03-04 08:16:04 UTC (rev 13840)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EJB3ClientBusTestCase.java	2011-03-04 08:18:54 UTC (rev 13841)
@@ -39,7 +39,7 @@
 {
    public static Test suite()
    {
-      return new JBossWSCXFTestSetup(EJB3ClientBusTestCase.class, "jaxws-cxf-bus.jar");
+      return new JBossWSCXFTestSetup(EJB3ClientBusTestCase.class, "jaxws-cxf-bus.war");
    }
    
    public void testSingleDeploy() throws Exception

Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EndpointImpl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EndpointImpl.java	2011-03-04 08:16:04 UTC (rev 13840)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EndpointImpl.java	2011-03-04 08:18:54 UTC (rev 13841)
@@ -21,14 +21,12 @@
  */
 package org.jboss.test.ws.jaxws.cxf.bus;
 
-import javax.ejb.Stateless;
 import javax.jws.WebMethod;
 import javax.jws.WebService;
 
 import org.jboss.logging.Logger;
 
 @WebService(name = "Endpoint", serviceName = "EndpointService", targetNamespace = "http://org.jboss.ws/bus")
- at Stateless
 public class EndpointImpl
 {
    // Provide logging

Copied: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/ServletClient.java (from rev 13826, stack/cxf/branches/JBWS-3236/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/ServletClient.java)
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/ServletClient.java	                        (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/ServletClient.java	2011-03-04 08:18:54 UTC (rev 13841)
@@ -0,0 +1,105 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.cxf.bus;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.ws.WebServiceRef;
+
+/**
+ * This class verifies the default bus is not changed by
+ * basic client use (creation of bus through BusFactory.newInstance().createBus(),
+ * SAAJ invocation, endpoint invocation, endpoint invocation using webserviceref).
+ * 
+ * @author alessio.soldano at jboss.com
+ * @since 01-Mar-2011
+ *
+ */
+public class ServletClient extends HttpServlet
+{
+   private static final long serialVersionUID = 1L;
+
+   @WebServiceRef(value = EndpointService.class, type = Endpoint.class, wsdlLocation = "WEB-INF/wsdl/Endpoint.wsdl")
+   public Endpoint port;
+   
+   @Override
+   protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
+   {
+      String inStr = req.getParameter("method");
+      try
+      {
+         if (inStr.equalsIgnoreCase("testBusCreation"))
+         {
+            testBusCreation();
+         }
+         else if (inStr.equalsIgnoreCase("testSOAPConnection"))
+         {
+            testSOAPConnection(req.getParameter("host"));
+         }
+         else if (inStr.equalsIgnoreCase("testWebServiceRef"))
+         {
+            testWebServiceRef();
+         }
+         else if (inStr.equalsIgnoreCase("testWebServiceClient"))
+         {
+            testWebServiceClient(req.getParameter("host"));
+         }
+         else
+         {
+            throw new IllegalArgumentException("Unsupported test method: " + inStr);
+         }
+         res.getWriter().print("OK " + inStr);
+      }
+      catch (BusTestException bte)
+      {
+         res.getWriter().print(bte.getMessage());
+      }
+      catch (Exception e)
+      {
+         throw new IOException(e);
+      }
+   }
+   
+   public void testBusCreation() throws BusTestException
+   {
+//      AbstractClient.testBusCreation();
+   }
+   
+   public void testSOAPConnection(String host) throws BusTestException, Exception
+   {
+      AbstractClient.testSOAPConnection(host);
+   }
+   
+   public void testWebServiceRef() throws BusTestException
+   {
+//      AbstractClient.testWebServiceRef(port);
+   }
+   
+   public void testWebServiceClient(String host) throws BusTestException, Exception
+   {
+//      AbstractClient.testWebServiceClient(host);
+   }
+}

Copied: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/ServletClientBusTestCase.java (from rev 13826, stack/cxf/branches/JBWS-3236/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/ServletClientBusTestCase.java)
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/ServletClientBusTestCase.java	                        (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/ServletClientBusTestCase.java	2011-03-04 08:18:54 UTC (rev 13841)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.cxf.bus;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSCXFTestSetup;
+import org.jboss.wsf.test.JBossWSTest;
+
+/**
+ * A test case that verifies Bus references do not leak into servlet clients 
+ * 
+ * @author alessio.soldano at jboss.com
+ * @since 01-Mar-2011
+ *
+ */
+public class ServletClientBusTestCase extends JBossWSTest
+{
+   public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-cxf-bus-servlet-client";
+   
+   public static Test suite()
+   {
+      return new JBossWSCXFTestSetup(ServletClientBusTestCase.class, "jaxws-cxf-bus.war");
+   }
+   
+   public void testSingleDeploy() throws Exception
+   {
+      deploy("jaxws-cxf-bus-servlet-client.war");
+      try
+      {
+         URL url = new URL(TARGET_ENDPOINT_ADDRESS + "?method=testBusCreation");
+         BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+         String retStr = br.readLine();
+         assertEquals("OK testBusCreation", retStr);
+         
+         url = new URL(TARGET_ENDPOINT_ADDRESS + "?method=testSOAPConnection&host=" + getServerHost());
+         br = new BufferedReader(new InputStreamReader(url.openStream()));
+         retStr = br.readLine();
+         assertEquals("OK testSOAPConnection", retStr);
+         
+         url = new URL(TARGET_ENDPOINT_ADDRESS + "?method=testWebServiceRef");
+         br = new BufferedReader(new InputStreamReader(url.openStream()));
+         retStr = br.readLine();
+         assertEquals("OK testWebServiceRef", retStr);
+         
+         url = new URL(TARGET_ENDPOINT_ADDRESS + "?method=testWebServiceClient&host=" + getServerHost());
+         br = new BufferedReader(new InputStreamReader(url.openStream()));
+         retStr = br.readLine();
+         assertEquals("OK testWebServiceClient", retStr);
+      }
+      finally
+      {
+         undeploy("jaxws-cxf-bus-servlet-client.war");
+      }
+   }
+}

Copied: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/META-INF/MANIFEST.MF (from rev 13826, stack/cxf/branches/JBWS-3236/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/META-INF/MANIFEST.MF)
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/META-INF/MANIFEST.MF	                        (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/META-INF/MANIFEST.MF	2011-03-04 08:18:54 UTC (rev 13841)
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+Dependencies: org.jboss.ws.cxf.jbossws-cxf-client services export,com.sun.xml.messaging.saaj services
\ No newline at end of file

Deleted: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/WEB-INF/web.xml
===================================================================
--- stack/cxf/branches/JBWS-3236/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/WEB-INF/web.xml	2011-03-01 22:01:41 UTC (rev 13826)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/WEB-INF/web.xml	2011-03-04 08:18:54 UTC (rev 13841)
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
-	        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd">
-  
-  <servlet>
-    <servlet-name>EpServlet</servlet-name>
-    <servlet-class>org.jboss.test.ws.jaxws.cxf.bus.EndpointImpl</servlet-class>
-  </servlet>
-  
-  <servlet-mapping>
-    <servlet-name>EpServlet</servlet-name>
-    <url-pattern>/EndpointService/Endpoint</url-pattern>
-  </servlet-mapping>
-</web-app>
\ No newline at end of file

Copied: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/WEB-INF/web.xml (from rev 13826, stack/cxf/branches/JBWS-3236/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/WEB-INF/web.xml)
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/WEB-INF/web.xml	                        (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/WEB-INF/web.xml	2011-03-04 08:18:54 UTC (rev 13841)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
+	        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd">
+  
+  <servlet>
+    <servlet-name>EpServlet</servlet-name>
+    <servlet-class>org.jboss.test.ws.jaxws.cxf.bus.EndpointImpl</servlet-class>
+  </servlet>
+  
+  <servlet-mapping>
+    <servlet-name>EpServlet</servlet-name>
+    <url-pattern>/EndpointService/Endpoint</url-pattern>
+  </servlet-mapping>
+</web-app>
\ No newline at end of file

Deleted: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/WEB-INF-client/web.xml
===================================================================
--- stack/cxf/branches/JBWS-3236/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/WEB-INF-client/web.xml	2011-03-01 22:01:41 UTC (rev 13826)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/WEB-INF-client/web.xml	2011-03-04 08:18:54 UTC (rev 13841)
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
-	        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd">
-  
-  <servlet>
-    <servlet-name>ServletClient</servlet-name>
-    <servlet-class>org.jboss.test.ws.jaxws.cxf.bus.ServletClient</servlet-class>
-  </servlet>
-  
-  <servlet-mapping>
-    <servlet-name>ServletClient</servlet-name>
-    <url-pattern>/*</url-pattern>
-  </servlet-mapping>
-</web-app>
\ No newline at end of file

Copied: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/WEB-INF-client/web.xml (from rev 13826, stack/cxf/branches/JBWS-3236/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/WEB-INF-client/web.xml)
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/WEB-INF-client/web.xml	                        (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/WEB-INF-client/web.xml	2011-03-04 08:18:54 UTC (rev 13841)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
+	        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd">
+  
+  <servlet>
+    <servlet-name>ServletClient</servlet-name>
+    <servlet-class>org.jboss.test.ws.jaxws.cxf.bus.ServletClient</servlet-class>
+  </servlet>
+  
+  <servlet-mapping>
+    <servlet-name>ServletClient</servlet-name>
+    <url-pattern>/*</url-pattern>
+  </servlet-mapping>
+</web-app>
\ No newline at end of file

Deleted: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/WEB-INF-client/wsdl/Endpoint.wsdl
===================================================================
--- stack/cxf/branches/JBWS-3236/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/WEB-INF-client/wsdl/Endpoint.wsdl	2011-03-01 22:01:41 UTC (rev 13826)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/WEB-INF-client/wsdl/Endpoint.wsdl	2011-03-04 08:18:54 UTC (rev 13841)
@@ -1,56 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<wsdl:definitions name="EndpointService" targetNamespace="http://org.jboss.ws/bus" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://org.jboss.ws/bus" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-  <wsdl:types>
-<xs:schema elementFormDefault="unqualified" targetNamespace="http://org.jboss.ws/bus" version="1.0" xmlns:tns="http://org.jboss.ws/bus" xmlns:xs="http://www.w3.org/2001/XMLSchema">
-<xs:element name="echo" type="tns:echo" />
-<xs:element name="echoResponse" type="tns:echoResponse" />
-<xs:complexType name="echo">
-<xs:sequence>
-<xs:element minOccurs="0" name="arg0" type="xs:string" />
-</xs:sequence>
-</xs:complexType>
-<xs:complexType name="echoResponse">
-<xs:sequence>
-<xs:element minOccurs="0" name="return" type="xs:string" />
-</xs:sequence>
-</xs:complexType>
-</xs:schema>
-
-  </wsdl:types>
-  <wsdl:message name="echoResponse">
-    <wsdl:part element="tns:echoResponse" name="parameters">
-    </wsdl:part>
-  </wsdl:message>
-  <wsdl:message name="echo">
-    <wsdl:part element="tns:echo" name="parameters">
-    </wsdl:part>
-  </wsdl:message>
-
-  <wsdl:portType name="Endpoint">
-    <wsdl:operation name="echo">
-      <wsdl:input message="tns:echo" name="echo">
-    </wsdl:input>
-      <wsdl:output message="tns:echoResponse" name="echoResponse">
-    </wsdl:output>
-    </wsdl:operation>
-  </wsdl:portType>
-  <wsdl:binding name="EndpointServiceSoapBinding" type="tns:Endpoint">
-
-    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
-    <wsdl:operation name="echo">
-      <soap:operation soapAction="" style="document" />
-      <wsdl:input name="echo">
-        <soap:body use="literal" />
-      </wsdl:input>
-      <wsdl:output name="echoResponse">
-        <soap:body use="literal" />
-      </wsdl:output>
-
-    </wsdl:operation>
-  </wsdl:binding>
-  <wsdl:service name="EndpointService">
-    <wsdl:port binding="tns:EndpointServiceSoapBinding" name="EndpointPort">
-      <soap:address location="http://@jboss.bind.address@:8080/jaxws-cxf-bus/EndpointService/Endpoint" />
-    </wsdl:port>
-  </wsdl:service>
-</wsdl:definitions>
\ No newline at end of file

Copied: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/WEB-INF-client/wsdl/Endpoint.wsdl (from rev 13826, stack/cxf/branches/JBWS-3236/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/WEB-INF-client/wsdl/Endpoint.wsdl)
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/WEB-INF-client/wsdl/Endpoint.wsdl	                        (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/WEB-INF-client/wsdl/Endpoint.wsdl	2011-03-04 08:18:54 UTC (rev 13841)
@@ -0,0 +1,56 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<wsdl:definitions name="EndpointService" targetNamespace="http://org.jboss.ws/bus" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://org.jboss.ws/bus" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+  <wsdl:types>
+<xs:schema elementFormDefault="unqualified" targetNamespace="http://org.jboss.ws/bus" version="1.0" xmlns:tns="http://org.jboss.ws/bus" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+<xs:element name="echo" type="tns:echo" />
+<xs:element name="echoResponse" type="tns:echoResponse" />
+<xs:complexType name="echo">
+<xs:sequence>
+<xs:element minOccurs="0" name="arg0" type="xs:string" />
+</xs:sequence>
+</xs:complexType>
+<xs:complexType name="echoResponse">
+<xs:sequence>
+<xs:element minOccurs="0" name="return" type="xs:string" />
+</xs:sequence>
+</xs:complexType>
+</xs:schema>
+
+  </wsdl:types>
+  <wsdl:message name="echoResponse">
+    <wsdl:part element="tns:echoResponse" name="parameters">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="echo">
+    <wsdl:part element="tns:echo" name="parameters">
+    </wsdl:part>
+  </wsdl:message>
+
+  <wsdl:portType name="Endpoint">
+    <wsdl:operation name="echo">
+      <wsdl:input message="tns:echo" name="echo">
+    </wsdl:input>
+      <wsdl:output message="tns:echoResponse" name="echoResponse">
+    </wsdl:output>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:binding name="EndpointServiceSoapBinding" type="tns:Endpoint">
+
+    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
+    <wsdl:operation name="echo">
+      <soap:operation soapAction="" style="document" />
+      <wsdl:input name="echo">
+        <soap:body use="literal" />
+      </wsdl:input>
+      <wsdl:output name="echoResponse">
+        <soap:body use="literal" />
+      </wsdl:output>
+
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:service name="EndpointService">
+    <wsdl:port binding="tns:EndpointServiceSoapBinding" name="EndpointPort">
+      <soap:address location="http://@jboss.bind.address@:8080/jaxws-cxf-bus/EndpointService/Endpoint" />
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file



More information about the jbossws-commits mailing list