[jboss-svn-commits] JBL Code SVN: r34485 - in labs/jbossesb/trunk/qa/junit: resources/server and 7 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Aug 3 13:04:22 EDT 2010


Author: kevin.conner at jboss.com
Date: 2010-08-03 13:04:21 -0400 (Tue, 03 Aug 2010)
New Revision: 34485

Added:
   labs/jbossesb/trunk/qa/junit/resources/server/http_proxy/
   labs/jbossesb/trunk/qa/junit/resources/server/http_proxy/META-INF/
   labs/jbossesb/trunk/qa/junit/resources/server/http_proxy/META-INF/deployment.xml
   labs/jbossesb/trunk/qa/junit/resources/server/http_proxy/META-INF/jboss-esb.xml
   labs/jbossesb/trunk/qa/junit/resources/server/http_proxy/wsbarrier-service.xml
   labs/jbossesb/trunk/qa/junit/resources/server/http_proxy_ws/
   labs/jbossesb/trunk/qa/junit/resources/server/http_proxy_ws/WEB-INF/
   labs/jbossesb/trunk/qa/junit/resources/server/http_proxy_ws/WEB-INF/web.xml
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/http_proxy/
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/http_proxy/HttpProxyUnitTest.java
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/http_proxy_ws/
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/http_proxy_ws/HelloWorldWS.java
Modified:
   labs/jbossesb/trunk/qa/junit/build.xml
Log:
Integration test for JBESB-3412

Modified: labs/jbossesb/trunk/qa/junit/build.xml
===================================================================
--- labs/jbossesb/trunk/qa/junit/build.xml	2010-08-03 16:38:44 UTC (rev 34484)
+++ labs/jbossesb/trunk/qa/junit/build.xml	2010-08-03 17:04:21 UTC (rev 34485)
@@ -201,6 +201,17 @@
             <include name="org/jboss/soa/esb/server/sysprop/*.class"/>
          </classes>
       </war>
+      <jar jarfile="${qa.build.lib}/http_proxy.esb">
+         <fileset dir="${qa.junit.resources}/server/http_proxy">
+            <include name="*.xml"/>
+            <include name="META-INF/*.xml"/>
+         </fileset>
+      </jar>
+      <war jarfile="${qa.build.lib}/http_proxy_ws.war" webxml="${qa.junit.resources}/server/http_proxy_ws/WEB-INF/web.xml">
+         <classes dir="${qa.junit.classes}">
+            <include name="org/jboss/soa/esb/server/http_proxy_ws/*.class"/>
+         </classes>
+      </war>
    </target>
 
    <target name="one-test" if="test" depends="jars"

Added: labs/jbossesb/trunk/qa/junit/resources/server/http_proxy/META-INF/deployment.xml
===================================================================
--- labs/jbossesb/trunk/qa/junit/resources/server/http_proxy/META-INF/deployment.xml	                        (rev 0)
+++ labs/jbossesb/trunk/qa/junit/resources/server/http_proxy/META-INF/deployment.xml	2010-08-03 17:04:21 UTC (rev 34485)
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<jbossesb-deployment>
+  <depends>jboss.ws:context=http_proxy_ws,endpoint=HelloWorldWS.Barrier</depends>
+</jbossesb-deployment>


Property changes on: labs/jbossesb/trunk/qa/junit/resources/server/http_proxy/META-INF/deployment.xml
___________________________________________________________________
Name: svn:mime-type
   + text/xml
Name: svn:keywords
   + Rev Date
Name: svn:eol-style
   + native

Added: labs/jbossesb/trunk/qa/junit/resources/server/http_proxy/META-INF/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/qa/junit/resources/server/http_proxy/META-INF/jboss-esb.xml	                        (rev 0)
+++ labs/jbossesb/trunk/qa/junit/resources/server/http_proxy/META-INF/jboss-esb.xml	2010-08-03 17:04:21 UTC (rev 34485)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.2.0.xsd">
+    <services>
+        <service category="Test" name="SOAPProxyTest" description="Test WebService Proxy" invmScope="GLOBAL">
+            <listeners>
+                <http-gateway name="TestProxyGateway"/>
+            </listeners>
+            <actions mep="RequestResponse">
+                <action name="proxy" class="org.jboss.soa.esb.actions.soap.proxy.SOAPProxy">
+                    <property name="wsdl" value="internal://jboss.ws:context=http_proxy_ws,endpoint=HelloWorldWS"/>
+                </action>
+            </actions>
+        </service>
+    </services>
+</jbossesb>


Property changes on: labs/jbossesb/trunk/qa/junit/resources/server/http_proxy/META-INF/jboss-esb.xml
___________________________________________________________________
Name: svn:mime-type
   + text/xml
Name: svn:keywords
   + Rev Date
Name: svn:eol-style
   + native

Added: labs/jbossesb/trunk/qa/junit/resources/server/http_proxy/wsbarrier-service.xml
===================================================================
--- labs/jbossesb/trunk/qa/junit/resources/server/http_proxy/wsbarrier-service.xml	                        (rev 0)
+++ labs/jbossesb/trunk/qa/junit/resources/server/http_proxy/wsbarrier-service.xml	2010-08-03 17:04:21 UTC (rev 34485)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+    <mbean code="org.jboss.internal.soa.esb.dependencies.WSDeploymentBarrierController" name="jboss.esb:service=TestProxyHelloWorldWSBarrierController">
+        <attribute name="WsObjectName">jboss.ws:context=http_proxy_ws,endpoint=HelloWorldWS</attribute>
+    </mbean>
+</server>


