Author: jlukas(a)redhat.com
Date: 2010-07-08 05:48:23 -0400 (Thu, 08 Jul 2010)
New Revision: 23307
Added:
trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/
trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6497/
trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6497/imported.wsdl
trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6497/original.wsdl
trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6497/schema.xsd
trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6558/
trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6558/x.wsdl
trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6558/y.wsdl
trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6593/
trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6593/imported.wsdl
trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6593/original.wsdl
trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6593/schema.xsd
trunk/ws/tests/org.jboss.tools.ws.ui.test/src/org/jboss/tools/ws/ui/test/utils/
trunk/ws/tests/org.jboss.tools.ws.ui.test/src/org/jboss/tools/ws/ui/test/utils/TesterWSDLUtilsTest.java
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.test/.classpath
trunk/ws/tests/org.jboss.tools.ws.ui.test/META-INF/MANIFEST.MF
Log:
test for sample soap message generation
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.test/.classpath
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.test/.classpath 2010-07-08 08:44:14 UTC (rev
23306)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.test/.classpath 2010-07-08 09:48:23 UTC (rev
23307)
@@ -1,7 +1,8 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="resources"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.test/META-INF/MANIFEST.MF 2010-07-08 08:44:14 UTC
(rev 23306)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.test/META-INF/MANIFEST.MF 2010-07-08 09:48:23 UTC
(rev 23307)
@@ -10,7 +10,8 @@
org.jboss.tools.tests,
org.jboss.tools.ws.ui,
org.jboss.tools.ws.core,
- org.jboss.tools.common.ui
+ org.jboss.tools.common.ui,
+ javax.wsdl;bundle-version="1.6.2"
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %Bundle-Vendor.0
Bundle-Localization: plugin
Added: trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6497/imported.wsdl
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6497/imported.wsdl
(rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6497/imported.wsdl 2010-07-08
09:48:23 UTC (rev 23307)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="no"?>
+<definitions
xmlns:tns="http://www.ecubicle.net/webservices"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://www.ecubicle.net/webservices">
+ <types>
+ <xsd:schema>
+ <xsd:import
namespace="http://www.ecubicle.net/webservices"
schemaLocation="schema.xsd"/>
+ </xsd:schema>
+ </types>
+ <message name="GetSearchResults">
+ <part name="parameters" element="tns:GetSearchResults"/>
+ </message>
+ <message name="GetSearchResultsResponse">
+ <part name="parameters"
element="tns:GetSearchResultsResponse"/>
+ </message>
+ <portType name="gsearch_rssSoap">
+ <operation name="GetSearchResults">
+ <input message="tns:GetSearchResults"/>
+ <output message="tns:GetSearchResultsResponse"/>
+ </operation>
+ </portType>
+</definitions>
\ No newline at end of file
Added: trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6497/original.wsdl
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6497/original.wsdl
(rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6497/original.wsdl 2010-07-08
09:48:23 UTC (rev 23307)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-w...
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://webservices.www.ecubicle.net/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://webservices.www.ecubicle.net/"
name="GsearchRssSoap">
+ <import
namespace="http://www.ecubicle.net/webservices"
location="imported.wsdl"/>
+ <binding
xmlns:ns1="http://www.ecubicle.net/webservices"
name="gsearch_rssSoap" type="ns1:gsearch_rssSoap">
+ <soap:binding
transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="GetSearchResults">
+ <soap:operation
soapAction="http://www.ecubicle.net/webservices/GetSearchResults"
style="document"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="gsearch_rss">
+ <port name="gsearch_rssSoap" binding="tns:gsearch_rssSoap">
+ <soap:address
location="http://www.ecubicle.net/gsearch_rss.asmx"/>
+ </port>
+ </service>
+</definitions>
+<!-- <?xml version="1.0" encoding="utf-8"
standalone="yes" ?> <soap:Envelope
+
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema" > <soap:Body>
<GetSearchResults
+ xmlns = "http://webservices.www.ecubicle.net/">
<searchPage></searchPage>
+ <gQuery>JBoss Web Services</gQuery>
<numOfResults></numOfResults> </GetSearchResults>
+ </soap:Body> </soap:Envelope>
+ -->
\ No newline at end of file
Added: trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6497/schema.xsd
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6497/schema.xsd
(rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6497/schema.xsd 2010-07-08
09:48:23 UTC (rev 23307)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" version="1.0"
targetNamespace="http://www.ecubicle.net/webservices">
+
+ <xs:element name="GetSearchResults">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="searchPage" type="xs:string"
minOccurs="0"/>
+ <xs:element name="gQuery" type="xs:string"
minOccurs="0"/>
+ <xs:element name="numOfResults" type="xs:string"
minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="GetSearchResultsResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="GetSearchResultsResult" minOccurs="0">
+ <xs:complexType mixed="true">
+ <xs:sequence>
+ <xs:any processContents="lax" namespace="##other"
minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+</xs:schema>
\ No newline at end of file
Added: trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6558/x.wsdl
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6558/x.wsdl
(rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6558/x.wsdl 2010-07-08
09:48:23 UTC (rev 23307)
@@ -0,0 +1,53 @@
+<definitions name='HelloWorldService'
targetNamespace='http://webservices.samples.jboss.org/'
+
xmlns='http://schemas.xmlsoap.org/wsdl/'
xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
+
xmlns:tns='http://webservices.samples.jboss.org/'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types>
+ <xs:schema
targetNamespace='http://webservices.samples.jboss.org/'
+ version='1.0'
xmlns:tns='http://webservices.samples.jboss.org/'
+
xmlns:xs='http://www.w3.org/2001/XMLSchema'>
+ <xs:element name='sayHello'>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs='0' name='arg0' type='xs:string'
/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name='sayHelloResponse' type='tns:sayHelloResponse'
/>
+ <xs:complexType name='sayHelloResponse'>
+ <xs:sequence>
+ <xs:element minOccurs='0' name='return' type='xs:string'
/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:schema>
+ </types>
+ <message name='HelloWorld_sayHello'>
+ <part element='tns:sayHello' name='sayHello'></part>
+ </message>
+ <message name='HelloWorld_sayHelloResponse'>
+ <part element='tns:sayHelloResponse'
name='sayHelloResponse'></part>
+ </message>
+ <portType name='HelloWorld'>
+ <operation name='sayHello' parameterOrder='sayHello'>
+ <input message='tns:HelloWorld_sayHello'></input>
+ <output message='tns:HelloWorld_sayHelloResponse'></output>
+ </operation>
+ </portType>
+ <binding name='HelloWorldBinding' type='tns:HelloWorld'>
+ <soap:binding style='document'
+
transport='http://schemas.xmlsoap.org/soap/http' />
+ <operation name='sayHello'>
+ <soap:operation soapAction='' />
+ <input>
+ <soap:body use='literal' />
+ </input>
+ <output>
+ <soap:body use='literal' />
+ </output>
+ </operation>
+ </binding>
+ <service name='HelloWorldService'>
+ <port binding='tns:HelloWorldBinding' name='HelloWorldPort'>
+ <soap:address location='http://localhost:8080/ws/HelloWorld' />
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Added: trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6558/y.wsdl
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6558/y.wsdl
(rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6558/y.wsdl 2010-07-08
09:48:23 UTC (rev 23307)
@@ -0,0 +1,52 @@
+<definitions name='HelloWorldService'
targetNamespace='http://webservices.samples.jboss.org/'
+
xmlns='http://schemas.xmlsoap.org/wsdl/'
xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
+
xmlns:tns='http://webservices.samples.jboss.org/'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types>
+ <xs:schema
targetNamespace='http://webservices.samples.jboss.org/'
+ version='1.0'
xmlns:tns='http://webservices.samples.jboss.org/'
+
xmlns:xs='http://www.w3.org/2001/XMLSchema'>
+ <xs:element name='sayHello' type="tns:sayHello"/>
+ <xs:element name='sayHelloResponse' type='tns:sayHelloResponse'
/>
+ <xs:complexType name='sayHello'>
+ <xs:sequence>
+ <xs:element minOccurs='0' name='arg0' type='xs:string'
/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name='sayHelloResponse'>
+ <xs:sequence>
+ <xs:element minOccurs='0' name='return' type='xs:string'
/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:schema>
+ </types>
+ <message name='HelloWorld_sayHello'>
+ <part element='tns:sayHello' name='sayHello'></part>
+ </message>
+ <message name='HelloWorld_sayHelloResponse'>
+ <part element='tns:sayHelloResponse'
name='sayHelloResponse'></part>
+ </message>
+ <portType name='HelloWorld'>
+ <operation name='sayHello' parameterOrder='sayHello'>
+ <input message='tns:HelloWorld_sayHello'></input>
+ <output message='tns:HelloWorld_sayHelloResponse'></output>
+ </operation>
+ </portType>
+ <binding name='HelloWorldBinding' type='tns:HelloWorld'>
+ <soap:binding style='document'
+
transport='http://schemas.xmlsoap.org/soap/http' />
+ <operation name='sayHello'>
+ <soap:operation soapAction='' />
+ <input>
+ <soap:body use='literal' />
+ </input>
+ <output>
+ <soap:body use='literal' />
+ </output>
+ </operation>
+ </binding>
+ <service name='HelloWorldService'>
+ <port binding='tns:HelloWorldBinding' name='HelloWorldPort'>
+ <soap:address location='http://localhost:8080/ws/HelloWorld' />
+ </port>
+ </service>
+</definitions>
Added: trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6593/imported.wsdl
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6593/imported.wsdl
(rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6593/imported.wsdl 2010-07-08
09:48:23 UTC (rev 23307)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="no"?>
+<definitions
xmlns:tns="http://www.ecubicle.net/webservices"
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.xmlsoap.org/wsdl/"
+
targetNamespace="http://www.ecubicle.net/webservices">
+ <types>
+ <xsd:schema>
+ <xsd:import
namespace="http://www.ecubicle.net/webservices"
+ schemaLocation="schema.xsd" />
+ </xsd:schema>
+ </types>
+ <message name="GetSearchResults">
+ <part name="parameters" element="tns:GetSearchResults" />
+ </message>
+ <message name="GetSearchResultsResponse">
+ <part name="parameters" element="tns:GetSearchResultsResponse"
/>
+ </message>
+ <portType name="gsearch_rssSoap">
+ <operation name="GetSearchResults">
+ <input message="tns:GetSearchResults" />
+ <output message="tns:GetSearchResultsResponse" />
+ </operation>
+ </portType>
+</definitions>
\ No newline at end of file
Added: trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6593/original.wsdl
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6593/original.wsdl
(rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6593/original.wsdl 2010-07-08
09:48:23 UTC (rev 23307)
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-w...
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+
xmlns:tns="http://webservices.www.ecubicle.net/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:jb="http://test.jboss.org/ns"
+
targetNamespace="http://webservices.www.ecubicle.net/"
name="GsearchRssSoap">
+ <import
namespace="http://www.ecubicle.net/webservices"
location="imported.wsdl" />
+ <types>
+ <xsd:schema elementFormDefault='qualified'
targetNamespace='http://test.jboss.org/ns' version='1.0'
xmlns:tns='http://test.jboss.org/ns'>
+ <xsd:element name="echo" type="tns:echo" />
+ <xsd:element name="echoResponse" type="tns:echoResponse" />
+ <xsd:complexType name="echo">
+ <xsd:sequence>
+ <xsd:element name="p" type="tns:person"
minOccurs="1" />
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:complexType name="person">
+ <xsd:sequence>
+ <xsd:element name="age" type="xsd:int" />
+ <xsd:element name="login" type="xsd:string"
minOccurs="1" />
+ <xsd:element name="male" type="xsd:boolean" />
+ <xsd:element name="nicks" type="xsd:string"
nillable="false" minOccurs="1" maxOccurs="2" />
+ <xsd:element name="tax" type="xsd:float" />
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:complexType name="echoResponse">
+ <xsd:sequence>
+ <xsd:element name="return" type="tns:person"
minOccurs="1" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:schema>
+ </types>
+ <message name="echo">
+ <part name="parameters" element="jb:echo" />
+ </message>
+ <message name="echoResponse">
+ <part name="parameters" element="jb:echoResponse" />
+ </message>
+ <portType name="EchoPortType">
+ <operation name="echo">
+ <input message="tns:echo" />
+ <output message="tns:echoResponse" />
+ </operation>
+ </portType>
+ <binding
xmlns:ns1="http://www.ecubicle.net/webservices"
name="gsearch_rssSoap" type="ns1:gsearch_rssSoap">
+ <soap:binding
transport="http://schemas.xmlsoap.org/soap/http" />
+ <operation name="GetSearchResults">
+ <soap:operation
soapAction="http://www.ecubicle.net/webservices/GetSearchResults"
style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ </binding>
+ <binding name="EchoPortBinding" type="tns:EchoPortType">
+ <soap:binding
transport="http://schemas.xmlsoap.org/soap/http"
style="document" />
+ <operation name="echo">
+ <soap:operation soapAction="" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ </binding>
+ <service name="gsearch_rss">
+ <port name="gsearch_rssSoap" binding="tns:gsearch_rssSoap">
+ <soap:address
location="http://www.ecubicle.net/gsearch_rss.asmx" />
+ </port>
+ </service>
+ <service name="EchoService">
+ <port name="EchoPort" binding="tns:EchoPortBinding">
+ <soap:address location="http://localhost:8080/webws/EchoPortType" />
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Added: trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6593/schema.xsd
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6593/schema.xsd
(rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6593/schema.xsd 2010-07-08
09:48:23 UTC (rev 23307)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified" version="1.0"
+
targetNamespace="http://www.ecubicle.net/webservices">
+
+ <xs:element name="GetSearchResults">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="searchPage" type="xs:string"
minOccurs="0" />
+ <xs:element name="gQuery" type="xs:string"
minOccurs="0" />
+ <xs:element name="numOfResults" type="xs:string"
+ minOccurs="0" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="GetSearchResultsResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="GetSearchResultsResult" minOccurs="0">
+ <xs:complexType mixed="true">
+ <xs:sequence>
+ <xs:any processContents="lax" namespace="##other"
+ minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+</xs:schema>
Added:
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
(rev 0)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.test/src/org/jboss/tools/ws/ui/test/utils/TesterWSDLUtilsTest.java 2010-07-08
09:48:23 UTC (rev 23307)
@@ -0,0 +1,121 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.ws.ui.test.utils;
+
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+import javax.wsdl.Definition;
+import javax.wsdl.WSDLException;
+
+import org.jboss.tools.ws.ui.utils.TesterWSDLUtils;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class TesterWSDLUtilsTest {
+
+ @Test
+ public void testGetNSServiceNameAndMessageNameArray() {
+ 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);
+
+ def = readWSDL("/jbide6593/original.wsdl");
+ r = TesterWSDLUtils.getNSServiceNameAndMessageNameArray(def, "gsearch_rss",
"gsearch_rssSoap", "gsearch_rssSoap", "GetSearchResults");
+ Assert.assertArrayEquals(new String[] {"http://www.ecubicle.net/webservices",
"gsearch_rss", "gsearch_rssSoap"}, r);
+
+ r = TesterWSDLUtils.getNSServiceNameAndMessageNameArray(def, "EchoService",
"EchoPort", "EchoPortBinding", "echo");
+ Assert.assertArrayEquals(new String[]
{"http://webservices.www.ecubicle.net/", "EchoService",
"EchoPort"}, r);
+ }
+
+ @Test
+ public void testGetEndpointURL() {
+ Definition def = readWSDL("/jbide6558/x.wsdl");
+ String r = TesterWSDLUtils.getEndpointURL(def, "HelloWorldService",
"HelloWorldPort", "HelloWorldBinding", "sayHello");
+ Assert.assertEquals("http://localhost:8080/ws/HelloWorld", r);
+
+ 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);
+ }
+
+ @Test
+ public void testGetActionURL() {
+ Definition def = readWSDL("/jbide6558/x.wsdl");
+ String r = TesterWSDLUtils.getActionURL(def, "HelloWorldService",
"HelloWorldPort", "HelloWorldBinding", "sayHello");
+ Assert.assertEquals("", r);
+
+ def = readWSDL("/jbide6593/original.wsdl");
+ r = TesterWSDLUtils.getActionURL(def, "gsearch_rss",
"gsearch_rssSoap", "gsearch_rssSoap", "GetSearchResults");
+
Assert.assertEquals("http://www.ecubicle.net/webservices/GetSearchRe...;,
r);
+
+ r = TesterWSDLUtils.getActionURL(def, "EchoService", "EchoPort",
"EchoPortBinding", "echo");
+ Assert.assertEquals("", r);
+ }
+
+ @Test
+ public void testJBIDE6497() {
+ String s1 = getSampleMessage("/jbide6497/original.wsdl",
"gsearch_rss", "gsearch_rssSoap", "gsearch_rssSoap",
"GetSearchResults");
+ Assert.assertTrue("was: '" + s1, s1.contains("<GetSearchResults
xmlns = \"http://www.ecubicle.net/webservices\">"));
+ Assert.assertTrue("was: '" + s1,
s1.contains("<gQuery>?</gQuery>"));
+
+ s1 = getSampleMessage("/jbide6593/original.wsdl", "EchoService",
"EchoPort", "EchoPortBinding", "echo");
+ Assert.assertTrue("was: '" + s1,
s1.contains("<p><age>?</age>"));
+ Assert.assertTrue("was: '" + s1,
s1.contains("<male>?</male>"));
+ Assert.assertTrue("was: '" + s1,
s1.contains("<tax>?</tax>"));
+ Assert.assertTrue("was: '" + s1, s1.contains("<echo xmlns =
\"http://test.jboss.org/ns\">"));
+ }
+
+ @Test
+ public void testJBIDE6558() {
+ String s1 = getSampleMessage("/jbide6558/x.wsdl",
"HelloWorldService", "HelloWorldPort", "HelloWorldBinding",
"sayHello");
+ Assert.assertTrue(s1.contains("xmlns =
\"http://webservices.samples.jboss.org/\""));
+ Assert.assertTrue(s1.contains("<arg0>?</arg0>"));
+ String s2 = getSampleMessage("/jbide6558/y.wsdl",
"HelloWorldService", "HelloWorldPort", "HelloWorldBinding",
"sayHello");
+ Assert.assertEquals(s1, s2);
+ }
+
+ @Test
+ public void testJBIDE6593() {
+ String s1 = getSampleMessage("/jbide6497/original.wsdl",
"gsearch_rss", "gsearch_rssSoap", "gsearch_rssSoap",
"GetSearchResults");
+ Assert.assertTrue(s1.contains("<GetSearchResults xmlns =
\"http://www.ecubicle.net/webservices\">"));
+ Assert.assertTrue(s1.contains("<gQuery>?</gQuery>"));
+
+ String s2 = getSampleMessage("/jbide6593/original.wsdl",
"gsearch_rss", "gsearch_rssSoap", "gsearch_rssSoap",
"GetSearchResults");
+ Assert.assertEquals(s1, s2);
+ }
+
+ private String getSampleMessage(String res, String service, String port, String binding,
String operation) {
+ Definition def = readWSDL(res);
+ return TesterWSDLUtils.getSampleSOAPInputMessage(def, service, port, binding,
operation);
+ }
+
+ private Definition readWSDL(String path) {
+ try {
+ URL url = TesterWSDLUtilsTest.class.getResource(path).toURI().toURL();
+ return TesterWSDLUtils.readWSDLURL(url);
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ Assert.fail(e.getMessage());
+ } catch (URISyntaxException e) {
+ e.printStackTrace();
+ Assert.fail(e.getMessage());
+ } catch (WSDLException e) {
+ e.printStackTrace();
+ Assert.fail(e.getMessage());
+ }
+ return null;
+ }
+}