Author: richard.opalka(a)jboss.com
Date: 2009-04-30 06:17:18 -0400 (Thu, 30 Apr 2009)
New Revision: 9928
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2634/
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2634/JBWS2634TestCase.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2634/shared/
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2634/shared/BeanIface.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2634/shared/BeanImpl.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2634/webservice/
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2634/webservice/POJOBean.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2634/webservice/POJOIface.java
framework/trunk/testsuite/test/resources/jaxws/jbws2634/
framework/trunk/testsuite/test/resources/jaxws/jbws2634/META-INF/
framework/trunk/testsuite/test/resources/jaxws/jbws2634/META-INF/application.xml
framework/trunk/testsuite/test/resources/jaxws/jbws2634/WEB-INF/
framework/trunk/testsuite/test/resources/jaxws/jbws2634/WEB-INF/web.xml
Modified:
framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml
Log:
[JBWS-2634] providing initial test case
Modified: framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml
===================================================================
--- framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml 2009-04-30 10:14:43 UTC
(rev 9927)
+++ framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml 2009-04-30 10:17:18 UTC
(rev 9928)
@@ -729,6 +729,25 @@
</webinf>
</war>
+ <!-- jaxws-jbws2634 -->
+ <jar jarfile="${tests.output.dir}/test-libs/jaxws-jbws2634.jar">
+ <fileset dir="${tests.output.dir}/test-classes">
+ <include
name="org/jboss/test/ws/jaxws/jbws2634/shared/*.class"/>
+ </fileset>
+ </jar>
+ <war warfile="${tests.output.dir}/test-libs/jaxws-jbws2634.war"
+
webxml="${tests.output.dir}/test-resources/jaxws/jbws2634/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include
name="org/jboss/test/ws/jaxws/jbws2634/webservice/POJOBean.class"/>
+ <include
name="org/jboss/test/ws/jaxws/jbws2634/webservice/POJOIface.class"/>
+ </classes>
+ </war>
+ <ear
appxml="${tests.output.dir}/test-resources/jaxws/jbws2634/META-INF/application.xml"
+ earfile="${tests.output.dir}/test-libs/jaxws-jbws2634.ear">
+ <fileset file="${tests.output.dir}/test-libs/jaxws-jbws2634.jar"/>
+ <fileset file="${tests.output.dir}/test-libs/jaxws-jbws2634.war"/>
+ </ear>
+
<!-- jaxws namespace -->
<war warfile="${tests.output.dir}/test-libs/jaxws-namespace.war"
webxml="${tests.output.dir}/test-resources/jaxws/namespace/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/test-classes">
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2634/JBWS2634TestCase.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2634/JBWS2634TestCase.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2634/JBWS2634TestCase.java 2009-04-30
10:17:18 UTC (rev 9928)
@@ -0,0 +1,58 @@
+/*
+ * 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.jbws2634;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.test.ws.jaxws.jbws2634.webservice.POJOIface;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * [JBWS-2634] Implement support for @EJB annotations in WS components
+ *
+ * @author <a href="mailto:richard.opalka@jboss.org">Richard
Opalka</a>
+ */
+public final class JBWS2634TestCase extends JBossWSTest
+{
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(JBWS2634TestCase.class,
"jaxws-jbws2634.ear");
+ }
+
+ public void testInjection() throws Exception
+ {
+ QName serviceName = new
QName("http://jbossws.org/JBWS2634",
"EndpointService");
+ URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxws-jbws2634/Service?wsdl");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ POJOIface proxy = (POJOIface)service.getPort(POJOIface.class);
+ assertEquals(proxy.getMessage(), "Injected hello message");
+
+ System.out.println("[JBWS-2634] test javax.ejb.EJB annotation defaults as
well, see POJOBean");
+ }
+}
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2634/shared/BeanIface.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2634/shared/BeanIface.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2634/shared/BeanIface.java 2009-04-30
10:17:18 UTC (rev 9928)
@@ -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.jbws2634.shared;
+
+/**
+ * The EJB3 interface
+ *
+ * @author <a href="mailto:richard.opalka@jboss.org">Richard
Opalka</a>
+ */
+public interface BeanIface
+{
+ String printString();
+}
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2634/shared/BeanImpl.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2634/shared/BeanImpl.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2634/shared/BeanImpl.java 2009-04-30
10:17:18 UTC (rev 9928)
@@ -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.jbws2634.shared;
+
+import javax.ejb.Stateless;
+
+/**
+ * The EJB3 implementation
+ *
+ * @author <a href="mailto:richard.opalka@jboss.org">Richard
Opalka</a>
+ */
+@Stateless
+public class BeanImpl implements BeanIface
+{
+ public String printString()
+ {
+ return "Injected hello message";
+ }
+}
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2634/webservice/POJOBean.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2634/webservice/POJOBean.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2634/webservice/POJOBean.java 2009-04-30
10:17:18 UTC (rev 9928)
@@ -0,0 +1,52 @@
+/*
+ * 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.jbws2634.webservice;
+
+import javax.ejb.EJB;
+import javax.jws.WebService;
+
+import org.jboss.test.ws.jaxws.jbws2634.shared.BeanIface;
+
+/**
+ * POJO bean published as WebService injecting other EJB3 bean
+ *
+ * @author <a href="mailto:richard.opalka@jboss.org">Richard
Opalka</a>
+ */
+@WebService
+(
+ serviceName = "EndpointService",
+ targetNamespace = "http://jbossws.org/JBWS2634",
+ endpointInterface="org.jboss.test.ws.jaxws.jbws2634.webservice.POJOIface"
+)
+public class POJOBean implements POJOIface
+{
+
+ // TODO: this should work without name attribute as well
+ @EJB(name =
"jaxws-jbws2634/BeanImpl1/local-org.jboss.test.ws.jaxws.jbws2634.shared.BeanIface")
+ private BeanIface testBean;
+
+ public String getMessage()
+ {
+ return this.testBean.printString();
+ }
+
+}
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2634/webservice/POJOIface.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2634/webservice/POJOIface.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2634/webservice/POJOIface.java 2009-04-30
10:17:18 UTC (rev 9928)
@@ -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.jbws2634.webservice;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+/**
+ * A POJO endpoint interface
+ *
+ * @author <a href="mailto:richard.opalka@jboss.org">Richard
Opalka</a>
+ */
+@WebService
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface POJOIface
+{
+ @WebMethod
+ String getMessage();
+}
Added: framework/trunk/testsuite/test/resources/jaxws/jbws2634/META-INF/application.xml
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/jbws2634/META-INF/application.xml
(rev 0)
+++
framework/trunk/testsuite/test/resources/jaxws/jbws2634/META-INF/application.xml 2009-04-30
10:17:18 UTC (rev 9928)
@@ -0,0 +1,21 @@
+<?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-jbws2634.jar</ejb>
+ </module>
+
+ <module>
+ <web>
+ <web-uri>jaxws-jbws2634.war</web-uri>
+ <context-root>/jaxws-jbws2634</context-root>
+ </web>
+ </module>
+
+</application>
Added: framework/trunk/testsuite/test/resources/jaxws/jbws2634/WEB-INF/web.xml
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/jbws2634/WEB-INF/web.xml
(rev 0)
+++ framework/trunk/testsuite/test/resources/jaxws/jbws2634/WEB-INF/web.xml 2009-04-30
10:17:18 UTC (rev 9928)
@@ -0,0 +1,18 @@
+<?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>Service</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.jbws2634.webservice.POJOBean</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Service</servlet-name>
+ <url-pattern>/Service</url-pattern>
+ </servlet-mapping>
+
+</web-app>