Author: richard.opalka(a)jboss.com
Date: 2011-07-28 06:18:19 -0400 (Thu, 28 Jul 2011)
New Revision: 14765
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/enventry/
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryBeanJSE.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryEndpoint.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryJSETestCase.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryServlet.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryServletTestCase.java
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/enventry/
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/enventry/WEB-INF/
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/enventry/WEB-INF/jse-web.xml
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/enventry/WEB-INF/servlet-web.xml
Modified:
shared-testsuite/trunk/testsuite/src/test/ant-import/build-jars-jaxws.xml
Log:
refactoring injection test to shared test suite
Modified: shared-testsuite/trunk/testsuite/src/test/ant-import/build-jars-jaxws.xml
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/ant-import/build-jars-jaxws.xml 2011-07-28
10:17:40 UTC (rev 14764)
+++ shared-testsuite/trunk/testsuite/src/test/ant-import/build-jars-jaxws.xml 2011-07-28
10:18:19 UTC (rev 14765)
@@ -114,6 +114,19 @@
</fileset>
</jar>
+ <!-- jaxws-enventry -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-enventry-jse.war"
webxml="${tests.output.dir}/test-resources/jaxws/enventry/WEB-INF/jse-web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/enventry/EnvEntryBeanJSE.class"
/>
+ <include name="org/jboss/test/ws/jaxws/enventry/EnvEntryHandler.class"
/>
+ </classes>
+ </war>
+ <war warfile="${tests.output.dir}/test-libs/jaxws-enventry-servlet.war"
webxml="${tests.output.dir}/test-resources/jaxws/enventry/WEB-INF/servlet-web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/enventry/EnvEntryServlet.class"
/>
+ </classes>
+ </war>
+
<!-- jaxws-handlerscope -->
<war warfile="${tests.output.dir}/test-libs/jaxws-handlerscope.war"
webxml="${tests.output.dir}/test-resources/jaxws/handlerscope/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/test-classes">
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryBeanJSE.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryBeanJSE.java
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryBeanJSE.java 2011-07-28
10:18:19 UTC (rev 14765)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.enventry;
+
+import javax.annotation.Resource;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+import org.jboss.logging.Logger;
+
+@WebService(serviceName = "EnvEntryService", targetNamespace =
"http://org.jboss.ws/enventry")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public class EnvEntryBeanJSE
+{
+ // Provide logging
+ private static Logger log = Logger.getLogger(EnvEntryBeanJSE.class);
+
+ // XML driven injection
+ public String strValue;
+
+ @Resource( name="jaxws/entry2" )
+ public Integer intValue;
+
+ @WebMethod
+ public String helloEnvEntry(String msg)
+ {
+ log.info("helloEnvEntry: " + msg);
+ return msg + ":endpoint:" + strValue + ":" + intValue;
+ }
+}
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryEndpoint.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryEndpoint.java
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryEndpoint.java 2011-07-28
10:18:19 UTC (rev 14765)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.enventry;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+
+@WebService(serviceName="EnvEntryService", targetNamespace =
"http://org.jboss.ws/enventry")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface EnvEntryEndpoint
+{
+ @WebMethod
+ String helloEnvEntry(String msg);
+
+}
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryJSETestCase.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryJSETestCase.java
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryJSETestCase.java 2011-07-28
10:18:19 UTC (rev 14765)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.enventry;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * Test env entry access
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 29-May-2008
+ */
+public class EnvEntryJSETestCase extends JBossWSTest
+{
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(EnvEntryJSETestCase.class,
"jaxws-enventry-jse.war");
+ }
+
+ public void testEndpoint() throws Exception
+ {
+ URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxws-enventry-jse?wsdl");
+ QName serviceName = new QName("http://org.jboss.ws/enventry",
"EnvEntryService");
+ Service service = Service.create(wsdlURL, serviceName);
+
+ EnvEntryEndpoint port = service.getPort(EnvEntryEndpoint.class);
+ String res = port.helloEnvEntry("InitalMessage");
+ assertEquals("InitalMessage:endpoint:web:8", res);
+ }
+}
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryServlet.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryServlet.java
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryServlet.java 2011-07-28
10:18:19 UTC (rev 14765)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.enventry;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.annotation.Resource;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+public class EnvEntryServlet extends HttpServlet
+{
+ @Resource(name = "jaxws/entry1")
+ String strValue;
+
+ @Resource(name = "jaxws/entry2")
+ Integer intValue;
+
+ protected void doGet(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException
+ {
+ PrintWriter pw = new PrintWriter(res.getWriter());
+ pw.print(strValue + ":" + intValue);
+ pw.close();
+ }
+}
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryServletTestCase.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryServletTestCase.java
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryServletTestCase.java 2011-07-28
10:18:19 UTC (rev 14765)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.enventry;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * Test env entry access
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 29-May-2008
+ */
+public class EnvEntryServletTestCase extends JBossWSTest
+{
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(EnvEntryServletTestCase.class,
"jaxws-enventry-servlet.war");
+ }
+
+ public void testEndpoint() throws Exception
+ {
+ URL url = new URL("http://" + getServerHost() +
":8080/jaxws-enventry-servlet");
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ String line = br.readLine();
+
+ assertEquals("web:8", line);
+ }
+}
Added:
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/enventry/WEB-INF/jse-web.xml
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/enventry/WEB-INF/jse-web.xml
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/enventry/WEB-INF/jse-web.xml 2011-07-28
10:18:19 UTC (rev 14765)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app
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"
+ version="2.5">
+
+ <servlet>
+ <servlet-name>TestService</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.enventry.EnvEntryBeanJSE</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>TestService</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+ <env-entry>
+ <env-entry-name>jaxws/entry1</env-entry-name>
+ <env-entry-type>java.lang.String</env-entry-type>
+ <env-entry-value>web</env-entry-value>
+ <injection-target>
+
<injection-target-class>org.jboss.test.ws.jaxws.enventry.EnvEntryBeanJSE</injection-target-class>
+ <injection-target-name>strValue</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>jaxws/entry2</env-entry-name>
+ <env-entry-type>java.lang.Integer</env-entry-type>
+ <env-entry-value>8</env-entry-value>
+ </env-entry>
+
+</web-app>
Added:
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/enventry/WEB-INF/servlet-web.xml
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/enventry/WEB-INF/servlet-web.xml
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/enventry/WEB-INF/servlet-web.xml 2011-07-28
10:18:19 UTC (rev 14765)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app
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"
+ version="2.5">
+
+ <servlet>
+ <servlet-name>TestServlet</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.enventry.EnvEntryServlet</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>TestServlet</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+ <env-entry>
+ <env-entry-name>jaxws/entry1</env-entry-name>
+ <env-entry-type>java.lang.String</env-entry-type>
+ <env-entry-value>web</env-entry-value>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>jaxws/entry2</env-entry-name>
+ <env-entry-type>java.lang.Integer</env-entry-type>
+ <env-entry-value>8</env-entry-value>
+ </env-entry>
+
+</web-app>