Author: jliu
Date: Wed Apr 18 22:57:10 2007
New Revision: 530282
URL: http://svn.apache.org/viewvc?view=rev&rev=530282
Log:
CXF-543, added more test cases for wsdltojava
Added:
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/expected/expected_doc_lit_wrapped_no_wrapperclass.wsdl
(with props)
Modified:
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/Hello.java
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/HelloWrapped.java
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilderTest.java
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/WrapperUtilTest.java
Modified:
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/Hello.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/Hello.java?view=diff&rev=530282&r1=530281&r2=530282
==============================================================================
---
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/Hello.java
(original)
+++
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/Hello.java
Wed Apr 18 22:57:10 2007
@@ -27,7 +27,7 @@
@WebService(name = "Hello", targetNamespace = "http://cxf.com/", wsdlLocation
= "file:///c:/tmp.wsdl")
public class Hello {
@WebMethod(operationName = "sayHi", exclude = false)
- String sayHi() {
+ public String sayHi() {
return "hi";
}
}
Modified:
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/HelloWrapped.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/HelloWrapped.java?view=diff&rev=530282&r1=530281&r2=530282
==============================================================================
---
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/HelloWrapped.java
(original)
+++
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/HelloWrapped.java
Wed Apr 18 22:57:10 2007
@@ -26,6 +26,6 @@
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL)
@WebService(name = "Hello", targetNamespace = "http://cxf.com/")
public interface HelloWrapped {
- @WebMethod(operationName = "sayHi", exclude = false)
- String sayHi();
+ @WebMethod(operationName = "sayHiWithoutWrapperClass", exclude = false)
+ String sayHiWithoutWrapperClass();
}
Modified:
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilderTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilderTest.java?view=diff&rev=530282&r1=530281&r2=530282
==============================================================================
---
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilderTest.java
(original)
+++
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilderTest.java
Wed Apr 18 22:57:10 2007
@@ -48,7 +48,6 @@
super.tearDown();
}
-
@Test
public void testGetOutputFile() {
builder.setServiceClass(Stock.class);
@@ -62,17 +61,53 @@
@Test
@Ignore
- public void testWrapped() {
+ public void testDocLitWrappedWithWrapperClass() {
builder.setServiceClass(org.apache.cxf.tools.fortest.withannotation.doc.Hello.class);
ServiceInfo service = builder.build();
generator.setServiceModel(service);
- File output = getOutputFile("hello_wrapped.wsdl");
+ File output = getOutputFile("doc_lit_wrapped_with_wrapperclass.wsdl");
assertNotNull(output);
generator.generate(output);
assertTrue(output.exists());
+
+ String expectedFile = this.getClass()
+
.getResource("expected/expected_doc_lit_wrapped_no_wrapperclass.wsdl").getFile();
+ assertFileEquals(expectedFile, output.getAbsolutePath());
+ }
+
+ @Test
+ public void testDocLitWrappedWithoutWrapperClass() throws Exception {
+
builder.setServiceClass(org.apache.cxf.tools.fortest.withannotation.doc.HelloWrapped.class);
+ ServiceInfo service = builder.build();
+
+ generator.setServiceModel(service);
+ File output = getOutputFile("doc_lit_wrapped_no_wrapperclass.wsdl");
+ assertNotNull(output);
+ generator.generate(output);
+ assertTrue(output.exists());
+
+ String expectedFile = this.getClass()
+
.getResource("expected/expected_doc_lit_wrapped_no_wrapperclass.wsdl").getFile();
+ assertFileEquals(expectedFile, output.getAbsolutePath());
}
+
@Test
+ public void testDocLit() throws Exception {
+ builder.setServiceClass(org.apache.hello_world_doc_lit.Greeter.class);
+ ServiceInfo service = builder.build();
+ generator.setServiceModel(service);
+ File output = getOutputFile("hello_doc_lit.wsdl");
+ assertNotNull(output);
+ generator.generate(output);
+ assertTrue(output.exists());
+
+ String expectedFile =
this.getClass().getResource("expected/expected_hello_world_doc_lit.wsdl")
+ .getFile();
+ assertFileEquals(expectedFile, output.getAbsolutePath());
+ }
+
+ @Test
public void testAsync() throws Exception {
builder.setServiceClass(org.apache.hello_world_async_soap_http.GreeterAsync.class);
ServiceInfo service = builder.build();
@@ -120,21 +155,6 @@
}
- @Test
- public void testDocLit() throws Exception {
- builder.setServiceClass(org.apache.hello_world_doc_lit.Greeter.class);
- ServiceInfo service = builder.build();
- generator.setServiceModel(service);
- File output = getOutputFile("hello_doc_lit.wsdl");
- assertNotNull(output);
- generator.generate(output);
- assertTrue(output.exists());
-
- String expectedFile =
this.getClass().getResource("expected/expected_hello_world_doc_lit.wsdl")
- .getFile();
- assertFileEquals(expectedFile, output.getAbsolutePath());
- }
-
// TODO:
@Test
@Ignore
@@ -144,21 +164,6 @@
generator.setServiceModel(service);
File file = getOutputFile("rpc_lit_service_no_anno.wsdl");
- assertNotNull(output);
- generator.generate(file);
- assertTrue(output.exists());
-
- }
-
- // TODO:
- @Test
- @Ignore
- public void testDocWrappedWithoutWrapperClass() throws Exception {
-
builder.setServiceClass(org.apache.cxf.tools.fortest.withannotation.doc.HelloWrapped.class);
- ServiceInfo service = builder.build();
-
- generator.setServiceModel(service);
- File file = getOutputFile("doc_lit_wrapped_no_anno.wsdl");
assertNotNull(output);
generator.generate(file);
assertTrue(output.exists());
Modified:
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/WrapperUtilTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/WrapperUtilTest.java?view=diff&rev=530282&r1=530281&r2=530282
==============================================================================
---
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/WrapperUtilTest.java
(original)
+++
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/WrapperUtilTest.java
Wed Apr 18 22:57:10 2007
@@ -57,7 +57,7 @@
public void testWrapperClassNotExists() throws Exception {
Class helloClass =
Class.forName("org.apache.cxf.tools.fortest.withannotation.doc.HelloWrapped");
assertNotNull(helloClass);
- Method helloMethod = helloClass.getMethod("sayHi");
+ Method helloMethod = helloClass.getMethod("sayHiWithoutWrapperClass");
assertNotNull(helloMethod);
assertFalse(WrapperUtil.isWrapperClassExists(helloMethod));
}
Added:
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/expected/expected_doc_lit_wrapped_no_wrapperclass.wsdl
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/expected/expected_doc_lit_wrapped_no_wrapperclass.wsdl?view=auto&rev=530282
==============================================================================
---
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/expected/expected_doc_lit_wrapped_no_wrapperclass.wsdl
(added)
+++
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/expected/expected_doc_lit_wrapped_no_wrapperclass.wsdl
Wed Apr 18 22:57:10 2007
@@ -0,0 +1,70 @@
+<!--
+ 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.
+-->
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions name="HelloWrappedService" targetNamespace="http://cxf.com/"
xmlns:ns1="http://cxf.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+ <wsdl:types>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://cxf.com/" attributeFormDefault="unqualified"
elementFormDefault="qualified" targetNamespace="http://cxf.com/">
+<xsd:element name="sayHiWithoutWrapperClass">
+<xsd:complexType>
+<xsd:sequence/>
+</xsd:complexType>
+</xsd:element>
+<xsd:element name="sayHiWithoutWrapperClassResponse">
+<xsd:complexType>
+<xsd:sequence>
+<xsd:element name="return" nillable="true" type="xsd:string"/>
+</xsd:sequence>
+</xsd:complexType>
+</xsd:element>
+</xsd:schema>
+ </wsdl:types>
+ <wsdl:message name="sayHiWithoutWrapperClass">
+ <wsdl:part name="sayHiWithoutWrapperClass"
element="ns1:sayHiWithoutWrapperClass">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="sayHiWithoutWrapperClassResponse">
+ <wsdl:part name="sayHiWithoutWrapperClassResponse"
element="ns1:sayHiWithoutWrapperClassResponse">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:portType name="Hello">
+ <wsdl:operation name="sayHiWithoutWrapperClass">
+ <wsdl:input name="sayHiWithoutWrapperClass"
message="ns1:sayHiWithoutWrapperClass">
+ </wsdl:input>
+ <wsdl:output name="sayHiWithoutWrapperClassResponse"
message="ns1:sayHiWithoutWrapperClassResponse">
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="HelloWrappedServiceSoapBinding" type="ns1:Hello">
+ <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="sayHiWithoutWrapperClass">
+ <soap:operation soapAction="" style="document"/>
+ <wsdl:input name="sayHiWithoutWrapperClass">
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="sayHiWithoutWrapperClassResponse">
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="HelloWrappedService">
+ <wsdl:port name="HelloWrappedPort"
binding="ns1:HelloWrappedServiceSoapBinding">
+ <soap:address location="http://localhost:9090"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
Propchange:
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/expected/expected_doc_lit_wrapped_no_wrapperclass.wsdl
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/expected/expected_doc_lit_wrapped_no_wrapperclass.wsdl
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange:
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/expected/expected_doc_lit_wrapped_no_wrapperclass.wsdl
------------------------------------------------------------------------------
svn:mime-type = text/xml