Author: ropalka
Date: 2012-02-02 15:58:37 -0500 (Thu, 02 Feb 2012)
New Revision: 15581
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as3581/
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as3581/AS3581TestCase.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as3581/EndpointIface.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as3581/EndpointIface2.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as3581/EndpointImpl.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as3581/EndpointImpl2.java
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/as3581/
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/as3581/WEB-INF/
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/as3581/WEB-INF/web.xml
Modified:
shared-testsuite/trunk/testsuite/src/test/ant-import/build-jars-jaxws.xml
Log:
[AS7-3581] providing test case to reproduce the issue
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 2012-02-02
20:08:36 UTC (rev 15580)
+++ shared-testsuite/trunk/testsuite/src/test/ant-import/build-jars-jaxws.xml 2012-02-02
20:58:37 UTC (rev 15581)
@@ -1122,6 +1122,16 @@
</classes>
</war>
+ <!-- jaxws-as3581 -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-as3581.war"
webxml="${tests.output.dir}/test-resources/jaxws/as3581/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include
name="org/jboss/test/ws/jaxws/as3581/EndpointImpl.class"/>
+ <include
name="org/jboss/test/ws/jaxws/as3581/EndpointIface.class"/>
+ <include
name="org/jboss/test/ws/jaxws/as3581/EndpointImpl2.class"/>
+ <include
name="org/jboss/test/ws/jaxws/as3581/EndpointIface2.class"/>
+ </classes>
+ </war>
+
<!-- jaxws-jbws3367 -->
<war
warfile="${tests.output.dir}/test-libs/jaxws-jbws3367-usecase1.war"
webxml="${tests.output.dir}/test-resources/jaxws/jbws3367/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/test-classes">
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as3581/AS3581TestCase.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as3581/AS3581TestCase.java
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as3581/AS3581TestCase.java 2012-02-02
20:58:37 UTC (rev 15581)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., 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.as3581;
+
+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;
+
+/**
+ * [AS7-3581] Tests manual JNDI lookup in @Oneway annotated method.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public class AS3581TestCase extends JBossWSTest
+{
+
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(AS3581TestCase.class, "jaxws-as3581.war");
+ }
+
+ public void testEndpoint() throws Exception
+ {
+ // test one-way scenario
+ final QName serviceName = new QName("org.jboss.test.ws.jaxws.as3581",
"SimpleService");
+ final URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxws-as3581/SimpleService?wsdl");
+ final Service service = Service.create(wsdlURL, serviceName);
+ final EndpointIface port = service.getPort(EndpointIface.class);
+ port.doit();
+ // test req-resp scenario
+ final QName serviceName2 = new QName("org.jboss.test.ws.jaxws.as3581",
"SimpleService2");
+ final URL wsdlURL2 = new URL("http://" + getServerHost() +
":8080/jaxws-as3581/SimpleService2?wsdl");
+ final Service service2 = Service.create(wsdlURL2, serviceName2);
+ final EndpointIface2 port2 = service2.getPort(EndpointIface2.class);
+ final String oneWayLookupString = port2.getString();
+ assertEquals("Ahoj", oneWayLookupString);
+ }
+
+}
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as3581/EndpointIface.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as3581/EndpointIface.java
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as3581/EndpointIface.java 2012-02-02
20:58:37 UTC (rev 15581)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., 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.as3581;
+
+import javax.jws.Oneway;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+/**
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+@WebService
+@SOAPBinding
+public interface EndpointIface
+{
+
+ @Oneway
+ void doit();
+
+}
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as3581/EndpointIface2.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as3581/EndpointIface2.java
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as3581/EndpointIface2.java 2012-02-02
20:58:37 UTC (rev 15581)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., 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.as3581;
+
+import javax.jws.Oneway;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+/**
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+@WebService
+@SOAPBinding
+public interface EndpointIface2
+{
+
+ String getString();
+
+}
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as3581/EndpointImpl.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as3581/EndpointImpl.java
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as3581/EndpointImpl.java 2012-02-02
20:58:37 UTC (rev 15581)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., 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.as3581;
+
+import javax.jws.Oneway;
+import javax.jws.WebService;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+/**
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+@WebService(
+ endpointInterface = "org.jboss.test.ws.jaxws.as3581.EndpointIface",
+ targetNamespace = "org.jboss.test.ws.jaxws.as3581",
+ serviceName = "SimpleService"
+)
+public class EndpointImpl
+{
+
+ static String value;
+ static RuntimeException ex;
+
+ @Oneway
+ public void doit()
+ {
+ try
+ {
+ value = (String)(new
InitialContext().lookup("java:comp/env/message"));
+ if (!"Ahoj".equals(value))
+ {
+ ex = new RuntimeException("JNDI lookup in @Oneway method
failed");
+ }
+ }
+ catch (final NamingException e)
+ {
+ ex = new RuntimeException("JNDI lookup in @Oneway method failed",
e);
+ }
+ }
+
+}
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as3581/EndpointImpl2.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as3581/EndpointImpl2.java
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as3581/EndpointImpl2.java 2012-02-02
20:58:37 UTC (rev 15581)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., 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.as3581;
+
+import javax.jws.Oneway;
+import javax.jws.WebService;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+/**
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+@WebService(
+ endpointInterface = "org.jboss.test.ws.jaxws.as3581.EndpointIface2",
+ targetNamespace = "org.jboss.test.ws.jaxws.as3581",
+ serviceName = "SimpleService2"
+)
+public class EndpointImpl2
+{
+
+ public String getString()
+ {
+ if (EndpointImpl.ex != null) throw EndpointImpl.ex;
+ return EndpointImpl.value;
+ }
+
+}
Added: shared-testsuite/trunk/testsuite/src/test/resources/jaxws/as3581/WEB-INF/web.xml
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/resources/jaxws/as3581/WEB-INF/web.xml
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/as3581/WEB-INF/web.xml 2012-02-02
20:58:37 UTC (rev 15581)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app 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/web-app_3_0.xsd"
+ metadata-complete="false">
+ <servlet>
+ <servlet-name>TestService</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.as3581.EndpointImpl</servlet-class>
+ </servlet>
+ <servlet>
+ <servlet-name>TestService2</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.as3581.EndpointImpl2</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>TestService</servlet-name>
+ <url-pattern>/SimpleService</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>TestService2</servlet-name>
+ <url-pattern>/SimpleService2</url-pattern>
+ </servlet-mapping>
+ <env-entry>
+ <env-entry-name>message</env-entry-name>
+ <env-entry-type>java.lang.String</env-entry-type>
+ <env-entry-value>Ahoj</env-entry-value>
+ </env-entry>
+</web-app>
\ No newline at end of file