[jboss-cvs] JBossAS SVN: r88263 - in branches/Branch_5_x/testsuite: src/main/org/jboss/test/ws/jaxws/ejb3Integration and 16 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed May 6 09:38:00 EDT 2009


Author: richard.opalka at jboss.com
Date: 2009-05-06 09:38:00 -0400 (Wed, 06 May 2009)
New Revision: 88263

Added:
   branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/
   branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/InjectionTestCase.java
   branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/shared/
   branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/shared/BeanIface.java
   branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/shared/BeanImpl.java
   branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/shared/handlers/
   branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/shared/handlers/TestHandler.java
   branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/webservice/
   branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/webservice/AbstractEndpointImpl.java
   branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/webservice/EJB3Bean.java
   branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/webservice/EndpointIface.java
   branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/webservice/POJOBean.java
   branches/Branch_5_x/testsuite/src/resources/ws/jaxws/ejb3Integration/injection/
   branches/Branch_5_x/testsuite/src/resources/ws/jaxws/ejb3Integration/injection/META-INF/
   branches/Branch_5_x/testsuite/src/resources/ws/jaxws/ejb3Integration/injection/META-INF/application.xml
   branches/Branch_5_x/testsuite/src/resources/ws/jaxws/ejb3Integration/injection/META-INF/ejb-jar.xml
   branches/Branch_5_x/testsuite/src/resources/ws/jaxws/ejb3Integration/injection/WEB-INF/
   branches/Branch_5_x/testsuite/src/resources/ws/jaxws/ejb3Integration/injection/WEB-INF/web.xml
   branches/Branch_5_x/testsuite/src/resources/ws/jaxws/ejb3Integration/injection/org/
   branches/Branch_5_x/testsuite/src/resources/ws/jaxws/ejb3Integration/injection/org/jboss/
   branches/Branch_5_x/testsuite/src/resources/ws/jaxws/ejb3Integration/injection/org/jboss/test/
   branches/Branch_5_x/testsuite/src/resources/ws/jaxws/ejb3Integration/injection/org/jboss/test/ws/
   branches/Branch_5_x/testsuite/src/resources/ws/jaxws/ejb3Integration/injection/org/jboss/test/ws/jaxws/
   branches/Branch_5_x/testsuite/src/resources/ws/jaxws/ejb3Integration/injection/org/jboss/test/ws/jaxws/ejb3Integration/
   branches/Branch_5_x/testsuite/src/resources/ws/jaxws/ejb3Integration/injection/org/jboss/test/ws/jaxws/ejb3Integration/injection/
   branches/Branch_5_x/testsuite/src/resources/ws/jaxws/ejb3Integration/injection/org/jboss/test/ws/jaxws/ejb3Integration/injection/webservice/
   branches/Branch_5_x/testsuite/src/resources/ws/jaxws/ejb3Integration/injection/org/jboss/test/ws/jaxws/ejb3Integration/injection/webservice/jaxws-handler.xml
Modified:
   branches/Branch_5_x/testsuite/imports/sections/ws.xml
Log:
[JBWS-2634] providing test case

Modified: branches/Branch_5_x/testsuite/imports/sections/ws.xml
===================================================================
--- branches/Branch_5_x/testsuite/imports/sections/ws.xml	2009-05-06 13:37:27 UTC (rev 88262)
+++ branches/Branch_5_x/testsuite/imports/sections/ws.xml	2009-05-06 13:38:00 UTC (rev 88263)
@@ -95,6 +95,45 @@
       </fileset>
     </jar>
     
