Author: asoldano
Date: 2014-03-07 08:38:28 -0500 (Fri, 07 Mar 2014)
New Revision: 18478
Added:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3736/
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3736/Endpoint.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3736/EndpointImpl.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3736/JBWS3736TestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3736/
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3736/META-INF/
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3736/META-INF/wsdl/
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3736/META-INF/wsdl/test.wsdl
Log:
[JBWS-3736] Adding testcase
Added:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3736/Endpoint.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3736/Endpoint.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3736/Endpoint.java 2014-03-07
13:38:28 UTC (rev 18478)
@@ -0,0 +1,37 @@
+/*
+ * 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.jbws3736;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
+@WebService
+(
+ name = "Endpoint",
+ targetNamespace = "http://org.jboss.ws/jbws3736",
+ wsdlLocation = "META-INF/wsdl/test.wsdl"
+)
+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/jbws3736/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/jbws3736/EndpointImpl.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3736/EndpointImpl.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3736/EndpointImpl.java 2014-03-07
13:38:28 UTC (rev 18478)
@@ -0,0 +1,47 @@
+/*
+ * 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.jbws3736;
+
+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-jbws3736", urlPattern="/*")
+@WebService(
+ endpointInterface = "org.jboss.test.ws.jaxws.jbws3736.Endpoint",
+ portName = "EndpointPort",
+ serviceName = "EndpointService",
+ targetNamespace = "http://org.jboss.ws/jbws3736"
+)
+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/jbws3736/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/jbws3736/JBWS3736TestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3736/JBWS3736TestCase.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3736/JBWS3736TestCase.java 2014-03-07
13:38:28 UTC (rev 18478)
@@ -0,0 +1,69 @@
+/*
+ * 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.jbws3736;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+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;
+
+/**
+ * [JBWS-3736] soap:address rewrite does not consider wsdlLocation in SEI @WebService
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 07-Mar-2014
+ */
+public class JBWS3736TestCase extends JBossWSTest
+{
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8080/jaxws-jbws3736";
+
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(JBWS3736TestCase.class,
"jaxws-jbws3736.jar");
+ }
+
+ public void testEndpoint() throws Exception
+ {
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ QName serviceName = new QName("http://org.jboss.ws/jbws3736",
"EndpointService");
+ Endpoint port = Service.create(wsdlURL, serviceName).getPort(Endpoint.class);
+
((BindingProvider)port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
TARGET_ENDPOINT_ADDRESS);
+ String retObj = port.echo("Hello");
+ assertEquals("Hello", retObj);
+ }
+
+ public void testAddressRewrite() throws Exception
+ {
+ String wsdl = IOUtils.readAndCloseStream(new URL(TARGET_ENDPOINT_ADDRESS +
"?wsdl").openStream());
+ //we expect the published wsdl to have the https protocol in the soap:address
because the original wsdl provided
+ //in the deployment has that. This shows that the reference to the wsdl in endpoint
interface has been processed
+ //when rewriting the soap:address. If we got http protocol here, the fix won't
be in place.
+ assertTrue(wsdl.contains("https://" + getServerHost() +
":8080/jaxws-jbws3736"));
+ }
+}
Property changes on:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3736/JBWS3736TestCase.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3736/META-INF/wsdl/test.wsdl
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3736/META-INF/wsdl/test.wsdl
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3736/META-INF/wsdl/test.wsdl 2014-03-07
13:38:28 UTC (rev 18478)
@@ -0,0 +1,53 @@
+<definitions name='EndpointService'
targetNamespace='http://org.jboss.ws/jbws3736'
+
xmlns='http://schemas.xmlsoap.org/wsdl/'
+
xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'
+
xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
+ xmlns:tns='http://org.jboss.ws/jbws3736'
+
xmlns:xsd='http://www.w3.org/2001/XMLSchema'
+
xmlns:foo='http://foo.org/foo'>
+ <types>
+ <xs:schema targetNamespace='http://org.jboss.ws/jbws3736'
version='1.0' xmlns:tns='http://org.jboss.ws/jbws3736'
xmlns:xs='http://www.w3.org/2001/XMLSchema'>
+ <xs:element name='echo' type='tns:echo'/>
+ <xs:element name='echoResponse' type='tns:echoResponse'/>
+ <xs:complexType name='echo'>
+ <xs:sequence>
+ <xs:element minOccurs='0' name='arg0'
type='xs:string'/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name='echoResponse'>
+ <xs:sequence>
+ <xs:element minOccurs='0' name='return'
type='xs:string'/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:schema>
+ </types>
+ <message name='Endpoint_echo'>
+ <part element='tns:echo' name='echo'></part>
+ </message>
+ <message name='Endpoint_echoResponse'>
+ <part element='tns:echoResponse'
name='echoResponse'></part>
+ </message>
+ <portType name='Endpoint'>
+ <operation name='echo' parameterOrder='echo'>
+ <input message='tns:Endpoint_echo'></input>
+ <output message='tns:Endpoint_echoResponse'></output>
+ </operation>
+ </portType>
+ <binding name='EndpointBinding' type='tns:Endpoint'>
+ <soap:binding style='document'
transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='echo'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='EndpointService'>
+ <port binding='tns:EndpointBinding' name='EndpointPort'>
+ <soap:address location='https://${jboss.bind.address}/jaxws-jbws3736'/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Property changes on:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3736/META-INF/wsdl/test.wsdl
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native