Author: richard.opalka(a)jboss.com
Date: 2009-04-23 04:01:13 -0400 (Thu, 23 Apr 2009)
New Revision: 9865
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase4/
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase4/client/
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase4/client/JBWS2074TestCase.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase4/service/
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase4/service/EJB3Iface.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase4/service/EJB3Impl.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase4/service/jaxws-service-handlers.xml
framework/trunk/testsuite/test/resources/jaxws/jbws2074/usecase4/
framework/trunk/testsuite/test/resources/jaxws/jbws2074/usecase4/META-INF/
framework/trunk/testsuite/test/resources/jaxws/jbws2074/usecase4/META-INF/ejb-jar.xml
Modified:
framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml
Log:
[JBWS-2074][JBWS-2631] providing JAX-WS handlers associated with EJB3 endpoint usecase
Modified: framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml
===================================================================
--- framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml 2009-04-22 15:41:17 UTC
(rev 9864)
+++ framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml 2009-04-23 08:01:13 UTC
(rev 9865)
@@ -548,6 +548,18 @@
<include
name="org/jboss/test/ws/jaxws/jbws2074/usecase3/service/POJOImpl.class"/>
</classes>
</war>
+ <jar
destfile="${tests.output.dir}/test-libs/jaxws-jbws2074-usecase4.jar">
+ <fileset dir="${tests.output.dir}/test-classes">
+ <include
name="org/jboss/test/ws/jaxws/jbws2074/usecase4/service/EJB3Iface.class"/>
+ <include
name="org/jboss/test/ws/jaxws/jbws2074/usecase4/service/EJB3Impl.class"/>
+ <include
name="org/jboss/test/ws/jaxws/jbws2074/handler/DescriptorResourcesHandler.class"/>
+ <include
name="org/jboss/test/ws/jaxws/jbws2074/handler/JavaResourcesHandler.class"/>
+ <include
name="org/jboss/test/ws/jaxws/jbws2074/usecase4/service/jaxws-service-handlers.xml"/>
+ </fileset>
+ <metainf
dir="${tests.output.dir}/test-resources/jaxws/jbws2074/usecase4/META-INF">
+ <include name="ejb-jar.xml"/>
+ </metainf>
+ </jar>
<!-- jaxws-jbws2150 -->
<war warfile="${tests.output.dir}/test-libs/jaxws-jbws2150.war"
webxml="${tests.output.dir}/test-resources/jaxws/jbws2150/WEB-INF/web.xml">
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase4/client/JBWS2074TestCase.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase4/client/JBWS2074TestCase.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase4/client/JBWS2074TestCase.java 2009-04-23
08:01:13 UTC (rev 9865)
@@ -0,0 +1,66 @@
+/*
+ * 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.ws.jaxws.jbws2074.usecase4.client;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.test.ws.jaxws.jbws2074.usecase4.service.EJB3Iface;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * [JBWS-2074] Resource injection in jaxws endpoints and handlers
+ *
+ * @author ropalka(a)redhat.com
+ */
+public final class JBWS2074TestCase extends JBossWSTest
+{
+
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(JBWS2074TestCase.class,
"jaxws-jbws2074-usecase4.jar");
+ }
+
+ public void testUsecase1() throws Exception
+ {
+ String endpointAddress = "http://" + getServerHost() +
":8080/jaxws-jbws2074-usecase4/Service";
+ QName serviceName = new
QName("http://ws.jboss.org/jbws2074",
"EJB3Service");
+ Service service = Service.create(new URL(endpointAddress + "?wsdl"),
serviceName);
+ EJB3Iface port = (EJB3Iface)service.getPort(EJB3Iface.class);
+
+ String retStr = port.echo("hello");
+
+ StringBuffer expStr = new StringBuffer("hello");
+ expStr.append(":Inbound:JavaResourcesHandler");
+ expStr.append(":Inbound:DescriptorResourcesHandler");
+ expStr.append(":EJB3Impl");
+ expStr.append(":Outbound:DescriptorResourcesHandler");
+ expStr.append(":Outbound:JavaResourcesHandler");
+ assertEquals(expStr.toString(), retStr);
+ }
+
+}
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase4/service/EJB3Iface.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase4/service/EJB3Iface.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase4/service/EJB3Iface.java 2009-04-23
08:01:13 UTC (rev 9865)
@@ -0,0 +1,36 @@
+/*
+ * 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.ws.jaxws.jbws2074.usecase4.service;
+
+import javax.ejb.Remote;
+import javax.jws.WebService;
+
+@Remote
+@WebService
+(
+ name = "EJB3",
+ targetNamespace = "http://ws.jboss.org/jbws2074"
+)
+public interface EJB3Iface
+{
+ String echo(String s);
+}
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase4/service/EJB3Impl.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase4/service/EJB3Impl.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase4/service/EJB3Impl.java 2009-04-23
08:01:13 UTC (rev 9865)
@@ -0,0 +1,56 @@
+/*
+ * 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.ws.jaxws.jbws2074.usecase4.service;
+
+import javax.ejb.Stateless;
+import javax.jws.HandlerChain;
+import javax.jws.WebService;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.annotation.WebContext;
+
+@Stateless
+@WebService
+(
+ name = "EJB3",
+ serviceName = "EJB3Service",
+ targetNamespace = "http://ws.jboss.org/jbws2074",
+ endpointInterface =
"org.jboss.test.ws.jaxws.jbws2074.usecase4.service.EJB3Iface"
+)
+@HandlerChain(file = "jaxws-service-handlers.xml")
+@WebContext
+(
+ urlPattern="/Service",
+ contextRoot="/jaxws-jbws2074-usecase4"
+)
+public class EJB3Impl implements EJB3Iface
+{
+
+ private static Logger log = Logger.getLogger(EJB3Impl.class);
+
+ public String echo(String msg)
+ {
+ log.info("echo: " + msg);
+ return msg + ":EJB3Impl";
+ }
+
+}
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase4/service/jaxws-service-handlers.xml
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase4/service/jaxws-service-handlers.xml
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase4/service/jaxws-service-handlers.xml 2009-04-23
08:01:13 UTC (rev 9865)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<handler-chains
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ns1="http://org.jboss.ws/jaxws/samples/logicalhandler"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
javaee_web_services_1_2.xsd">
+
+ <handler-chain>
+ <handler>
+ <handler-name>DescriptorResourcesHandler</handler-name>
+
<handler-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</handler-class>
+ </handler>
+ </handler-chain>
+
+ <handler-chain>
+ <handler>
+ <handler-name>JavaResourcesHandler</handler-name>
+
<handler-class>org.jboss.test.ws.jaxws.jbws2074.handler.JavaResourcesHandler</handler-class>
+ </handler>
+ </handler-chain>
+
+</handler-chains>
\ No newline at end of file
Added:
framework/trunk/testsuite/test/resources/jaxws/jbws2074/usecase4/META-INF/ejb-jar.xml
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/jbws2074/usecase4/META-INF/ejb-jar.xml
(rev 0)
+++
framework/trunk/testsuite/test/resources/jaxws/jbws2074/usecase4/META-INF/ejb-jar.xml 2009-04-23
08:01:13 UTC (rev 9865)
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ejb-jar version="3.0"
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/javaee/ejb-jar_3_0.xsd">
+
+ <enterprise-beans>
+ <session>
+
+ <ejb-name>EJB3Impl</ejb-name>
+
+ <env-entry>
+ <env-entry-name>boolean</env-entry-name>
+ <env-entry-type>java.lang.Boolean</env-entry-type>
+ <env-entry-value>true</env-entry-value>
+ <injection-target>
+
<injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>boolean0</injection-target-name>
+ </injection-target>
+ <injection-target>
+
<injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setBoolean1</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>byte</env-entry-name>
+ <env-entry-type>java.lang.Byte</env-entry-type>
+ <env-entry-value>1</env-entry-value>
+ <injection-target>
+
<injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>byte0</injection-target-name>
+ </injection-target>
+ <injection-target>
+
<injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setByte1</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>character</env-entry-name>
+ <env-entry-type>java.lang.Character</env-entry-type>
+ <env-entry-value>c</env-entry-value>
+ <injection-target>
+
<injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>character0</injection-target-name>
+ </injection-target>
+ <injection-target>
+
<injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setCharacter1</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>short</env-entry-name>
+ <env-entry-type>java.lang.Short</env-entry-type>
+ <env-entry-value>5</env-entry-value>
+ <injection-target>
+
<injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>short0</injection-target-name>
+ </injection-target>
+ <injection-target>
+
<injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setShort1</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>integer</env-entry-name>
+ <env-entry-type>java.lang.Integer</env-entry-type>
+ <env-entry-value>7</env-entry-value>
+ <injection-target>
+
<injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>integer0</injection-target-name>
+ </injection-target>
+ <injection-target>
+
<injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setInteger1</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>long</env-entry-name>
+ <env-entry-type>java.lang.Long</env-entry-type>
+ <env-entry-value>11</env-entry-value>
+ <injection-target>
+
<injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>long0</injection-target-name>
+ </injection-target>
+ <injection-target>
+
<injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setLong1</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>float</env-entry-name>
+ <env-entry-type>java.lang.Float</env-entry-type>
+ <env-entry-value>13</env-entry-value>
+ <injection-target>
+
<injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>float0</injection-target-name>
+ </injection-target>
+ <injection-target>
+
<injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setFloat1</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>double</env-entry-name>
+ <env-entry-type>java.lang.Double</env-entry-type>
+ <env-entry-value>17</env-entry-value>
+ <injection-target>
+
<injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>double0</injection-target-name>
+ </injection-target>
+ <injection-target>
+
<injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setDouble1</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>string</env-entry-name>
+ <env-entry-type>java.lang.String</env-entry-type>
+ <env-entry-value>s</env-entry-value>
+ <injection-target>
+
<injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>string0</injection-target-name>
+ </injection-target>
+ <injection-target>
+
<injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setString1</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ </session>
+
+ </enterprise-beans>
+
+</ejb-jar>