+    <!-- jaxws-injection -->
+    <jar destfile="${build.lib}/jaxws-injection.jar">
+      <fileset dir="${build.classes}">
+        <include name="org/jboss/test/ws/jaxws/ejb3Integration/injection/shared/*.class"/>
+      </fileset>
+    </jar>
+    <war destfile="${build.lib}/jaxws-injection-pojo.war" 
+      webxml="${build.resources}/ws/jaxws/ejb3Integration/injection/WEB-INF/web.xml">
+      <classes dir="${build.classes}">
+        <include name="org/jboss/test/ws/jaxws/ejb3Integration/injection/webservice/POJOBean.class"/>
+        <include name="org/jboss/test/ws/jaxws/ejb3Integration/injection/webservice/EndpointIface.class"/>
+        <include name="org/jboss/test/ws/jaxws/ejb3Integration/injection/webservice/AbstractEndpointImpl.class"/>
+        <include name="org/jboss/test/ws/jaxws/ejb3Integration/injection/shared/handlers/TestHandler.class"/>
+      </classes>
+      <fileset dir="${build.resources}/ws/jaxws/ejb3Integration/injection">
+        <include name="org/jboss/test/ws/jaxws/ejb3Integration/injection/webservice/jaxws-handler.xml"/>
+      </fileset>
+    </war>
+    <jar destfile="${build.lib}/jaxws-injection-ejb3.jar">
+      <fileset dir="${build.classes}">
+        <include name="org/jboss/test/ws/jaxws/ejb3Integration/injection/webservice/EJB3Bean.class"/>
+        <include name="org/jboss/test/ws/jaxws/ejb3Integration/injection/webservice/EndpointIface.class"/>
+        <include name="org/jboss/test/ws/jaxws/ejb3Integration/injection/webservice/AbstractEndpointImpl.class"/>
+        <include name="org/jboss/test/ws/jaxws/ejb3Integration/injection/shared/handlers/TestHandler.class"/>
+      </fileset>
+      <fileset dir="${build.resources}/ws/jaxws/ejb3Integration/injection">
+        <include name="org/jboss/test/ws/jaxws/ejb3Integration/injection/webservice/jaxws-handler.xml"/>
+      </fileset>
+      <metainf dir="${build.resources}/ws/jaxws/ejb3Integration/injection/META-INF">
+        <include name="ejb-jar.xml"/>
+      </metainf>
+    </jar>
+    <ear appxml="${build.resources}/ws/jaxws/ejb3Integration/injection/META-INF/application.xml"
+      earfile="${build.lib}/jaxws-injection.ear">
+      <fileset file="${build.lib}/jaxws-injection.jar"/>
+      <fileset file="${build.lib}/jaxws-injection-ejb3.jar"/>
+      <fileset file="${build.lib}/jaxws-injection-pojo.war"/>
+    </ear>
+
   </target>
 
 </project>

Added: branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/InjectionTestCase.java
===================================================================
--- branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/InjectionTestCase.java	                        (rev 0)
+++ branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/InjectionTestCase.java	2009-05-06 13:38:00 UTC (rev 88263)
@@ -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.ejb3Integration.injection;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.test.ws.jaxws.ejb3Integration.injection.webservice.EndpointIface;
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.JBossWSTestSetup;
+
+/**
+ * [JBWS-2634] Implement support for @EJB annotations in WS components
+ *
+ * @author <a href="mailto:richard.opalka at jboss.org">Richard Opalka</a>
+ */
+public final class InjectionTestCase extends JBossWSTest
+{
+   public static Test suite()
+   {
+      return JBossWSTestSetup.newTestSetup(InjectionTestCase.class, "jaxws-injection.ear");
+   }
+
+   public void testPojoEndpoint() throws Exception
+   {
+      QName serviceName = new QName("http://jbossws.org/injection", "POJOService");
+      URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-injection-pojo/POJOService?wsdl");
+
+      Service service = Service.create(wsdlURL, serviceName);
+      EndpointIface proxy = (EndpointIface)service.getPort(EndpointIface.class);
+      assertEquals("Hello World!:Inbound:TestHandler:POJOBean:Outbound:TestHandler", proxy.echo("Hello World!"));
+   }
+
+   public void testEjb3Endpoint() throws Exception
+   {
+      QName serviceName = new QName("http://jbossws.org/injection", "EJB3Service");
+      URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-injection-ejb3/EJB3Service?wsdl");
+
+      Service service = Service.create(wsdlURL, serviceName);
+      EndpointIface proxy = (EndpointIface)service.getPort(EndpointIface.class);
+      assertEquals("Hello World!:Inbound:TestHandler:EJB3Bean:Outbound:TestHandler", proxy.echo("Hello World!"));
+   }
+}

Added: branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/shared/BeanIface.java
===================================================================
--- branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/shared/BeanIface.java	                        (rev 0)
+++ branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/shared/BeanIface.java	2009-05-06 13:38:00 UTC (rev 88263)
@@ -0,0 +1,32 @@
+/*
+ * 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.ejb3Integration.injection.shared;
+
+/**
+ * The EJB3 interface
+ *
+ * @author <a href="mailto:richard.opalka at jboss.org">Richard Opalka</a>
+ */
+public interface BeanIface
+{
+   String printString();
+}