Property changes on: labs/jbossesb/trunk/qa/junit/resources/server/http_proxy/wsbarrier-service.xml
___________________________________________________________________
Name: svn:mime-type
   + text/xml
Name: svn:keywords
   + Rev Date
Name: svn:eol-style
   + native

Added: labs/jbossesb/trunk/qa/junit/resources/server/http_proxy_ws/WEB-INF/web.xml
===================================================================
--- labs/jbossesb/trunk/qa/junit/resources/server/http_proxy_ws/WEB-INF/web.xml	                        (rev 0)
+++ labs/jbossesb/trunk/qa/junit/resources/server/http_proxy_ws/WEB-INF/web.xml	2010-08-03 17:04:21 UTC (rev 34485)
@@ -0,0 +1,13 @@
+<?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">  
+  <servlet> 
+    <servlet-name>HelloWorldWS</servlet-name>  
+    <servlet-class>org.jboss.soa.esb.server.http_proxy_ws.HelloWorldWS</servlet-class>  
+  </servlet>  
+  
+  <servlet-mapping> 
+    <servlet-name>HelloWorldWS</servlet-name>  
+    <url-pattern>/HelloWorldWS</url-pattern> 
+  </servlet-mapping>   
+</web-app>


Property changes on: labs/jbossesb/trunk/qa/junit/resources/server/http_proxy_ws/WEB-INF/web.xml
___________________________________________________________________
Name: svn:mime-type
   + text/xml
Name: svn:keywords
   + Rev Date
Name: svn:eol-style
   + native

Added: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/http_proxy/HttpProxyUnitTest.java
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/http_proxy/HttpProxyUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/http_proxy/HttpProxyUnitTest.java	2010-08-03 17:04:21 UTC (rev 34485)
@@ -0,0 +1,98 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ */
+package org.jboss.soa.esb.server.http_proxy;
+
+import java.io.InputStream;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamReader;
+
+import junit.framework.Test;
+
+import org.jboss.internal.soa.esb.util.XMLHelper;
+import org.jboss.internal.soa.esb.util.stax.StreamHelper;
+import org.jboss.test.JBossTestCase;
+
+/**
+ * Test SOAPProxy via HttpGateway.
+ * 
+ * @author <a href='mailto:kevin.conner at jboss.com'>Kevin Conner</a>
+ */
+public class HttpProxyUnitTest extends JBossTestCase
+{
+    /**
+     * The name of the deployment archive.
+     */
+    private static final String ESB_ARCHIVE = "http_proxy.esb" ;
+    /**
+     * The name of the ws archive.
+     */
+    private static final String WS_ARCHIVE = "http_proxy_ws.war" ;
+    /**
+     * The WSDL location.
+     */
+    private static final String WSDL_URL = "http://127.0.0.1:8080/http_proxy/http/Test/SOAPProxyTest?wsdl" ;
+    
+    /**
+     * Construct the test case with the specified name.
+     * @param name The name of the test case.
+     */
+    public HttpProxyUnitTest(final String name)
+    {
+        super(name) ;
+    }
+    
+    /**
+     * Test WSDL generation.
+     * @throws Exception For any failures.
+     */
+    public void testWSDLGeneration()
+        throws Exception
+    {
+        final URL wsdlUrl = new URL(WSDL_URL) ;
+        final InputStream is = wsdlUrl.openStream() ;
+        try
+        {
+            final XMLStreamReader reader = XMLHelper.getXMLStreamReader(is) ;
+            StreamHelper.skipToNextStartElement(reader) ;
+            assertEquals("definitions local name", "definitions", reader.getLocalName()) ;
+            // Should be an embedded element here
+            StreamHelper.skipToNextStartElement(reader) ;
+            assertEquals("types local name", "types", reader.getLocalName()) ;
+        }
+        finally
+        {
+            try
+            {
+                is.close() ;
+            }
+            catch (final Throwable th) {} // ignore
+        }
+    }
+    
+    /**
+     * Create the test suite.
+     * @return The suite representing this test case.
+     */
+    public static Test suite()
+        throws Exception
+    {
+        return getDeploySetup(HttpProxyUnitTest.class, WS_ARCHIVE + ", " + ESB_ARCHIVE);
+    }
+}


Property changes on: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/http_proxy/HttpProxyUnitTest.java
___________________________________________________________________
Name: svn:keywords
   + Rev Date
Name: svn:eol-style
   + native

Added: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/http_proxy_ws/HelloWorldWS.java
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/http_proxy_ws/HelloWorldWS.java	                        (rev 0)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/http_proxy_ws/HelloWorldWS.java	2010-08-03 17:04:21 UTC (rev 34485)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ */
+package org.jboss.soa.esb.server.http_proxy_ws;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+
+/**
+ * Simple rpc-style webservice that returns a hello greeting (using the passed-in name) and the current date.
+ * 
+ * @author dward at jboss.org
+ */
+ at WebService(name = "HelloWorld", targetNamespace = "http://http_proxy_ws/helloworld")
+public class HelloWorldWS
+{
+    @WebMethod
+    public String sayHello(@WebParam(name = "toWhom") String toWhom)
+    {
+        return "Hello '" + toWhom + "' on " + new java.util.Date();
+    }
+}


Property changes on: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/http_proxy_ws/HelloWorldWS.java
___________________________________________________________________
Name: svn:keywords
   + Rev Date
Name: svn:eol-style
   + native



More information about the jboss-svn-commits mailing list