Author: alessio.soldano(a)jboss.com
Date: 2009-01-15 11:15:20 -0500 (Thu, 15 Jan 2009)
New Revision: 9050
Added:
framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2449/
framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2449/Endpoint.java
framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2449/EndpointImpl.java
framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2449/JBWS2449TestCase.java
framework/branches/jaxws21/testsuite/test/resources/jaxws/jbws2449/
framework/branches/jaxws21/testsuite/test/resources/jaxws/jbws2449/META-INF/
framework/branches/jaxws21/testsuite/test/resources/jaxws/jbws2449/META-INF/wsdl/
framework/branches/jaxws21/testsuite/test/resources/jaxws/jbws2449/META-INF/wsdl/test.wsdl
Modified:
framework/branches/jaxws21/testsuite/test/ant-import/build-jars-jaxws.xml
Log:
[JBWS-2449] Adding testcase for RespectBindingFeature
Modified: framework/branches/jaxws21/testsuite/test/ant-import/build-jars-jaxws.xml
===================================================================
--- framework/branches/jaxws21/testsuite/test/ant-import/build-jars-jaxws.xml 2009-01-15
15:11:11 UTC (rev 9049)
+++ framework/branches/jaxws21/testsuite/test/ant-import/build-jars-jaxws.xml 2009-01-15
16:15:20 UTC (rev 9050)
@@ -576,6 +576,17 @@
</webinf>
</war>
+ <!-- jaxws-jbws2449 -->
+ <jar jarfile="${tests.output.dir}/test-libs/jaxws-jbws2449.jar">
+ <fileset dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/jbws2449/*.class"/>
+ <exclude
name="org/jboss/test/ws/jaxws/jbws2449/*TestCase.class"/>
+ </fileset>
+ <metainf
dir="${tests.output.dir}/test-resources/jaxws/jbws2449/META-INF">
+ <include name="wsdl/*"/>
+ </metainf>
+ </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:
framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2449/Endpoint.java
===================================================================
---
framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2449/Endpoint.java
(rev 0)
+++
framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2449/Endpoint.java 2009-01-15
16:15:20 UTC (rev 9050)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.jbws2449;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
+@WebService(name = "Endpoint", targetNamespace =
"http://org.jboss.ws/jbws2449")
+public interface Endpoint
+{
+ String echo(String input);
+}
Property changes on:
framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2449/Endpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2449/EndpointImpl.java
===================================================================
---
framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2449/EndpointImpl.java
(rev 0)
+++
framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2449/EndpointImpl.java 2009-01-15
16:15:20 UTC (rev 9050)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.jbws2449;
+
+import javax.ejb.Stateless;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+import org.jboss.wsf.spi.annotation.WebContext;
+
+@Stateless
+@SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
+@WebContext(contextRoot="jaxws-jbws2449", urlPattern="/*")
+@WebService
+(
+ name = "Endpoint",
+ portName = "EndpointPort",
+ serviceName = "EndpointService",
+ targetNamespace = "http://org.jboss.ws/jbws2449",
+ wsdlLocation = "META-INF/wsdl/test.wsdl"
+)
+public class EndpointImpl implements Endpoint
+{
+ @WebMethod
+ public String echo(String input)
+ {
+ return input;
+ }
+}
Property changes on:
framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2449/EndpointImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2449/JBWS2449TestCase.java
===================================================================
---
framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2449/JBWS2449TestCase.java
(rev 0)
+++
framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2449/JBWS2449TestCase.java 2009-01-15
16:15:20 UTC (rev 9050)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.jbws2449;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.RespectBindingFeature;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * [JBWS-2449] Test RespectBindingFeature
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 15-Jan-2009
+ */
+public class JBWS2449TestCase extends JBossWSTest
+{
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8080/jaxws-jbws2449";
+
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(JBWS2449TestCase.class,
"jaxws-jbws2449.jar");
+ }
+
+ public void test() throws Exception
+ {
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ QName serviceName = new QName("http://org.jboss.ws/jbws2449",
"EndpointService");
+ Endpoint port = Service.create(wsdlURL, serviceName).getPort(Endpoint.class);
+ String retObj = port.echo("Hello");
+ assertEquals("Hello", retObj);
+ }
+
+ public void testWithRespectBinding() throws Exception
+ {
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ QName serviceName = new QName("http://org.jboss.ws/jbws2449",
"EndpointService");
+ try
+ {
+ Service.create(wsdlURL, serviceName).getPort(Endpoint.class, new
RespectBindingFeature(true));
+ fail("Exception expected, the wsdl has an understood required extensibility
element!");
+ }
+ catch (Exception e)
+ {
+ //NOOP
+ }
+ }
+
+ public void testWithRespectBinding2() throws Exception
+ {
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ QName serviceName = new QName("http://org.jboss.ws/jbws2449",
"EndpointService");
+ Endpoint port = Service.create(wsdlURL, serviceName).getPort(Endpoint.class, new
RespectBindingFeature(false));
+ String retObj = port.echo("Hello");
+ assertEquals("Hello", retObj);
+ }
+}
Property changes on:
framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2449/JBWS2449TestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
framework/branches/jaxws21/testsuite/test/resources/jaxws/jbws2449/META-INF/wsdl/test.wsdl
===================================================================
---
framework/branches/jaxws21/testsuite/test/resources/jaxws/jbws2449/META-INF/wsdl/test.wsdl
(rev 0)
+++
framework/branches/jaxws21/testsuite/test/resources/jaxws/jbws2449/META-INF/wsdl/test.wsdl 2009-01-15
16:15:20 UTC (rev 9050)
@@ -0,0 +1,54 @@
+<definitions name='EndpointService'
targetNamespace='http://org.jboss.ws/jbws2449'
+
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/jbws2449'
+
xmlns:xsd='http://www.w3.org/2001/XMLSchema'
+
xmlns:foo='http://foo.org/foo'>
+ <types>
+ <xs:schema targetNamespace='http://org.jboss.ws/jbws2449'
version='1.0' xmlns:tns='http://org.jboss.ws/jbws2449'
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'/>
+ <foo:bar wsdl:required="true"/>
+ <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='http://127.0.0.1:8080/jaxws-jbws2449'/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Property changes on:
framework/branches/jaxws21/testsuite/test/resources/jaxws/jbws2449/META-INF/wsdl/test.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF