Author: jlukas(a)redhat.com
Date: 2011-06-08 08:41:28 -0400 (Wed, 08 Jun 2011)
New Revision: 31911
Added:
trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/example.wsdl
trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/soap12/
trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/soap12/EnumTest.wsdl
trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/soap12/EnumTest.xsd
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbds1602/jb/SampleWS.wsdl
trunk/ws/tests/org.jboss.tools.ws.ui.test/src/org/jboss/tools/ws/ui/test/utils/TesterWSDLUtilsTest.java
Log:
ws tester test update
Added: trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/example.wsdl
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/example.wsdl
(rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/example.wsdl 2011-06-08 12:41:28
UTC (rev 31911)
@@ -0,0 +1,351 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:tns="http://www.example.org/ws/"
+
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsp="http://www.w3.org/ns/ws-policy"
+
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
+
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="square">
+ <wsdl:part name="parameters" element="square:square" />
+ </wsdl:message>
+ <wsdl:message name="squareResponse">
+ <wsdl:part name="parameters" element="square:squareResponse"
/>
+ </wsdl:message>
+ <wsdl:message name="storeResult">
+ <wsdl:part name="parameters" element="square:storeResult" />
+ </wsdl:message>
+ <wsdl:message name="storeHeader">
+ <wsdl:part name="storeHeader" element="square:storeHeader"
/>
+ </wsdl:message>
+ <wsdl:message name="addOperationRequest">
+ <wsdl:part name="addOperationRequest"
element="basic:operationRequest" />
+ <wsdl:part name="header" element="common:header" />
+ </wsdl:message>
+ <wsdl:message name="addOperationResponse">
+ <wsdl:part name="addOperationResponse"
element="basic:operationResponse" />
+ </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="multiplyOperationRequest">
+ <wsdl:part name="parameters" element="extra:operationRequest"
/>
+ </wsdl:message>
+ <wsdl:message name="multiplyOperationResponse">
+ <wsdl:part name="parameters" element="extra:operationResponse"
/>
+ </wsdl:message>
+ <wsdl:message name="divideOperationRequest">
+ <wsdl:part name="parameters" element="extra:operationRequest"
/>
+ <wsdl:part name="header" element="common:header" />
+ </wsdl:message>
+ <wsdl:message name="divideOperationResponse">
+ <wsdl:part name="parameters" element="extra: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="squarePortType">
+ <wsdl:operation name="square">
+ <wsdl:input message="tns:square" name="square" />
+ <wsdl:output message="tns:squareResponse" name="squareResponse"
/>
+ </wsdl:operation>
+ <wsdl:operation name="storeResult">
+ <wsdl:input message="tns:storeResult" name="storeResult"
+
wsam:Action="http://www.example.org/ws/squarePortType/storeResult"
+
wsaw:Action="http://www.example.org/ws/squarePortType/storeResult" />
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:portType name="addPortType">
+ <wsdl:operation name="addOperation">
+ <wsdl:input message="tns:addOperationRequest"
name="addOperationRequest" />
+ <wsdl:output message="tns:addOperationResponse"
name="addOperationResponse" />
+ <wsdl:fault message="tns:invalidNumberFaultBasic"
name="invalidNumberFault" />
+ </wsdl:operation>
+ </wsdl:portType>
+ <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:portType name="multiplyPortType">
+ <wsdl:operation name="multiplyOperation">
+ <wsdl:input message="tns:multiplyOperationRequest"
name="multiplyOperationRequest"
+
wsam:Action="http://www.example.org/ws/multiplyPortType/multiplyOper...
+
wsaw:Action="http://www.example.org/ws/multiplyPortType/multiplyOper...
/>
+ <wsdl:output message="tns:multiplyOperationResponse"
+ name="multiplyOperationResponse"
+
wsam:Action="http://www.example.org/ws/multiplyPortType/multiplyOper...
+
wsaw:Action="http://www.example.org/ws/multiplyPortType/multiplyOper...
/>
+ <wsdl:fault message="tns:invalidNumberFaultExtra"
name="invalidNumberFault"
+
wsam:Action="http://www.example.org/ws/multiplyPortType/multiplyOper...
/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:portType name="dividerPortType">
+ <wsdl:operation name="divideOperation">
+ <wsdl:input message="tns:divideOperationRequest"
name="divideOperationRequest"
+
wsam:Action="http://www.example.org/ws/dividerPortType/divideOperati...
+
wsaw:Action="http://www.example.org/ws/dividerPortType/divideOperati...
/>
+ <wsdl:output message="tns:divideOperationResponse"
name="divideOperationResponse"
+
wsam:Action="http://www.example.org/ws/dividerPortType/divideOperati...
+
wsaw:Action="http://www.example.org/ws/dividerPortType/divideOperati...
/>
+ <wsdl:fault message="tns:invalidNumberFaultExtra"
name="invalidNumberFault"
+
wsam:Action="http://www.example.org/ws/dividerPortType/divideOperati...
/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="squareSOAP" type="tns:squarePortType">
+ <soap:binding style="document"
+
transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsaw:UsingAddressing wsdl:required="true" />
+ <wsp:PolicyReference URI="#squareSOAPBinding_WSAM_Addressing_Policy"
/>
+ <wsdl:operation name="square">
+ <soap:operation
soapAction="http://www.example.org/ws/squareOperation"
/>
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="storeResult">
+ <soap:operation
soapAction="http://www.example.org/ws/storeResultOperation" />
+ <wsdl:input>
+ <soap:header message="tns:storeHeader" part="storeHeader"
+ use="literal" />
+ <soap:body use="literal" />
+ </wsdl:input>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="squareSOAP12" type="tns:squarePortType">
+ <soap12:binding style="document"
+
transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsaw:UsingAddressing wsdl:required="true" />
+ <wsp:PolicyReference URI="#squareSOAPBinding_WSAM_Addressing_Policy"
/>
+ <wsdl:operation name="square">
+ <soap12:operation
soapAction="http://www.example.org/ws/squareOperation"
/>
+ <wsdl:input>
+ <soap12:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="storeResult">
+ <soap12:operation
soapAction="http://www.example.org/ws/storeResultOperation" />
+ <wsdl:input>
+ <soap12:header message="tns:storeHeader" part="storeHeader"
+ use="literal" />
+ <soap12:body use="literal" />
+ </wsdl:input>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="addSOAP" type="tns:addPortType">
+ <soap:binding style="document"
+
transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="addOperation">
+ <soap:operation
soapAction="http://www.example.org/ws/addOperation"
/>
+ <wsdl:input>
+ <soap:header message="tns:addOperationRequest" part="header"
+ use="literal" />
+ <soap:body parts="addOperationRequest" use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <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:binding name="multiplySOAP"
type="tns:multiplyPortType">
+ <soap:binding style="document"
+
transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsaw:UsingAddressing wsdl:required="true" />
+ <wsp:PolicyReference URI="#multiplySOAPBinding_WSAM_Addressing_Policy"
/>
+ <wsdl:operation name="multiplyOperation">
+ <soap:operation
soapAction="http://www.example.org/ws/multiplyOperation"
/>
+ <wsdl:input>
+ <soap:header message="tns:storeHeader" part="storeHeader"
+ use="literal" />
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="divideSOAP" type="tns:dividerPortType">
+ <soap:binding style="document"
+
transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsaw:UsingAddressing wsdl:required="true" />
+ <wsp:PolicyReference URI="#divideSOAPBinding_WSAM_Addressing_Policy"
/>
+ <wsdl:operation name="divideOperation">
+ <soap:operation
soapAction="http://www.example.org/ws/divideOperation"
/>
+ <wsdl:input>
+ <soap:header message="tns:divideOperationRequest"
part="header"
+ 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="adderPort" binding="tns:addSOAP">
+ <soap:address
location="http://www.example.org/" />
+ </wsdl:port>
+ <wsdl:port name="minusPort" binding="tns:minusSOAP">
+ <soap:address
location="http://www.example.org/" />
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="extra">
+ <wsdl:port name="multiplierPort" binding="tns:multiplySOAP">
+ <soap:address
location="http://www.example.org/" />
+ </wsdl:port>
+ <wsdl:port name="dividerPort" binding="tns:divideSOAP">
+ <soap:address
location="http://www.example.org/" />
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="square">
+ <wsdl:port name="squarePort" binding="tns:squareSOAP">
+ <soap:address
location="http://www.example.org/" />
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="square12">
+ <wsdl:port name="squarePort12" binding="tns:squareSOAP12">
+ <soap12:address
location="http://www.example.org/" />
+ </wsdl:port>
+ </wsdl:service>
+ <wsp:Policy wsu:Id="multiplySOAPBinding_WSAM_Addressing_Policy"
+
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-w...
+ <wsam:Addressing>
+ <wsp:Policy />
+ </wsam:Addressing>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="divideSOAPBinding_WSAM_Addressing_Policy"
+
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-w...
+ <wsam:Addressing>
+ <wsp:Policy />
+ </wsam:Addressing>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="squareSOAPBinding_WSAM_Addressing_Policy"
+
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-w...
+ <wsam:Addressing>
+ <wsp:Policy />
+ </wsam:Addressing>
+ </wsp:Policy>
+</wsdl:definitions>
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbds1602/jb/SampleWS.wsdl
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbds1602/jb/SampleWS.wsdl 2011-06-08
11:28:06 UTC (rev 31910)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbds1602/jb/SampleWS.wsdl 2011-06-08
12:41:28 UTC (rev 31911)
@@ -7,12 +7,12 @@
<xs:element name="echoResponse" type="tns:echoResponse"/>
<xs:complexType name="echo">
<xs:sequence>
-<xs:element minOccurs="0" name="arg0"
type="ns1:someType"/>
+<xs:element name="arg0" type="ns1:someType"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="echoResponse">
<xs:sequence>
-<xs:element minOccurs="0" name="return"
type="ns1:someType"/>
+<xs:element name="return" type="ns1:someType"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
@@ -39,14 +39,14 @@
<xs:sequence>
<xs:element ref="ns1:A"/>
<xs:element ref="ns2:B"/>
-<xs:element minOccurs="0" ref="ns5:OtherType"/>
+<xs:element ref="ns5:OtherType"/>
</xs:sequence>
<xs:attribute ref="ns3:C" use="required"/>
<xs:attribute ref="ns4:D" use="required"/>
</xs:complexType>
<xs:complexType name="otherType">
<xs:sequence>
-<xs:element minOccurs="0" ref="ns2:description"/>
+<xs:element ref="ns2:description"/>
</xs:sequence>
<xs:attribute ref="ns6:myid"/>
<xs:attribute ref="ns3:Y" use="required"/>
Added: trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/soap12/EnumTest.wsdl
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/soap12/EnumTest.wsdl
(rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/soap12/EnumTest.wsdl 2011-06-08
12:41:28 UTC (rev 31911)
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions
+
xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
+
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:tns="http://enumtest/"
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.xmlsoap.org/wsdl/"
+
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ targetNamespace="http://enumtest/" name="EnumTest">
+ <types>
+ <xsd:schema>
+ <xsd:import namespace="http://enumtest/"
schemaLocation="EnumTest.xsd" />
+ </xsd:schema>
+ </types>
+ <message name="hello">
+ <part name="parameters" element="tns:hello" />
+ </message>
+ <message name="helloResponse">
+ <part name="parameters" element="tns:helloResponse" />
+ </message>
+ <portType name="EnumTest">
+ <operation name="hello">
+ <input wsam:Action="http://EnumTest/EnumTest/helloRequest"
+ message="tns:hello" />
+ <output wsam:Action="http://enumtest/EnumTest/helloResponse"
+ message="tns:helloResponse" />
+ </operation>
+ </portType>
+ <binding name="EnumTestPortBinding" type="tns:EnumTest">
+ <soap:binding
transport="http://schemas.xmlsoap.org/soap/http"
style="document"/>
+ <operation name="hello">
+ <soap:operation
soapAction="http://localhost:8080/soapAction"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <binding name="EnumTest12PortBinding" type="tns:EnumTest">
+ <soap12:binding
transport="http://schemas.xmlsoap.org/soap/http"
style="document" />
+ <operation name="hello">
+ <soap12:operation
soapAction="http://localhost:8081/soap12Action" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ </binding>
+ <service name="EnumTest">
+ <port name="EnumTestPort"
binding="tns:EnumTestPortBinding">
+ <soap:address location="http://localhost:8080/A/EnumTest"/>
+ </port>
+ <port name="EnumTest12Port"
binding="tns:EnumTest12PortBinding">
+ <soap12:address location="http://localhost:8081/A/EnumTest"
/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Added: trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/soap12/EnumTest.xsd
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/soap12/EnumTest.xsd
(rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/soap12/EnumTest.xsd 2011-06-08
12:41:28 UTC (rev 31911)
@@ -0,0 +1,48 @@
+<?xml version='1.0' encoding='UTF-8'?><!-- Published by JAX-WS
RI at
http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2.1-hudson-28-. -->
+<xs:schema xmlns:tns="http://enumtest/"
xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0"
targetNamespace="http://enumtest/">
+
+ <xs:element name="hello" type="tns:hello" />
+
+ <xs:element name="helloResponse" type="tns:helloResponse"
/>
+
+ <xs:complexType name="hello">
+ <xs:sequence>
+ <xs:element name="arg0" type="tns:someType" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="someType">
+ <xs:sequence>
+ <xs:element name="en" type="tns:someEnum" />
+ <xs:element name="email" type="tns:email" />
+ <xs:element name="choice" type="tns:someChoice" />
+ </xs:sequence>
+
+ </xs:complexType>
+
+ <xs:complexType name="helloResponse">
+ <xs:sequence>
+ <xs:element name="return" type="tns:someType" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:simpleType name="someEnum">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="CZ" />
+ <xs:enumeration value="UK" />
+ <xs:enumeration value="US" />
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="email">
+ <xs:restriction base="xs:string">
+ <xs:pattern
value="([a-zA-Z0-9_\-])([a-zA-Z0-9_\-\.]*)@(\[((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}|((([a-zA-Z0-9\-]+)\.)+))([a-zA-Z]{2,}|(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\])"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:complexType name="someChoice">
+ <xs:choice>
+ <xs:element name="optionA"
type="xs:string"></xs:element>
+ <xs:element name="optionB"
type="xs:string"></xs:element>
+ </xs:choice>
+ </xs:complexType>
+</xs:schema>
\ No newline at end of file
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-06-08
11:28:06 UTC (rev 31910)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.test/src/org/jboss/tools/ws/ui/test/utils/TesterWSDLUtilsTest.java 2011-06-08
12:41:28 UTC (rev 31911)
@@ -19,6 +19,7 @@
import junit.framework.TestCase;
+import org.eclipse.core.runtime.IStatus;
import org.jboss.tools.ws.ui.utils.SchemaUtils;
import org.jboss.tools.ws.ui.utils.TesterWSDLUtils;
import org.junit.Assert;
@@ -27,8 +28,19 @@
public class TesterWSDLUtilsTest extends TestCase {
@Test
+ public void testIsWSDLAccessible() throws Exception {
+ URL u =
TesterWSDLUtilsTest.class.getResource("/jbide6558/x.wsdl").toURI().toURL();
+ IStatus st = TesterWSDLUtils.isWSDLAccessible(u);
+ Assert.assertEquals(IStatus.OK, st.getSeverity());
+
+ st = TesterWSDLUtils.isWSDLAccessible(new
URL("http://https.ax.com/a.wsdl"));
+ Assert.assertEquals(IStatus.ERROR, st.getSeverity());
+ }
+
+
+ @Test
public void testGetNSServiceNameAndMessageNameArray() {
- Definition def = readWSDL("/jbide6558/x.wsdl");
+ Definition def = readWSDL("/jbide6558/", "x.wsdl");
String[] r = TesterWSDLUtils.getNSServiceNameAndMessageNameArray(def,
"HelloWorldService", "HelloWorldPort", "HelloWorldBinding",
"sayHello");
Assert.assertArrayEquals(new String[]
{"http://webservices.samples.jboss.org/", "HelloWorldService",
"HelloWorldPort"}, r);
@@ -46,12 +58,19 @@
String r = TesterWSDLUtils.getEndpointURL(def, "HelloWorldService",
"HelloWorldPort", "HelloWorldBinding", "sayHello");
Assert.assertEquals("http://localhost:8080/ws/HelloWorld", r);
- def = readWSDL("/jbide6593/original.wsdl");
+ def = readWSDL("/jbide6593/", "original.wsdl");
r = TesterWSDLUtils.getEndpointURL(def, "gsearch_rss",
"gsearch_rssSoap", "gsearch_rssSoap", "GetSearchResults");
Assert.assertEquals("http://www.ecubicle.net/gsearch_rss.asmx", r);
r = TesterWSDLUtils.getEndpointURL(def, "EchoService", "EchoPort",
"EchoPortBinding", "echo");
Assert.assertEquals("http://localhost:8080/webws/EchoPortType", r);
+
+ def = readWSDL("/soap12/EnumTest.wsdl");
+ r = TesterWSDLUtils.getEndpointURL(def, "EnumTest", "EnumTestPort",
"EnumTestPortBinding", "hello");
+ Assert.assertEquals("http://localhost:8080/A/EnumTest", r);
+
+ r = TesterWSDLUtils.getEndpointURL(def, "EnumTest",
"EnumTest12Port", "EnumTest12PortBinding", "hello");
+ Assert.assertEquals("http://localhost:8081/A/EnumTest", r);
}
@Test
@@ -66,6 +85,13 @@
r = TesterWSDLUtils.getActionURL(def, "EchoService", "EchoPort",
"EchoPortBinding", "echo");
Assert.assertEquals("", r);
+
+ def = readWSDL("/soap12/EnumTest.wsdl");
+ r = TesterWSDLUtils.getActionURL(def, "EnumTest", "EnumTestPort",
"EnumTestPortBinding", "hello");
+ Assert.assertEquals("http://localhost:8080/soapAction", r);
+
+ r = TesterWSDLUtils.getActionURL(def, "EnumTest", "EnumTest12Port",
"EnumTest12PortBinding", "hello");
+ Assert.assertEquals("http://localhost:8081/soap12Action", r);
}
@Test
@@ -161,8 +187,12 @@
}
private Definition readWSDL(String path) {
+ return readWSDL(path, "");
+ }
+
+ private Definition readWSDL(String path, String file) {
try {
- URL url = SchemaUtils.class.getResource(path).toURI().toURL();
+ URL url = TesterWSDLUtilsTest.class.getResource(path + file).toURI().toURL();
return SchemaUtils.readWSDLURL(url);
} catch (MalformedURLException e) {
e.printStackTrace();