[jboss-cvs] JBossAS SVN: r92202 - in branches/JBPAPP_5_0/testsuite: src/main/org/jboss/test/ejb3 and 6 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Aug 10 13:46:50 EDT 2009


Author: wolfc
Date: 2009-08-10 13:46:49 -0400 (Mon, 10 Aug 2009)
New Revision: 92202

Added:
   branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/ejb3/webservice/
   branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/ejb3/webservice/EchoServiceRef.java
   branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/ejb3/webservice/EchoServiceRefBean.java
   branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/ejb3/webservice/WebServiceContextEndpoint.java
   branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/ejb3/webservice/WebServiceContextEndpointBean.java
   branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/ejb3/webservice/unit/
   branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/ejb3/webservice/unit/WebServiceUnitTestCase.java
   branches/JBPAPP_5_0/testsuite/src/resources/ejb3/webservice/
   branches/JBPAPP_5_0/testsuite/src/resources/ejb3/webservice/META-INF/
   branches/JBPAPP_5_0/testsuite/src/resources/ejb3/webservice/META-INF/ejb-jar.xml
   branches/JBPAPP_5_0/testsuite/src/resources/ejb3/webservice/META-INF/wsdl/
   branches/JBPAPP_5_0/testsuite/src/resources/ejb3/webservice/META-INF/wsdl/WebServiceContextEndpointBean.wsdl
Modified:
   branches/JBPAPP_5_0/testsuite/imports/sections/ejb3.xml
Log:
JBPAPP-613, JBPAPP-614, JBPAPP-620: unit test

Modified: branches/JBPAPP_5_0/testsuite/imports/sections/ejb3.xml
===================================================================
--- branches/JBPAPP_5_0/testsuite/imports/sections/ejb3.xml	2009-08-10 16:54:08 UTC (rev 92201)
+++ branches/JBPAPP_5_0/testsuite/imports/sections/ejb3.xml	2009-08-10 17:46:49 UTC (rev 92202)
@@ -124,7 +124,20 @@
       </copy>
    </target>
    
+   <target name="ejb3-webservice" depends="compile">
+      <mkdir dir="${build.lib}" />
+      
+      <jar destfile="${build.lib}/ejb3-webservice.jar">
+         <fileset dir="${build.classes}">
+            <!-- include name="org/jboss/test/ejb3/common/**" / -->
+            <include name="org/jboss/test/ejb3/webservice/**" />
+         </fileset>
+         <fileset dir="${source.resources}/ejb3/webservice" includes="**"/>
+      </jar>
+   </target>
+   
    <target name="_jars-ejb3" depends="ejb3-servlet,jbas6161,jbas6239,ejbthree1597,jbas5713,
+      ejb3-webservice,
       jbpapp2260
       ">
       <mkdir dir="${build.lib}" />

Added: branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/ejb3/webservice/EchoServiceRef.java
===================================================================
--- branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/ejb3/webservice/EchoServiceRef.java	                        (rev 0)
+++ branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/ejb3/webservice/EchoServiceRef.java	2009-08-10 17:46:49 UTC (rev 92202)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.ejb3.webservice;
+
+import javax.ejb.Remote;
+
+/**
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+ at Remote
+public interface EchoServiceRef
+{
+   String echo(String msg);
+}

Added: branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/ejb3/webservice/EchoServiceRefBean.java
===================================================================
--- branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/ejb3/webservice/EchoServiceRefBean.java	                        (rev 0)
+++ branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/ejb3/webservice/EchoServiceRefBean.java	2009-08-10 17:46:49 UTC (rev 92202)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.ejb3.webservice;
+
+import javax.ejb.Stateless;
+
+/**
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+ at Stateless
+public class EchoServiceRefBean implements EchoServiceRef
+{
+   // JBPAPP-613: should come in via xml
+   private WebServiceContextEndpoint endpoint;
+
+   public String echo(String msg)
+   {
+      return endpoint.echo(msg);
+   }
+}

Added: branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/ejb3/webservice/WebServiceContextEndpoint.java
===================================================================
--- branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/ejb3/webservice/WebServiceContextEndpoint.java	                        (rev 0)
+++ branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/ejb3/webservice/WebServiceContextEndpoint.java	2009-08-10 17:46:49 UTC (rev 92202)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.ejb3.webservice;
+
+import javax.jws.WebService;
+
+/**
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ * @version $Revision: $
+ */
+ at WebService
+public interface WebServiceContextEndpoint
+{
+   String echo(String msg);
+   
+   String report();
+}

