Author: bfitzpat
Date: 2011-05-11 13:40:30 -0400 (Wed, 11 May 2011)
New Revision: 31218
Added:
trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide8770/
trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide8770/parts.wsdl
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.test/src/org/jboss/tools/ws/ui/test/utils/TesterWSDLUtilsTest.java
Log:
OPEN - issue JBIDE-8927: WS Tester issues with JUnit tests after fixing JBDS-1602
https://issues.jboss.org/browse/JBIDE-8927
Added: trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide8770/parts.wsdl
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide8770/parts.wsdl
(rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide8770/parts.wsdl 2011-05-11
17:40:30 UTC (rev 31218)
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+
xmlns:tns="http://www.example.org/ws/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:basic="http://www.example.org/ws/basic/"
+
xmlns:extra="http://www.example.org/ws/extra/"
xmlns:square="http://www.example.org/ws/square/"
+
xmlns:common="http://www.example.org/ws/common/" name="example"
+
targetNamespace="http://www.example.org/ws/">
+ <wsdl:types>
+ <xsd:schema
targetNamespace="http://www.example.org/ws/common/"
+
xmlns:tns="http://www.example.org/ws/common/">
+ <xsd:element name="header" type="tns:headerType" />
+ <xsd:complexType name="headerType">
+ <xsd:sequence>
+ <xsd:element name="timestamp" type="xsd:dateTime" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:schema>
+ <xsd:schema
targetNamespace="http://www.example.org/ws/square/"
+
xmlns:tns="http://www.example.org/ws/square/">
+ <xsd:element name="square" type="tns:squareType" />
+ <xsd:element name="squareResponse"
type="tns:squareResponseType" />
+ <xsd:element name="storeResult" type="tns:storeResultType"
/>
+ <xsd:element name="storeHeader" type="tns:storeHeaderType"
/>
+ <xsd:complexType name="squareType">
+ <xsd:sequence>
+ <xsd:element name="a" type="xsd:int" />
+ <xsd:element name="b" type="xsd:int" />
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:complexType name="squareResponseType">
+ <xsd:sequence>
+ <xsd:element name="out" type="xsd:int" />
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:complexType name="storeResultType">
+ <xsd:sequence>
+ <xsd:element name="a" type="xsd:int" />
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:complexType name="storeHeaderType">
+ <xsd:sequence>
+ <xsd:element name="id" type="xsd:string" />
+ <xsd:element name="timestamp" type="xsd:dateTime" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:schema>
+ <xsd:schema
targetNamespace="http://www.example.org/ws/basic/"
+
xmlns:tns="http://www.example.org/ws/basic/">
+ <xsd:import
namespace="http://www.example.org/ws/common/" />
+ <xsd:element name="operationRequest" type="tns:requestType"
/>
+ <xsd:element name="operationResponse" type="tns:responseType"
/>
+ <xsd:element name="invalidNumberFault" type="tns:faultType"
/>
+ <xsd:complexType name="requestType">
+ <xsd:sequence>
+ <xsd:element name="a" type="xsd:float" />
+ <xsd:element name="b" type="xsd:float" />
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:complexType name="responseType">
+ <xsd:sequence>
+ <xsd:element name="out" type="xsd:float" />
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:complexType name="faultType">
+ <xsd:sequence>
+ <xsd:element name="description" type="xsd:string" />
+ <xsd:element name="details" type="xsd:string" />
+ <xsd:element name="a" type="xsd:float" />
+ <xsd:element name="b" type="xsd:float" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:schema>
+ <xsd:schema
targetNamespace="http://www.example.org/ws/extra/"
+
xmlns:tns="http://www.example.org/ws/extra/">
+ <xsd:import
namespace="http://www.example.org/ws/common/" />
+ <xsd:element name="operationRequest" type="tns:requestType"
/>
+ <xsd:element name="operationResponse" type="tns:responseType"
/>
+ <xsd:element name="invalidNumberFault" type="tns:faultType"
/>
+ <xsd:complexType name="requestType">
+ <xsd:sequence>
+ <xsd:element name="a" type="xsd:double" />
+ <xsd:element name="b" type="xsd:double" />
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:complexType name="responseType">
+ <xsd:sequence>
+ <xsd:element name="out" type="xsd:double" />
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:complexType name="faultType">
+ <xsd:sequence>
+ <xsd:element name="description" type="xsd:string" />
+ <xsd:element name="details" type="xsd:string" />
+ <xsd:element name="a" type="xsd:double" />
+ <xsd:element name="b" type="xsd:double" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:schema>
+ </wsdl:types>
+ <wsdl:message name="storeHeader">
+ <wsdl:part name="storeHeader" element="square:storeHeader"
/>
+ </wsdl:message>
+ <wsdl:message name="minusOperationRequest">
+ <wsdl:part name="parameters" element="basic:operationRequest"
/>
+ <wsdl:part name="header" element="common:header" />
+ </wsdl:message>
+ <wsdl:message name="minusOperationResponse">
+ <wsdl:part name="parameters" element="basic:operationResponse"
/>
+ </wsdl:message>
+ <wsdl:message name="invalidNumberFaultBasic">
+ <wsdl:part name="parameters" element="basic:invalidNumberFault"
/>
+ </wsdl:message>
+ <wsdl:message name="invalidNumberFaultExtra">
+ <wsdl:part name="parameters" element="extra:invalidNumberFault"
/>
+ </wsdl:message>
+ <wsdl:portType name="minusPortType">
+ <wsdl:operation name="minusOperation">
+ <wsdl:input message="tns:minusOperationRequest"
name="minusOperationRequest" />
+ <wsdl:output message="tns:minusOperationResponse"
name="minusOperationResponse" />
+ <wsdl:fault message="tns:invalidNumberFaultBasic"
name="invalidNumberFault" />
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="minusSOAP" type="tns:minusPortType">
+ <soap:binding style="document"
+
transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="minusOperation">
+ <soap:operation
soapAction="http://www.example.org/ws/minusOperation"
/>
+ <wsdl:input>
+ <soap:header message="tns:storeHeader" part="storeHeader"
+ use="literal" />
+ <soap:body parts="parameters" use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="basic">
+ <wsdl:port name="minusPort" binding="tns:minusSOAP">
+ <soap:address
location="http://www.example.org/" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
Property changes on:
trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide8770/parts.wsdl
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.test/src/org/jboss/tools/ws/ui/test/utils/TesterWSDLUtilsTest.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.test/src/org/jboss/tools/ws/ui/test/utils/TesterWSDLUtilsTest.java 2011-05-11
17:40:26 UTC (rev 31217)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.test/src/org/jboss/tools/ws/ui/test/utils/TesterWSDLUtilsTest.java 2011-05-11
17:40:30 UTC (rev 31218)
@@ -100,39 +100,66 @@
Assert.assertTrue(s1.contains("<tns:gQuery>?</tns:gQuery>"));
String s2 = getSampleMessage("/jbide6593/original.wsdl",
"gsearch_rss", "gsearch_rssSoap", "gsearch_rssSoap",
"GetSearchResults");
- Assert.assertTrue(s2.contains("<tns:GetSearchResults
xmlns:tns=\"http://www.ecubicle.net/webservices\">"));
- Assert.assertTrue(s2.contains("<tns:gQuery>?</tns:gQuery>"));
-// Assert.assertEquals(s1, s2);
+// Assert.assertTrue(s2.contains("<tns:GetSearchResults
xmlns:tns=\"http://www.ecubicle.net/webservices\">"));
+// Assert.assertTrue(s2.contains("<tns:gQuery>?</tns:gQuery>"));
+ Assert.assertEquals(s1, s2);
}
@Test
public void testJBIDE6694() {
- /*STILL WORKING ON THIS ONE*/
-// String s1 = getSampleMessage("/jbide6694/ConverterPortType.wsdl",
"ConverterPortType", "ConverterPortTypeImplPort",
"ConverterPortTypeBinding", "convert");
-// Assert.assertTrue(s1.contains("<tns:ChangeUnit
xmlns:tns=\"http://test.jboss.org/ns\">"));
-// Assert.assertTrue(s1.contains("<tns:value>?</tns:value>"));
-// Assert.assertTrue(s1.contains("<tns:fromUnit>?</tns:fromUnit>"));
-// Assert.assertTrue(s1.contains("<tns:toUnit>?</tns:toUnit>"));
-//
-// String s2 = getSampleMessage("/jbide6694/jbide6694.wsdl",
"Converter", "ConverterPort", "ConverterBinding",
"convert");
-// Assert.assertTrue(s2.contains("<ChangeUnit xmlns =
\"http://test.jboss.org/ns\">"));
-// Assert.assertTrue(s2.contains("<value>?</value>"));
-// Assert.assertTrue(s2.contains("<fromUnit>?</fromUnit>"));
-// Assert.assertTrue(s2.contains("<toUnit>?</toUnit>"));
+ String s1 = getSampleMessage("/jbide6694/ConverterPortType.wsdl",
"ConverterPortType", "ConverterPortTypeImplPort",
"ConverterPortTypeBinding", "convert");
+ Assert.assertTrue(s1.contains("<tns:ChangeUnit
xmlns:tns=\"http://test.jboss.org/ns\">"));
+ Assert.assertTrue(s1.contains("<tns:value>?</tns:value>"));
+ Assert.assertTrue(s1.contains("<tns:fromUnit>?</tns:fromUnit>"));
+ Assert.assertTrue(s1.contains("<tns:toUnit>?</tns:toUnit>"));
+
+ String s2 = getSampleMessage("/jbide6694/jbide6694.wsdl",
"Converter", "ConverterPort", "ConverterBinding",
"convert");
+ Assert.assertTrue(s2.contains("<tns:ChangeUnit
xmlns:tns=\"http://test.jboss.org/ns\">"));
+ Assert.assertTrue(s2.contains("<tns:value>?</tns:value>"));
+ Assert.assertTrue(s2.contains("<tns:fromUnit>?</tns:fromUnit>"));
+ Assert.assertTrue(s2.contains("<tns:toUnit>?</tns:toUnit>"));
}
@Test
public void testJBIDE6865() {
- /*STILL WORKING ON THIS ONE*/
-// String s1 = getSampleMessage("/jbide6865/wsdl1.wsdl",
"DirectFlight", "DirectFlightSoap",
"FlightAwareDirectFlight:DirectFlightSoap", "AirportInfo");
-// Assert.assertTrue(s1.contains("<airportCode>?</airportCode>"));
+ String s1 = getSampleMessage("/jbide6865/wsdl1.wsdl",
"DirectFlight", "DirectFlightSoap",
"FlightAwareDirectFlight:DirectFlightSoap", "AirportInfo");
+ Assert.assertTrue(s1.contains("<airportCode>?</airportCode>"));
}
+
+ @Test
+ public void testJBDS1602() {
+ String s1 = getSampleMessage("/jbds1602/StockQuoteService.wsdl",
"StockQuoteService", "StockQuoteServicePort",
"tns:StockQuoteServiceBinding", "getStockQuoteBySymbol");
+ Assert.assertTrue(s1.contains("<stoc:getStockQuoteBySymbol
xmlns:stoc=\"http://www.jboss.com/webservices/StockQuoteService\&quo...;
+ Assert.assertTrue(s1.contains("<arg0>?</arg0>"));
+ String s2 = getSampleMessage("/jbds1602/jb/SampleWS.wsdl",
"SampleWSService", "SampleWSPort",
"tns:SampleWSServiceSoapBinding", "echo");
+ Assert.assertTrue(s2.contains("<test:echo
xmlns:test=\"http://test/\">"));
+ Assert.assertTrue(s2.contains("<test:arg0
xmlns:x=\"http://example.com/attr/x\" x:C=\"?\"
xmlns:y=\"http://example.com/attr/y\" y:D=\"?\" >"));
+ Assert.assertTrue(s2.contains("<othe:OtherType
xmlns:othe=\"http://example.com/attr/other\" othe:myid=\"?\"
x:Y=\"?\" >"));
+ Assert.assertTrue(s2.contains("<b:description>?</b:description>"));
+ }
+
+ @Test
+ public void testJBIDE8770() {
+ String s1 = getSampleMessage("/jbide8770/parts.wsdl", "basic",
"minusPort", "minusSOAP", "minusOperation");
+ Assert.assertTrue(s1.contains("<basi:operationRequest
xmlns:basi=\"http://www.example.org/ws/basic/\">"));
+ Assert.assertTrue(s1.contains("<a>?</a>"));
+
+ String s2 = getSampleMessageHeader("/jbide8770/parts.wsdl",
"basic", "minusPort", "minusSOAP",
"minusOperation");
+ Assert.assertTrue(s2.contains("<squa:storeHeader
xmlns:squa=\"http://www.example.org/ws/square/\">"));
+ Assert.assertTrue(s2.contains("<timestamp>?</timestamp>"));
+ }
+
private String getSampleMessage(String res, String service, String port, String binding,
String operation) {
Definition def = readWSDL(res);
return SchemaUtils.getSampleSOAPInputMessage(def, service, port, binding, operation);
}
+ private String getSampleMessageHeader(String res, String service, String port, String
binding, String operation) {
+ Definition def = readWSDL(res);
+ return SchemaUtils.getSampleSOAPMessageHeader(def, service, port, binding, operation);
+ }
+
private Definition readWSDL(String path) {
try {
URL url = SchemaUtils.class.getResource(path).toURI().toURL();