Added: branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/shared/BeanImpl.java
===================================================================
--- branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/shared/BeanImpl.java	                        (rev 0)
+++ branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/shared/BeanImpl.java	2009-05-06 13:38:00 UTC (rev 88263)
@@ -0,0 +1,38 @@
+/*
+ * 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.ejb3Integration.injection.shared;
+
+import javax.ejb.Stateless;
+
+/**
+ * The EJB3 implementation
+ *
+ * @author <a href="mailto:richard.opalka at jboss.org">Richard Opalka</a>
+ */
+ at Stateless
+public class BeanImpl implements BeanIface
+{
+   public String printString()
+   {
+      return "Injected hello message";
+   }
+}

Added: branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/shared/handlers/TestHandler.java
===================================================================
--- branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/shared/handlers/TestHandler.java	                        (rev 0)
+++ branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/shared/handlers/TestHandler.java	2009-05-06 13:38:00 UTC (rev 88263)
@@ -0,0 +1,120 @@
+/*
+ * 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.ejb3Integration.injection.shared.handlers;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.Resource;
+import javax.ejb.EJB;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.jboss.logging.Logger;
+import org.jboss.test.ws.jaxws.ejb3Integration.injection.shared.BeanIface;
+import org.jboss.wsf.common.handler.GenericSOAPHandler;
+
+/**
+ * This handler is initialized via injections.
+ *
+ * @author <a href="mailto:richard.opalka at jboss.org">Richard Opalka</a>
+ */
+public final class TestHandler extends GenericSOAPHandler
+{
+   // provide logging
+   private static final Logger log = Logger.getLogger(TestHandler.class);
+
+   @Resource
+   private Boolean boolean1;
+
+   @EJB
+   private BeanIface bean1;
+
+   /**
+    * Indicates whether handler is in correct state.
+    */
+   private boolean correctState;
+
+   @PostConstruct
+   private void init()
+   {
+      boolean correctInitialization = true;
+
+      // verify @Resource annotation driven injection
+      if (this.boolean1 == null || this.boolean1 != true)
+      {
+         log.error("Annotation driven initialization for boolean1 failed");
+         correctInitialization = false;
+      }
+      // verify @EJB annotation driven injection
+      if (this.bean1 == null || !this.bean1.printString().equals("Injected hello message"))
+      {
+         log.error("Annotation driven initialization for bean1 failed");
+         correctInitialization = false;
+      }
+
+      this.correctState = correctInitialization;
+   }
+
+   @Override
+   public boolean handleOutbound(MessageContext msgContext)
+   {
+      return ensureInjectionsAndInitialization(msgContext, "Outbound");
+   }
+
+   @Override
+   public boolean handleInbound(MessageContext msgContext)
+   {
+      return ensureInjectionsAndInitialization(msgContext, "Inbound");
+   }
+
+   private boolean ensureInjectionsAndInitialization(MessageContext msgContext, String direction)
+   {
+      if (!this.correctState)
+      {
+         throw new WebServiceException("Unfunctional injections");
+      }
+
+      try
+      {
+         SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
+         SOAPElement soapElement = (SOAPElement)soapMessage.getSOAPBody().getChildElements().next();
+         soapElement = (SOAPElement)soapElement.getChildElements().next();
+
+         String oldValue = soapElement.getValue();
+         String newValue = oldValue + ":" + direction + ":TestHandler";
+         soapElement.setValue(newValue);
+
+         log.debug("oldValue: " + oldValue);
+         log.debug("newValue: " + newValue);
+
+         return true;
+      }
+      catch (SOAPException ex)
+      {
+         throw new WebServiceException(ex);
+      }
+   }
+
+}

