diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2010-11-10 12:37:38 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2010-11-10 12:37:38 +0000 |
commit | 7c15e6611d5681311b318db073ac7651a72adf21 (patch) | |
tree | 7da24c44ad327518a97e2cd2b0fa63ea8813e106 /sca-java-1.x/trunk/itest/wsdlgen/src/test | |
parent | 353403e57d555188c9101348583c76e71d3fcc36 (diff) |
TUSCANY-3778 - changes to demonstrate the issues described in the JIRA. The failing tests are commented out.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1033436 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-1.x/trunk/itest/wsdlgen/src/test')
3 files changed, 108 insertions, 8 deletions
diff --git a/sca-java-1.x/trunk/itest/wsdlgen/src/test/java/helloworld/HttpTransportTestCase.java b/sca-java-1.x/trunk/itest/wsdlgen/src/test/java/helloworld/HttpTransportTestCase.java index 22f154fbf3..8d1694d1d7 100644 --- a/sca-java-1.x/trunk/itest/wsdlgen/src/test/java/helloworld/HttpTransportTestCase.java +++ b/sca-java-1.x/trunk/itest/wsdlgen/src/test/java/helloworld/HttpTransportTestCase.java @@ -20,9 +20,9 @@ package helloworld; import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertNotNull; +import static junit.framework.Assert.fail; import java.io.IOException; -import java.net.HttpURLConnection; import java.net.URL; import javax.xml.namespace.QName; @@ -85,15 +85,16 @@ public class HttpTransportTestCase{ } @Test - public void testComponent1JAXWS() throws IOException { + public void testComponent1JAXWSwsgen() throws IOException { // talk to the service using JAXWS with WSDL generated from this service used wsgen // the idea here is to demonstrate that the service is providing a JAXWS compliant // interface QName serviceName = new QName("http://helloworld/", "HelloWorldImplService"); + QName portName = new QName("http://helloworld/", "HelloWorldImplPort"); URL wsdlLocation = this.getClass().getClassLoader().getResource("wsdl/HelloWorldImplService.wsdl"); Service webService = Service.create( wsdlLocation, serviceName ); - HelloWorldService wsProxy = (HelloWorldService) webService.getPort(HelloWorldService.class); + HelloWorldService wsProxy = (HelloWorldService) webService.getPort(portName, HelloWorldService.class); assertEquals("Hello Fred", wsProxy.getGreetings("Fred")); @@ -107,10 +108,24 @@ public class HttpTransportTestCase{ abean.setField3(bbean); assertEquals("Hello 3 4 1 2", wsProxy.getGreetingsDBean(abean)); +/* TUSCANY-3778 + String byteArrayString = "Hello World"; + assertEquals(byteArrayString, String.valueOf(wsProxy.getGreetingsByteArray(byteArrayString.getBytes()))); - // repeat the JAXWS call with WSDL generated by tuscany - - } + try { + wsProxy.getGreetingsException("Fred"); + fail("exception not returned"); + } catch(Exception ex) { + + } +*/ + } + + @Test + public void testComponent1JAXWStuscanygen() throws IOException { + // repeat the JAXWS call with WSDL generated by tuscany + + } @After public void stopServer() throws Exception { diff --git a/sca-java-1.x/trunk/itest/wsdlgen/src/test/resources/wsdl/HelloWorldImplService.wsdl b/sca-java-1.x/trunk/itest/wsdlgen/src/test/resources/wsdl/HelloWorldImplService.wsdl index 5fa0d565b1..157c4a573a 100644 --- a/sca-java-1.x/trunk/itest/wsdlgen/src/test/resources/wsdl/HelloWorldImplService.wsdl +++ b/sca-java-1.x/trunk/itest/wsdlgen/src/test/resources/wsdl/HelloWorldImplService.wsdl @@ -45,7 +45,22 @@ <message name="getGreetingsDBeanResponse"> <part name="parameters" element="tns:getGreetingsDBeanResponse"/> </message> - <portType name="HelloWorldService"> + <message name="getGreetingsException"> + <part name="parameters" element="tns:getGreetingsException"/> + </message> + <message name="getGreetingsExceptionResponse"> + <part name="parameters" element="tns:getGreetingsExceptionResponse"/> + </message> + <message name="HelloWorldException"> + <part name="fault" element="tns:HelloWorldException"/> + </message> + <message name="getGreetingsByteArray"> + <part name="parameters" element="tns:getGreetingsByteArray"/> + </message> + <message name="getGreetingsByteArrayResponse"> + <part name="parameters" element="tns:getGreetingsByteArrayResponse"/> + </message> + <portType name="HelloWorldImpl"> <operation name="getGreetings"> <input message="tns:getGreetings"/> <output message="tns:getGreetingsResponse"/> @@ -70,8 +85,17 @@ <input message="tns:getGreetingsDBean"/> <output message="tns:getGreetingsDBeanResponse"/> </operation> + <operation name="getGreetingsException"> + <input message="tns:getGreetingsException"/> + <output message="tns:getGreetingsExceptionResponse"/> + <fault message="tns:HelloWorldException" name="HelloWorldException"/> + </operation> + <operation name="getGreetingsByteArray"> + <input message="tns:getGreetingsByteArray"/> + <output message="tns:getGreetingsByteArrayResponse"/> + </operation> </portType> - <binding name="HelloWorldImplPortBinding" type="tns:HelloWorldService"> + <binding name="HelloWorldImplPortBinding" type="tns:HelloWorldImpl"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/> <operation name="getGreetings"> <soap:operation soapAction=""/> @@ -127,6 +151,27 @@ <soap:body use="literal"/> </output> </operation> + <operation name="getGreetingsException"> + <soap:operation soapAction=""/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="HelloWorldException"> + <soap:fault name="HelloWorldException" use="literal"/> + </fault> + </operation> + <operation name="getGreetingsByteArray"> + <soap:operation soapAction=""/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + </operation> </binding> <service name="HelloWorldImplService"> <port name="HelloWorldImplPort" binding="tns:HelloWorldImplPortBinding"> diff --git a/sca-java-1.x/trunk/itest/wsdlgen/src/test/resources/wsdl/HelloWorldImplService_schema2.xsd b/sca-java-1.x/trunk/itest/wsdlgen/src/test/resources/wsdl/HelloWorldImplService_schema2.xsd index 446492c371..ad2c2de492 100644 --- a/sca-java-1.x/trunk/itest/wsdlgen/src/test/resources/wsdl/HelloWorldImplService_schema2.xsd +++ b/sca-java-1.x/trunk/itest/wsdlgen/src/test/resources/wsdl/HelloWorldImplService_schema2.xsd @@ -3,6 +3,8 @@ <xs:import namespace="http://test" schemaLocation="HelloWorldImplService_schema1.xsd"/> + <xs:element name="HelloWorldException" type="tns:HelloWorldException"/> + <xs:element name="getGreetings" type="tns:getGreetings"/> <xs:element name="getGreetingsBBean" type="tns:getGreetingsBBean"/> @@ -17,6 +19,10 @@ <xs:element name="getGreetingsBeanResponse" type="tns:getGreetingsBeanResponse"/> + <xs:element name="getGreetingsByteArray" type="tns:getGreetingsByteArray"/> + + <xs:element name="getGreetingsByteArrayResponse" type="tns:getGreetingsByteArrayResponse"/> + <xs:element name="getGreetingsCBean" type="tns:getGreetingsCBean"/> <xs:element name="getGreetingsCBeanResponse" type="tns:getGreetingsCBeanResponse"/> @@ -25,8 +31,30 @@ <xs:element name="getGreetingsDBeanResponse" type="tns:getGreetingsDBeanResponse"/> + <xs:element name="getGreetingsException" type="tns:getGreetingsException"/> + + <xs:element name="getGreetingsExceptionResponse" type="tns:getGreetingsExceptionResponse"/> + <xs:element name="getGreetingsResponse" type="tns:getGreetingsResponse"/> + <xs:complexType name="getGreetingsException"> + <xs:sequence> + <xs:element name="arg0" type="xs:string" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="getGreetingsExceptionResponse"> + <xs:sequence> + <xs:element name="return" type="xs:string" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="HelloWorldException"> + <xs:sequence> + <xs:element name="message" type="xs:string" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="getGreetingsBeanArray"> <xs:sequence> <xs:element name="arg0" type="ns1:aBean" nillable="true" minOccurs="0" maxOccurs="unbounded"/> @@ -46,6 +74,18 @@ </xs:sequence> </xs:complexType> + <xs:complexType name="getGreetingsByteArray"> + <xs:sequence> + <xs:element name="arg0" type="xs:base64Binary" nillable="true" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="getGreetingsByteArrayResponse"> + <xs:sequence> + <xs:element name="return" type="xs:base64Binary" nillable="true" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="getGreetingsBBean"> <xs:sequence> <xs:element name="arg0" type="tns:bBean" minOccurs="0"/> |