Added: branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/ejb3/webservice/WebServiceContextEndpointBean.java
===================================================================
--- branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/ejb3/webservice/WebServiceContextEndpointBean.java	                        (rev 0)
+++ branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/ejb3/webservice/WebServiceContextEndpointBean.java	2009-08-10 17:46:49 UTC (rev 92202)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.ejb3.webservice;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.Resource;
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.WebServiceException;
+
+/**
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ * @version $Revision: $
+ */
+ at Stateless
+ at WebService(endpointInterface="org.jboss.test.ejb3.webservice.WebServiceContextEndpoint")
+public class WebServiceContextEndpointBean implements WebServiceContextEndpoint
+{
+   @Resource
+   private WebServiceContext wsCtx;
+
+   @PostConstruct
+   public void init()
+   {
+      if(null == wsCtx)
+         throw new WebServiceException("WebService context is null @PostConstruct");
+   }
+
+   public String echo(String msg)
+   {
+      return msg +": " +wsCtx.getMessageContext();
+   }
+
+   public String report()
+   {
+      return wsCtx.toString();
+   }
+}

Added: branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/ejb3/webservice/unit/WebServiceUnitTestCase.java
===================================================================
--- branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/ejb3/webservice/unit/WebServiceUnitTestCase.java	                        (rev 0)
+++ branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/ejb3/webservice/unit/WebServiceUnitTestCase.java	2009-08-10 17:46:49 UTC (rev 92202)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.ejb3.webservice.unit;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.test.ejb3.common.EJB3TestCase;
+import org.jboss.test.ejb3.webservice.EchoServiceRef;
+import org.jboss.test.ejb3.webservice.WebServiceContextEndpoint;
+
+/**
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class WebServiceUnitTestCase extends EJB3TestCase
+{
+   public WebServiceUnitTestCase(String name)
+   {
+      super(name);
+   }
+   
+   public void testJBPAPP613() throws Exception
+   {
+      EchoServiceRef bean = lookup("EchoServiceRefBean/remote", EchoServiceRef.class);
+      
+      String response = bean.echo("JBPAPP-613");
+      assertNotNull(response);
+   }
+   
+   public void testJBPAPP614() throws Exception
+   {
+      Service service = Service.create(
+            new URL("http://"+getServerHost()+":8080/ejb3-webservice/WebServiceContextEndpointBean?wsdl"),
+            new QName("http://webservice.ejb3.test.jboss.org/","WebServiceContextEndpointBeanService")
+          );
+
+      WebServiceContextEndpoint port = service.getPort(WebServiceContextEndpoint.class);
+      String response = port.report();
+      assertNotNull(response);
+   }
+   
+   public void testJBPAPP620() throws Exception
+   {
+      Service service = Service.create(
+            new URL("http://"+getServerHost()+":8080/ejb3-webservice/WebServiceContextEndpointBean?wsdl"),
+            new QName("http://webservice.ejb3.test.jboss.org/","WebServiceContextEndpointBeanService")
+          );
+
+      String msg = "JBPAPP-620";
+      WebServiceContextEndpoint port = service.getPort(WebServiceContextEndpoint.class);
+      String response = port.echo(msg);
+      assertNotNull(response);
+   }
+   
+   public static Test suite() throws Exception
+   {
+      return getDeploySetup(WebServiceUnitTestCase.class, "ejb3-webservice.jar");
+   }
+
+}

Added: branches/JBPAPP_5_0/testsuite/src/resources/ejb3/webservice/META-INF/ejb-jar.xml
===================================================================
--- branches/JBPAPP_5_0/testsuite/src/resources/ejb3/webservice/META-INF/ejb-jar.xml	                        (rev 0)
+++ branches/JBPAPP_5_0/testsuite/src/resources/ejb3/webservice/META-INF/ejb-jar.xml	2009-08-10 17:46:49 UTC (rev 92202)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" 
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+   version="3.0" 
+   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
+   <enterprise-beans>
+      <session>
+         <ejb-name>EchoServiceRefBean</ejb-name>
+         <service-ref>
+            <service-ref-name>endpoint</service-ref-name>
+            <service-interface>javax.xml.ws.Service</service-interface>
+            <wsdl-file>META-INF/wsdl/WebServiceContextEndpointBean.wsdl</wsdl-file>
+            <injection-target>
+               <injection-target-class>org.jboss.test.ejb3.webservice.EchoServiceRefBean</injection-target-class>
+               <injection-target-name>endpoint</injection-target-name>
+            </injection-target>
+         </service-ref>
+      </session>
+   </enterprise-beans>
+</ejb-jar>
\ No newline at end of file

Added: branches/JBPAPP_5_0/testsuite/src/resources/ejb3/webservice/META-INF/wsdl/WebServiceContextEndpointBean.wsdl
===================================================================
--- branches/JBPAPP_5_0/testsuite/src/resources/ejb3/webservice/META-INF/wsdl/WebServiceContextEndpointBean.wsdl	                        (rev 0)
+++ branches/JBPAPP_5_0/testsuite/src/resources/ejb3/webservice/META-INF/wsdl/WebServiceContextEndpointBean.wsdl	2009-08-10 17:46:49 UTC (rev 92202)
@@ -0,0 +1,84 @@
+<definitions name='WebServiceContextEndpointBeanService' targetNamespace='http://webservice.ejb3.test.jboss.org/' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://webservice.ejb3.test.jboss.org/' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types>
+  <xs:schema targetNamespace='http://webservice.ejb3.test.jboss.org/' version='1.0' xmlns:tns='http://webservice.ejb3.test.jboss.org/' xmlns:xs='http://www.w3.org/2001/XMLSchema'>
+   <xs:element name='echo' type='tns:echo'/>
+   <xs:element name='echoResponse' type='tns:echoResponse'/>
+   <xs:element name='report' type='tns:report'/>
+   <xs:element name='reportResponse' type='tns:reportResponse'/>
+   <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:complexType name='report'>
+
+    <xs:sequence/>
+   </xs:complexType>
+   <xs:complexType name='reportResponse'>
+    <xs:sequence>
+     <xs:element minOccurs='0' name='return' type='xs:string'/>
+    </xs:sequence>
+   </xs:complexType>
+  </xs:schema>
+ </types>
+
+ <message name='WebServiceContextEndpoint_echo'>
+  <part element='tns:echo' name='echo'></part>
+ </message>
+ <message name='WebServiceContextEndpoint_reportResponse'>
+  <part element='tns:reportResponse' name='reportResponse'></part>
+ </message>
+ <message name='WebServiceContextEndpoint_report'>
+  <part element='tns:report' name='report'></part>
+ </message>
+
+ <message name='WebServiceContextEndpoint_echoResponse'>
+  <part element='tns:echoResponse' name='echoResponse'></part>
+ </message>
+ <portType name='WebServiceContextEndpoint'>
+  <operation name='echo' parameterOrder='echo'>
+   <input message='tns:WebServiceContextEndpoint_echo'></input>
+   <output message='tns:WebServiceContextEndpoint_echoResponse'></output>
+  </operation>
+  <operation name='report' parameterOrder='report'>
+
+   <input message='tns:WebServiceContextEndpoint_report'></input>
+   <output message='tns:WebServiceContextEndpoint_reportResponse'></output>
+  </operation>
+ </portType>
+ <binding name='WebServiceContextEndpointBinding' type='tns:WebServiceContextEndpoint'>
+  <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
+  <operation name='echo'>
+   <soap:operation soapAction=''/>
+   <input>
+
+    <soap:body use='literal'/>
+   </input>
+   <output>
+    <soap:body use='literal'/>
+   </output>
+  </operation>
+  <operation name='report'>
+   <soap:operation soapAction=''/>
+   <input>
+
+    <soap:body use='literal'/>
+   </input>
+   <output>
+    <soap:body use='literal'/>
+   </output>
+  </operation>
+ </binding>
+ <service name='WebServiceContextEndpointBeanService'>
+  <port binding='tns:WebServiceContextEndpointBinding' name='WebServiceContextEndpointBeanPort'>
+
+   <soap:address location='http://localhost:8080/ejb3-webservice/WebServiceContextEndpointBean'/>
+  </port>
+ </service>
+</definitions>
\ No newline at end of file




More information about the jboss-cvs-commits mailing list