Added: branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/webservice/AbstractEndpointImpl.java
===================================================================
--- branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/webservice/AbstractEndpointImpl.java	                        (rev 0)
+++ branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/webservice/AbstractEndpointImpl.java	2009-05-06 13:38:00 UTC (rev 88263)
@@ -0,0 +1,112 @@
+/*
+ * 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.ejb3Integration.injection.webservice;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.Resource;
+import javax.ejb.EJB;
+import javax.xml.ws.WebServiceException;
+
+import org.jboss.logging.Logger;
+import org.jboss.test.ws.jaxws.ejb3Integration.injection.shared.BeanIface;
+
+/**
+ * Basic endpoint implementation.
+ *
+ * @author <a href="mailto:richard.opalka at jboss.org">Richard Opalka</a>
+ */
+public abstract class AbstractEndpointImpl implements EndpointIface
+{
+
+   private static final Logger LOG = Logger.getLogger(AbstractEndpointImpl.class);
+
+   private boolean correctState;
+   @EJB
+   private BeanIface testBean2;
+
+   private BeanIface testBean1;
+
+   @EJB
+   private void setBean(BeanIface bean)
+   {
+      this.testBean1 = bean;
+   }
+
+   private Boolean boolean1;
+
+   /**
+    * EJB 3.0 16.2.2: "By default, the name of the field is combined with the
+    * name of the class in which the annotation is used and is used directly
+    * as the name in the bean’s naming context
+    */
+   @Resource(name="boolean1")
+   private void setBoolean1(Boolean b)
+   {
+      this.boolean1 = b;
+   }
+
+   public String echo(final String msg)
+   {
+      if (!this.correctState)
+      {
+         throw new WebServiceException("Injection failed");
+      }
+
+      LOG.info("echo: " + msg);
+      return msg;
+   }
+
+   @PostConstruct
+   private void init()
+   {
+      boolean currentState = true;
+
+      if (this.testBean1 == null)
+      {
+         LOG.error("Annotation driven initialization for testBean1 failed");
+         currentState = false;
+      }
+      if (!"Injected hello message".equals(testBean1.printString())) 
+      {
+         LOG.error("Annotation driven initialization for testBean1 failed");
+         currentState = false;
+      }
+      if (this.testBean2 == null)
+      {
+         LOG.error("Annotation driven initialization for testBean2 failed");
+         currentState = false;
+      }
+      if (!"Injected hello message".equals(testBean2.printString())) 
+      {
+         LOG.error("Annotation driven initialization for testBean2 failed");
+         currentState = false;
+      }
+      if (this.boolean1 == null || this.boolean1 != true)
+      {
+         LOG.error("Annotation driven initialization for boolean1 failed");
+         currentState = false;
+      }
+
+      this.correctState = currentState;
+   }
+
+}

Added: branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/webservice/EJB3Bean.java
===================================================================
--- branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/webservice/EJB3Bean.java	                        (rev 0)
+++ branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/webservice/EJB3Bean.java	2009-05-06 13:38:00 UTC (rev 88263)
@@ -0,0 +1,57 @@
+/*
+ * 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.ejb3Integration.injection.webservice;
+
+import javax.ejb.Stateless;
+import javax.jws.HandlerChain;
+import javax.jws.WebService;
+
+import org.jboss.wsf.spi.annotation.WebContext;
+
+/**
+ * EJB3 bean published as WebService injecting other EJB3 bean.
+ *
+ * @author <a href="mailto:richard.opalka at jboss.org">Richard Opalka</a>
+ */
+ at WebService
+(
+   name="EJB3",
+   serviceName = "EJB3Service", 
+   targetNamespace = "http://jbossws.org/injection", 
+   endpointInterface="org.jboss.test.ws.jaxws.ejb3Integration.injection.webservice.EndpointIface"
+)
+ at HandlerChain(file = "jaxws-handler.xml")
+ at Stateless
+ at WebContext
+(
+   urlPattern = "/EJB3Service",
+   contextRoot = "/jaxws-injection-ejb3"
+)
+public class EJB3Bean extends AbstractEndpointImpl
+{
+
+   public String echo(String msg)
+   {
+      return super.echo(msg) + ":EJB3Bean";
+   }
+
+}

Added: branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/webservice/EndpointIface.java
===================================================================
--- branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/webservice/EndpointIface.java	                        (rev 0)
+++ branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/webservice/EndpointIface.java	2009-05-06 13:38:00 UTC (rev 88263)
@@ -0,0 +1,39 @@
+/*
+ * 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.ejb3Integration.injection.webservice;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+/**
+ * An endpoint interface.
+ *
+ * @author <a href="mailto:richard.opalka at jboss.org">Richard Opalka</a>
+ */
+ at WebService
+ at SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface EndpointIface
+{
+   @WebMethod
+   String echo(String s);
+}

Added: branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/webservice/POJOBean.java
===================================================================
--- branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/webservice/POJOBean.java	                        (rev 0)
+++ branches/Branch_5_x/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/injection/webservice/POJOBean.java	2009-05-06 13:38:00 UTC (rev 88263)
@@ -0,0 +1,48 @@
+/*
+ * 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.ejb3Integration.injection.webservice;
+
+import javax.jws.HandlerChain;
+import javax.jws.WebService;
+
+/**
+ * POJO bean published as WebService injecting other EJB3 bean.
+ *
+ * @author <a href="mailto:richard.opalka at jboss.org">Richard Opalka</a>
+ */
+ at WebService
+(
+   name="POJO",
+   serviceName = "POJOService", 
+   targetNamespace = "http://jbossws.org/injection", 
+   endpointInterface="org.jboss.test.ws.jaxws.ejb3Integration.injection.webservice.EndpointIface"
+)
+ at HandlerChain(file = "jaxws-handler.xml")
+public class POJOBean extends AbstractEndpointImpl
+{
+
+   public String echo(String msg)
+   {
+      return super.echo(msg) + ":POJOBean";
+   }
+
+}

