You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2009/07/21 19:09:48 UTC
svn commit: r796387 - in /cxf/trunk/rt/databinding/sdo: ./
src/test/java/org/apache/cxf/sdo/ src/test/resources/wsdl_sdo/
Author: dkulp
Date: Tue Jul 21 17:09:48 2009
New Revision: 796387
URL: http://svn.apache.org/viewvc?rev=796387&view=rev
Log:
Add a more complex test case (echoStruct)
Added:
cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/AbstractHelloWorldTest.java (with props)
cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/structure.xml (with props)
Modified:
cxf/trunk/rt/databinding/sdo/pom.xml
cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/HelloWorldDynamicTest.java
cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/HelloWorldStaticTest.java
cxf/trunk/rt/databinding/sdo/src/test/resources/wsdl_sdo/HelloService_dynamic.wsdl
cxf/trunk/rt/databinding/sdo/src/test/resources/wsdl_sdo/HelloService_static.wsdl
Modified: cxf/trunk/rt/databinding/sdo/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/sdo/pom.xml?rev=796387&r1=796386&r2=796387&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/sdo/pom.xml (original)
+++ cxf/trunk/rt/databinding/sdo/pom.xml Tue Jul 21 17:09:48 2009
@@ -32,6 +32,7 @@
<properties>
<pmd.eclipse.ruleset>cxf-pmd-ruleset-generated.xml</pmd.eclipse.ruleset>
+ <compile.flags>-Xlint:unchecked,fallthrough,finally</compile.flags>
</properties>
<dependencies>
@@ -203,7 +204,9 @@
<phase>process-test-sources</phase>
<configuration>
<tasks>
- <echo file="${basedir}/.settings/org.eclipse.jdt.core.prefs" append="true">org.eclipse.jdt.core.compiler.problem.unusedLocal=ignore
+ <echo file="${basedir}/.settings/org.eclipse.jdt.core.prefs" append="true">
+org.eclipse.jdt.core.compiler.problem.unusedLocal=ignore
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
</echo>
</tasks>
</configuration>
Added: cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/AbstractHelloWorldTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/AbstractHelloWorldTest.java?rev=796387&view=auto
==============================================================================
--- cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/AbstractHelloWorldTest.java (added)
+++ cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/AbstractHelloWorldTest.java Tue Jul 21 17:09:48 2009
@@ -0,0 +1,60 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.sdo;
+
+
+import org.w3c.dom.Node;
+
+import org.junit.Test;
+
+
+/**
+ *
+ */
+public abstract class AbstractHelloWorldTest extends AbstractSDOTest {
+
+
+ @Test
+ public void testBasicInvoke() throws Exception {
+ Node response = invoke("TestService", "bean11.xml");
+ addNamespace("ns1", "http://apache.org/hello_world_soap_http/types");
+ assertValid("/s:Envelope/s:Body/ns1:greetMeResponse", response);
+ assertValid("//ns1:greetMeResponse/ns1:responseType", response);
+ assertValid("//ns1:greetMeResponse/ns1:responseType[text()='Hello World']", response);
+ }
+
+ @Test
+ public void testStructure() throws Exception {
+ Node response = invoke("TestService", "structure.xml");
+ addNamespace("ns1", "http://apache.org/hello_world_soap_http/types");
+ assertValid("/s:Envelope/s:Body/ns1:echoStructResponse", response);
+ assertValid("//ns1:echoStructResponse/ns1:return", response);
+ assertValid("//ns1:echoStructResponse/ns1:return/ns1:text[text()='Hello']", response);
+ }
+
+ @Test
+ public void testWSDL() throws Exception {
+ Node doc = getWSDLDocument("TestService");
+ assertNotNull(doc);
+ assertValid("/wsdl:definitions/wsdl:types/xsd:schema"
+ + "[@targetNamespace='http://apache.org/hello_world_soap_http/types']",
+ doc);
+ }
+}
Propchange: cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/AbstractHelloWorldTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/AbstractHelloWorldTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/HelloWorldDynamicTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/HelloWorldDynamicTest.java?rev=796387&r1=796386&r2=796387&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/HelloWorldDynamicTest.java (original)
+++ cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/HelloWorldDynamicTest.java Tue Jul 21 17:09:48 2009
@@ -23,17 +23,18 @@
import javax.jws.WebService;
import javax.xml.namespace.QName;
-import org.w3c.dom.Node;
import org.apache.cxf.frontend.ServerFactoryBean;
import org.junit.Before;
-import org.junit.Test;
+
+import commonj.sdo.DataObject;
+
/**
*
*/
-public class HelloWorldDynamicTest extends AbstractSDOTest {
+public class HelloWorldDynamicTest extends AbstractHelloWorldTest {
@Before
@@ -47,7 +48,7 @@
name = "Greeter",
serviceName = "TestService",
endpointInterface = "helloworld.dynamic_types.ws.Greeter")
- public static class Server {
+ public static class Server implements helloworld.dynamic_types.ws.Greeter {
public java.lang.String sayHi() {
return "Hi!";
}
@@ -61,6 +62,10 @@
public java.lang.String greetMe(String s) {
return "Hello " + s;
}
+
+ public DataObject echoStruct(DataObject struct) {
+ return struct;
+ }
}
@@ -76,22 +81,5 @@
sf.setEndpointName(new QName("http://apache.org/hello_world_soap_http", "SoapPort"));
return sf;
}
-
- @Test
- public void testBasicInvoke() throws Exception {
- Node response = invoke("TestService", "bean11.xml");
- addNamespace("ns1", "http://apache.org/hello_world_soap_http/types");
- assertValid("/s:Envelope/s:Body/ns1:greetMeResponse", response);
- assertValid("//ns1:greetMeResponse/ns1:responseType", response);
- assertValid("//ns1:greetMeResponse/ns1:responseType[text()='Hello World']", response);
- }
-
- @Test
- public void testWSDL() throws Exception {
- Node doc = getWSDLDocument("TestService");
- assertNotNull(doc);
- assertValid("/wsdl:definitions/wsdl:types/xsd:schema"
- + "[@targetNamespace='http://apache.org/hello_world_soap_http/types']",
- doc);
- }
+
}
Modified: cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/HelloWorldStaticTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/HelloWorldStaticTest.java?rev=796387&r1=796386&r2=796387&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/HelloWorldStaticTest.java (original)
+++ cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/HelloWorldStaticTest.java Tue Jul 21 17:09:48 2009
@@ -20,20 +20,21 @@
package org.apache.cxf.sdo;
+
import javax.jws.WebService;
import javax.xml.namespace.QName;
-import org.w3c.dom.Node;
import org.apache.cxf.frontend.ServerFactoryBean;
import org.junit.Before;
-import org.junit.Test;
+
+import helloworld.static_types.sdo.Structure;
/**
*
*/
-public class HelloWorldStaticTest extends AbstractSDOTest {
+public class HelloWorldStaticTest extends AbstractHelloWorldTest {
@Before
@@ -47,7 +48,7 @@
name = "Greeter",
serviceName = "TestService",
endpointInterface = "helloworld.static_types.ws.Greeter")
- public static class Server {
+ public static class Server implements helloworld.static_types.ws.Greeter {
public java.lang.String sayHi() {
return "Hi!";
}
@@ -61,6 +62,10 @@
public java.lang.String greetMe(String s) {
return "Hello " + s;
}
+
+ public Structure echoStruct(Structure struct) {
+ return struct;
+ }
}
@@ -77,21 +82,4 @@
return sf;
}
- @Test
- public void testBasicInvoke() throws Exception {
- Node response = invoke("TestService", "bean11.xml");
- addNamespace("ns1", "http://apache.org/hello_world_soap_http/types");
- assertValid("/s:Envelope/s:Body/ns1:greetMeResponse", response);
- assertValid("//ns1:greetMeResponse/ns1:responseType", response);
- assertValid("//ns1:greetMeResponse/ns1:responseType[text()='Hello World']", response);
- }
-
- @Test
- public void testWSDL() throws Exception {
- Node doc = getWSDLDocument("TestService");
- assertNotNull(doc);
- assertValid("/wsdl:definitions/wsdl:types/xsd:schema"
- + "[@targetNamespace='http://apache.org/hello_world_soap_http/types']",
- doc);
- }
}
Added: cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/structure.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/structure.xml?rev=796387&view=auto
==============================================================================
--- cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/structure.xml (added)
+++ cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/structure.xml Tue Jul 21 17:09:48 2009
@@ -0,0 +1,14 @@
+<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
+ <env:Header/>
+ <env:Body>
+ <echoStruct xmlns="http://apache.org/hello_world_soap_http/types">
+ <struct>
+ <text>Hello</text>
+ <int>24</int>
+ <dbl>3.14159</dbl>
+ <texts>Hello</texts>
+ <texts>World</texts>
+ </struct>
+ </echoStruct>
+ </env:Body>
+</env:Envelope>
\ No newline at end of file
Propchange: cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/structure.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/structure.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/structure.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified: cxf/trunk/rt/databinding/sdo/src/test/resources/wsdl_sdo/HelloService_dynamic.wsdl
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/sdo/src/test/resources/wsdl_sdo/HelloService_dynamic.wsdl?rev=796387&r1=796386&r2=796387&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/sdo/src/test/resources/wsdl_sdo/HelloService_dynamic.wsdl (original)
+++ cxf/trunk/rt/databinding/sdo/src/test/resources/wsdl_sdo/HelloService_dynamic.wsdl Tue Jul 21 17:09:48 2009
@@ -28,6 +28,30 @@
<maxLength value="30" />
</restriction>
</simpleType>
+ <complexType name="Structure">
+ <sequence>
+ <element name="text" type="string"/>
+ <element name="int" type="int"/>
+ <element name="dbl" type="double"/>
+ <element name="texts" type="string" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+
+ <element name="echoStruct">
+ <complexType>
+ <sequence>
+ <element name="struct" type="tns:Structure" />
+ </sequence>
+ </complexType>
+ </element>
+ <element name="echoStructResponse">
+ <complexType>
+ <sequence>
+ <element name="return" type="tns:Structure" />
+ </sequence>
+ </complexType>
+ </element>
+
<element name="sayHi">
<complexType />
@@ -88,6 +112,12 @@
<wsdl:message name="greetMeResponse">
<wsdl:part element="x1:greetMeResponse" name="out" />
</wsdl:message>
+ <wsdl:message name="echoStructRequest">
+ <wsdl:part element="x1:echoStruct" name="in" />
+ </wsdl:message>
+ <wsdl:message name="echoStructResponse">
+ <wsdl:part element="x1:echoStructResponse" name="out" />
+ </wsdl:message>
<wsdl:message name="greetMeOneWayRequest">
<wsdl:part element="x1:greetMeOneWay" name="in" />
</wsdl:message>
@@ -111,6 +141,10 @@
<wsdl:input message="tns:greetMeRequest" name="greetMeRequest" />
<wsdl:output message="tns:greetMeResponse" name="greetMeResponse" />
</wsdl:operation>
+ <wsdl:operation name="echoStruct">
+ <wsdl:input message="tns:echoStructRequest" name="echoStructRequest" />
+ <wsdl:output message="tns:echoStructResponse" name="echoStructResponse" />
+ </wsdl:operation>
<wsdl:operation name="greetMeOneWay">
<wsdl:input message="tns:greetMeOneWayRequest" name="greetMeOneWayRequest" />
@@ -144,6 +178,15 @@
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
+ <wsdl:operation name="echoStruct">
+ <soap:operation soapAction="" style="document" />
+ <wsdl:input name="echoStructRequest">
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output name="echoStructResponse">
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
<wsdl:operation name="greetMeOneWay">
<soap:operation soapAction="" style="document" />
Modified: cxf/trunk/rt/databinding/sdo/src/test/resources/wsdl_sdo/HelloService_static.wsdl
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/sdo/src/test/resources/wsdl_sdo/HelloService_static.wsdl?rev=796387&r1=796386&r2=796387&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/sdo/src/test/resources/wsdl_sdo/HelloService_static.wsdl (original)
+++ cxf/trunk/rt/databinding/sdo/src/test/resources/wsdl_sdo/HelloService_static.wsdl Tue Jul 21 17:09:48 2009
@@ -28,6 +28,30 @@
<maxLength value="30" />
</restriction>
</simpleType>
+ <complexType name="Structure">
+ <sequence>
+ <element name="text" type="string"/>
+ <element name="int" type="int"/>
+ <element name="dbl" type="double"/>
+ <element name="texts" type="string" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+
+ <element name="echoStruct">
+ <complexType>
+ <sequence>
+ <element name="struct" type="tns:Structure" />
+ </sequence>
+ </complexType>
+ </element>
+ <element name="echoStructResponse">
+ <complexType>
+ <sequence>
+ <element name="return" type="tns:Structure" />
+ </sequence>
+ </complexType>
+ </element>
+
<element name="sayHi">
<complexType />
@@ -88,6 +112,12 @@
<wsdl:message name="greetMeResponse">
<wsdl:part element="x1:greetMeResponse" name="out" />
</wsdl:message>
+ <wsdl:message name="echoStructRequest">
+ <wsdl:part element="x1:echoStruct" name="in" />
+ </wsdl:message>
+ <wsdl:message name="echoStructResponse">
+ <wsdl:part element="x1:echoStructResponse" name="out" />
+ </wsdl:message>
<wsdl:message name="greetMeOneWayRequest">
<wsdl:part element="x1:greetMeOneWay" name="in" />
</wsdl:message>
@@ -111,6 +141,10 @@
<wsdl:input message="tns:greetMeRequest" name="greetMeRequest" />
<wsdl:output message="tns:greetMeResponse" name="greetMeResponse" />
</wsdl:operation>
+ <wsdl:operation name="echoStruct">
+ <wsdl:input message="tns:echoStructRequest" name="echoStructRequest" />
+ <wsdl:output message="tns:echoStructResponse" name="echoStructResponse" />
+ </wsdl:operation>
<wsdl:operation name="greetMeOneWay">
<wsdl:input message="tns:greetMeOneWayRequest" name="greetMeOneWayRequest" />
@@ -144,6 +178,15 @@
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
+ <wsdl:operation name="echoStruct">
+ <soap:operation soapAction="" style="document" />
+ <wsdl:input name="echoStructRequest">
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output name="echoStructResponse">
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
<wsdl:operation name="greetMeOneWay">
<soap:operation soapAction="" style="document" />