Author: thomas.diesler(a)jboss.com
Date: 2008-06-02 10:21:26 -0400 (Mon, 02 Jun 2008)
New Revision: 7267
Added:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryServlet.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryServletTestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/enventry/WEB-INF/jse-web.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/enventry/WEB-INF/servlet-web.xml
Removed:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/enventry/WEB-INF/web.xml
Modified:
stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryJSETestCase.java
Log:
[JBWS-2074] Resource injection in jaxws endpoints and handlers
Modified: stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml 2008-06-02
14:01:12 UTC (rev 7266)
+++
stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml 2008-06-02
14:21:26 UTC (rev 7267)
@@ -61,14 +61,19 @@
</fileset>
</jar>
- <!-- jaxws-enventry.war -->
- <war warfile="${tests.output.dir}/test-libs/jaxws-enventry.war"
webxml="${tests.output.dir}/test-resources/jaxws/enventry/WEB-INF/web.xml">
+ <!-- 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/ServerSideHandler.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-epr -->
<jar destfile="${tests.output.dir}/test-libs/jaxws-epr.jar">
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryJSETestCase.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryJSETestCase.java 2008-06-02
14:01:12 UTC (rev 7266)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryJSETestCase.java 2008-06-02
14:21:26 UTC (rev 7267)
@@ -42,12 +42,12 @@
public static Test suite()
{
- return new JBossWSTestSetup(EnvEntryJSETestCase.class,
"jaxws-enventry.war");
+ return new JBossWSTestSetup(EnvEntryJSETestCase.class,
"jaxws-enventry-jse.war");
}
public void testEndpoint() throws Exception
{
- URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxws-enventry?wsdl");
+ 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);
Added:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryServlet.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryServlet.java
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryServlet.java 2008-06-02
14:21:26 UTC (rev 7267)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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();
+ }
+}
Property changes on:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryServlet.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryServletTestCase.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryServletTestCase.java
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryServletTestCase.java 2008-06-02
14:21:26 UTC (rev 7267)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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);
+ }
+}
Property changes on:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryServletTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/enventry/WEB-INF/jse-web.xml
(from rev 7263,
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/enventry/WEB-INF/web.xml)
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/enventry/WEB-INF/jse-web.xml
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/enventry/WEB-INF/jse-web.xml 2008-06-02
14:21:26 UTC (rev 7267)
@@ -0,0 +1,39 @@
+<?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>
+ <injection-target>
+
<injection-target-class>org.jboss.test.ws.jaxws.enventry.EnvEntryBeanJSE</injection-target-class>
+ <injection-target-name>intValue</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+</web-app>
+
Added:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/enventry/WEB-INF/servlet-web.xml
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/enventry/WEB-INF/servlet-web.xml
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/enventry/WEB-INF/servlet-web.xml 2008-06-02
14:21:26 UTC (rev 7267)
@@ -0,0 +1,31 @@
+<?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>
+
Property changes on:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/enventry/WEB-INF/servlet-web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/enventry/WEB-INF/web.xml
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/enventry/WEB-INF/web.xml 2008-06-02
14:01:12 UTC (rev 7266)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/enventry/WEB-INF/web.xml 2008-06-02
14:21:26 UTC (rev 7267)
@@ -1,39 +0,0 @@
-<?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>
- <injection-target>
-
<injection-target-class>org.jboss.test.ws.jaxws.enventry.EnvEntryBeanJSE</injection-target-class>
- <injection-target-name>intValue</injection-target-name>
- </injection-target>
- </env-entry>
-
-</web-app>
-