Added: branches/Branch_5_x/testsuite/src/resources/ws/jaxws/ejb3Integration/injection/META-INF/application.xml
===================================================================
--- branches/Branch_5_x/testsuite/src/resources/ws/jaxws/ejb3Integration/injection/META-INF/application.xml	                        (rev 0)
+++ branches/Branch_5_x/testsuite/src/resources/ws/jaxws/ejb3Integration/injection/META-INF/application.xml	2009-05-06 13:38:00 UTC (rev 88263)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<application
+  version="1.4"
+  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/application_1_4.xsd">
+
+  <display-name>test</display-name>
+
+  <module>
+    <ejb>jaxws-injection.jar</ejb>
+  </module>
+
+  <module>
+    <ejb>jaxws-injection-ejb3.jar</ejb>
+  </module>
+
+  <module>
+    <web>
+      <web-uri>jaxws-injection-pojo.war</web-uri>
+      <context-root>/jaxws-injection-pojo</context-root>
+    </web>
+  </module>
+
+</application>

Added: branches/Branch_5_x/testsuite/src/resources/ws/jaxws/ejb3Integration/injection/META-INF/ejb-jar.xml
===================================================================
--- branches/Branch_5_x/testsuite/src/resources/ws/jaxws/ejb3Integration/injection/META-INF/ejb-jar.xml	                        (rev 0)
+++ branches/Branch_5_x/testsuite/src/resources/ws/jaxws/ejb3Integration/injection/META-INF/ejb-jar.xml	2009-05-06 13:38:00 UTC (rev 88263)
@@ -0,0 +1,22 @@
+<?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>EJB3Bean</ejb-name>
+      <ejb-class>org.jboss.test.ws.jaxws.ejb3Integration.injection.webservice.EJB3Bean</ejb-class>
+
+      <env-entry>
+        <env-entry-name>boolean1</env-entry-name>
+        <env-entry-type>java.lang.Boolean</env-entry-type>
+        <env-entry-value>true</env-entry-value>
+      </env-entry>
+
+    </session>
+
+  </enterprise-beans>
+
+</ejb-jar>

Added: branches/Branch_5_x/testsuite/src/resources/ws/jaxws/ejb3Integration/injection/WEB-INF/web.xml
===================================================================
--- branches/Branch_5_x/testsuite/src/resources/ws/jaxws/ejb3Integration/injection/WEB-INF/web.xml	                        (rev 0)
+++ branches/Branch_5_x/testsuite/src/resources/ws/jaxws/ejb3Integration/injection/WEB-INF/web.xml	2009-05-06 13:38:00 UTC (rev 88263)
@@ -0,0 +1,24 @@
+<?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/javaee/web-app_2_5.xsd">
+
+  <servlet>
+    <servlet-name>POJOService</servlet-name>
+    <servlet-class>org.jboss.test.ws.jaxws.ejb3Integration.injection.webservice.POJOBean</servlet-class>
+  </servlet>
+
+  <servlet-mapping>
+    <servlet-name>POJOService</servlet-name>
+    <url-pattern>/POJOService</url-pattern>
+  </servlet-mapping>
+
+  <env-entry>
+     <env-entry-name>boolean1</env-entry-name>
+     <env-entry-type>java.lang.Boolean</env-entry-type>
+     <env-entry-value>true</env-entry-value>
+  </env-entry>
+
+</web-app>

Added: branches/Branch_5_x/testsuite/src/resources/ws/jaxws/ejb3Integration/injection/org/jboss/test/ws/jaxws/ejb3Integration/injection/webservice/jaxws-handler.xml
===================================================================
--- branches/Branch_5_x/testsuite/src/resources/ws/jaxws/ejb3Integration/injection/org/jboss/test/ws/jaxws/ejb3Integration/injection/webservice/jaxws-handler.xml	                        (rev 0)
+++ branches/Branch_5_x/testsuite/src/resources/ws/jaxws/ejb3Integration/injection/org/jboss/test/ws/jaxws/ejb3Integration/injection/webservice/jaxws-handler.xml	2009-05-06 13:38:00 UTC (rev 88263)
@@ -0,0 +1,15 @@
+<?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>TestHandler</handler-name>
+      <handler-class>org.jboss.test.ws.jaxws.ejb3Integration.injection.shared.handlers.TestHandler</handler-class>
+    </handler>
+  </handler-chain>
+
+</handler-chains>
\ No newline at end of file




More information about the jboss-cvs-commits mailing list