[jbosstools-commits] JBoss Tools SVN: r23667 - in trunk/ws/tests/org.jboss.tools.ws.ui.test: src/org/jboss/tools/ws/ui/test/utils and 1 other directory.
jbosstools-commits at lists.jboss.org
jbosstools-commits at lists.jboss.org
Thu Jul 22 10:07:44 EDT 2010
Author: jlukas at redhat.com
Date: 2010-07-22 10:07:44 -0400 (Thu, 22 Jul 2010)
New Revision: 23667
Added:
trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6694.wsdl
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.test/src/org/jboss/tools/ws/ui/test/utils/TesterWSDLUtilsTest.java
Log:
test for JBIDE-6694
Added: trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6694.wsdl
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6694.wsdl (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.test/resources/jbide6694.wsdl 2010-07-22 14:07:44 UTC (rev 23667)
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://test.jboss.org/ns" xmlns:s="http://www.w3.org/2001/XMLSchema" targetNamespace="http://test.jboss.org/ns" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+ <wsdl:types>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://test.jboss.org/ns">
+ <s:element name="ChangeUnit">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="value" type="s:double" />
+ <s:element minOccurs="1" maxOccurs="1" name="fromUnit" type="tns:Units" />
+ <s:element minOccurs="1" maxOccurs="1" name="toUnit" type="tns:Units" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:simpleType name="Units">
+ <s:restriction base="s:string">
+ <s:enumeration value="kilometer" />
+ <s:enumeration value="meter" />
+ </s:restriction>
+ </s:simpleType>
+ <s:element name="ChangeUnitResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="ChangeUnitResult" type="s:double" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="double" type="s:double" />
+ </s:schema>
+ </wsdl:types>
+ <wsdl:message name="ChangeUnitIn">
+ <wsdl:part name="parameters" element="tns:ChangeUnit" />
+ </wsdl:message>
+ <wsdl:message name="ChangeUnitOut">
+ <wsdl:part name="parameters" element="tns:ChangeUnitResponse" />
+ </wsdl:message>
+ <wsdl:portType name="ConverterPortType">
+ <wsdl:operation name="convert">
+ <wsdl:input message="tns:ChangeUnitIn" />
+ <wsdl:output message="tns:ChangeUnitOut" />
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="ConverterBinding" type="tns:ConverterPortType">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="convert">
+ <soap:operation soapAction="" style="document" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="Converter">
+ <wsdl:port name="ConverterPort" binding="tns:ConverterBinding">
+ <soap:address location="" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
\ 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 2010-07-22 13:53:14 UTC (rev 23666)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.test/src/org/jboss/tools/ws/ui/test/utils/TesterWSDLUtilsTest.java 2010-07-22 14:07:44 UTC (rev 23667)
@@ -1,12 +1,12 @@
-/*******************************************************************************
- * 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
+/*******************************************************************************
+ * 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;
@@ -28,7 +28,7 @@
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);
@@ -46,7 +46,7 @@
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);
}
@@ -75,9 +75,9 @@
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\">"));
- }
-
+ 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");
@@ -86,7 +86,7 @@
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");
@@ -97,11 +97,20 @@
Assert.assertEquals(s1, s2);
}
+ @Test
+ public void testJBIDE6694() {
+ String s1 = getSampleMessage("/jbide6694.wsdl", "Converter", "ConverterPort", "ConverterBinding", "convert");
+ Assert.assertTrue(s1.contains("<ChangeUnit xmlns = \"http://test.jboss.org/ns\">"));
+ Assert.assertTrue(s1.contains("<value>?</value>"));
+ Assert.assertTrue(s1.contains("<fromUnit>?</fromUnit>"));
+ Assert.assertTrue(s1.contains("<toUnit>?</toUnit>"));
+ }
+
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();
More information about the jbosstools-commits
mailing list