Author: asoldano
Date: 2014-03-07 05:42:28 -0500 (Fri, 07 Mar 2014)
New Revision: 18474
Added:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/misc/
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/misc/Endpoint.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/misc/EndpointImpl.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/misc/MiscTestCase.java
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/ant-import/build-jars-jaxws.xml
Log:
Adding testcases for [JBWS-3741] and [JBWS-3743]
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/ant-import/build-jars-jaxws.xml
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/ant-import/build-jars-jaxws.xml 2014-03-07
10:33:16 UTC (rev 18473)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/ant-import/build-jars-jaxws.xml 2014-03-07
10:42:28 UTC (rev 18474)
@@ -1433,6 +1433,14 @@
</zipfileset>
</war>
+ <!-- jaxws-misc -->
+ <jar jarfile="${tests.output.dir}/test-libs/jaxws-misc.jar">
+ <fileset dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/misc/*.class" />
+ <exclude name="org/jboss/test/ws/jaxws/misc/*TestCase.class" />
+ </fileset>
+ </jar>
+
<!-- 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:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/misc/Endpoint.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/misc/Endpoint.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/misc/Endpoint.java 2014-03-07
10:42:28 UTC (rev 18474)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.misc;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
+@WebService(name = "Endpoint", targetNamespace =
"http://org.jboss.ws/misc")
+public interface Endpoint
+{
+ String echo(String input);
+}
Property changes on:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/misc/Endpoint.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/misc/EndpointImpl.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/misc/EndpointImpl.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/misc/EndpointImpl.java 2014-03-07
10:42:28 UTC (rev 18474)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.misc;
+
+import javax.ejb.Stateless;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+import org.jboss.ws.api.annotation.WebContext;
+
+@Stateless
+@SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
+@WebContext(contextRoot="jaxws-misc", urlPattern="/endpoint")
+@WebService
+(
+ name = "Endpoint",
+ portName = "EndpointPort",
+ serviceName = "EndpointService",
+ targetNamespace = "http://org.jboss.ws/misc"
+)
+public class EndpointImpl implements Endpoint
+{
+ @WebMethod
+ public String echo(String input)
+ {
+ return input;
+ }
+}
Property changes on:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/misc/EndpointImpl.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/misc/MiscTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/misc/MiscTestCase.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/misc/MiscTestCase.java 2014-03-07
10:42:28 UTC (rev 18474)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.misc;
+
+import java.net.HttpURLConnection;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.ws.common.IOUtils;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * Misc tests that require a simple ws endpoint deployment
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 07-Mar-2014
+ */
+public class MiscTestCase extends JBossWSTest
+{
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8080/jaxws-misc/endpoint";
+
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(MiscTestCase.class, "jaxws-misc.jar");
+ }
+
+ public void testEndpoint() throws Exception
+ {
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ QName serviceName = new QName("http://org.jboss.ws/misc",
"EndpointService");
+ Endpoint port = Service.create(wsdlURL, serviceName).getPort(Endpoint.class);
+ String retObj = port.echo("Hello");
+ assertEquals("Hello", retObj);
+ }
+
+ /**
+ * [JBWS-3741] WebService doesn't support "//"
+ *
+ */
+ public void testJBWS3741() throws Exception
+ {
+ assertTrue(IOUtils.readAndCloseStream(new URL("http://" + getServerHost()
+
":8080//jaxws-misc/endpoint?wsdl").openStream()).contains("wsdl:definitions"));
+ assertTrue(IOUtils.readAndCloseStream(new URL("http://" + getServerHost()
+
":8080/jaxws-misc///endpoint?wsdl").openStream()).contains("wsdl:definitions"));
+ }
+
+ /**
+ * [JBWS-3743] Block HTTP GET requests with no query string
+ *
+ */
+ public void testJBWS3743() throws Exception
+ {
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS);
+ final HttpURLConnection c = (HttpURLConnection)wsdlURL.openConnection();
+ c.connect();
+ assertEquals(405, c.getResponseCode());
+ String error = IOUtils.readAndCloseStream(c.getErrorStream());
+ c.disconnect();
+ assertEquals("HTTP GET not supported", error);
+ }
+}
Property changes on:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/misc/MiscTestCase.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native