Author: ropalka
Date: 2011-12-13 06:42:56 -0500 (Tue, 13 Dec 2011)
New Revision: 15369
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as2961/
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as2961/AS2961TestCase.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as2961/EndpointIface.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as2961/EndpointImpl.java
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/as2961/
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/as2961/WEB-INF/
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/as2961/WEB-INF/web.xml
Modified:
shared-testsuite/trunk/testsuite/src/test/ant-import/build-jars-jaxws.xml
Log:
[AS7-2961] providing test case
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-12-13
10:33:06 UTC (rev 15368)
+++ shared-testsuite/trunk/testsuite/src/test/ant-import/build-jars-jaxws.xml 2011-12-13
11:42:56 UTC (rev 15369)
@@ -1150,6 +1150,14 @@
</classes>
</war>
+ <!-- jaxws-as2961 -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-as2961.war"
webxml="${tests.output.dir}/test-resources/jaxws/as2961/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include
name="org/jboss/test/ws/jaxws/as2961/EndpointImpl.class"/>
+ <include
name="org/jboss/test/ws/jaxws/as2961/EndpointIface.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/as2961/AS2961TestCase.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as2961/AS2961TestCase.java
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as2961/AS2961TestCase.java 2011-12-13
11:42:56 UTC (rev 15369)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.as2961;
+
+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-2961] Tests JNDI lookup in pojo endpoint constructor.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public class AS2961TestCase extends JBossWSTest
+{
+
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(AS2961TestCase.class, "jaxws-as2961.war");
+ }
+
+ public void testEndpoint() throws Exception
+ {
+ final QName serviceName = new QName("org.jboss.test.ws.jaxws.as2961",
"SimpleService");
+ final URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxws-as2961/SimpleService?wsdl");
+ final Service service = Service.create(wsdlURL, serviceName);
+ final EndpointIface port = service.getPort(EndpointIface.class);
+ final String result = port.echo("hello");
+ assertEquals("hello", result);
+ }
+
+}
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as2961/EndpointIface.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as2961/EndpointIface.java
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as2961/EndpointIface.java 2011-12-13
11:42:56 UTC (rev 15369)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.as2961;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+/**
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+@WebService
+@SOAPBinding
+public interface EndpointIface
+{
+
+ String echo(String s);
+
+}
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as2961/EndpointImpl.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as2961/EndpointImpl.java
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as2961/EndpointImpl.java 2011-12-13
11:42:56 UTC (rev 15369)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.as2961;
+
+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.as2961.EndpointIface",
+ targetNamespace = "org.jboss.test.ws.jaxws.as2961",
+ serviceName = "SimpleService"
+)
+public class EndpointImpl
+{
+
+ private String string1;
+
+ public EndpointImpl()
+ {
+ try
+ {
+ final InitialContext ctx = new InitialContext();
+ string1 =
(String)ctx.lookup("java:comp/env/org.jboss.test.ws.jaxws.as2961.EndpointImpl/string1");
+ }
+ catch (final NamingException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public String echo(final String s)
+ {
+ if (!"Ahoj 1".equals(string1)) throw new RuntimeException("JNDI
lookup in constructor failed");
+ return s;
+ }
+
+}
Added: shared-testsuite/trunk/testsuite/src/test/resources/jaxws/as2961/WEB-INF/web.xml
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/resources/jaxws/as2961/WEB-INF/web.xml
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/as2961/WEB-INF/web.xml 2011-12-13
11:42:56 UTC (rev 15369)
@@ -0,0 +1,20 @@
+<?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.as2961.EndpointImpl</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>TestService</servlet-name>
+ <url-pattern>/SimpleService</url-pattern>
+ </servlet-mapping>
+ <env-entry>
+
<env-entry-name>org.jboss.test.ws.jaxws.as2961.EndpointImpl/string1</env-entry-name>
+ <env-entry-type>java.lang.String</env-entry-type>
+ <env-entry-value>Ahoj 1</env-entry-value>
+ </env-entry>
+</web-app>
\ No newline at end of file