Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'tests/org.eclipse.wst.wsdl.tests')
-rw-r--r--tests/org.eclipse.wst.wsdl.tests/.classpath7
-rw-r--r--tests/org.eclipse.wst.wsdl.tests/.cvsignore4
-rw-r--r--tests/org.eclipse.wst.wsdl.tests/.project28
-rw-r--r--tests/org.eclipse.wst.wsdl.tests/about.html34
-rw-r--r--tests/org.eclipse.wst.wsdl.tests/plugin.xml26
-rw-r--r--tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/LoadsNamelessDefinition/MissingName.wsdl3
-rw-r--r--tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/LoadsNamelessDefinition/WithName.wsdl3
-rw-r--r--tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/LocalNamespace/LocalNamespace.wsdl59
-rw-r--r--tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/OperationStyle/OperationStyleTest.wsdl120
-rw-r--r--tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/TypeAndElementResolution/Test.wsdl31
-rw-r--r--tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/TypeAndElementResolution/Test1.xsd5
-rw-r--r--tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/TypeAndElementResolution/Test2.xsd12
-rw-r--r--tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/WSDLElementResolution/firstlevel.wsdl7
-rw-r--r--tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/WSDLElementResolution/main.wsdl24
-rw-r--r--tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/WSDLElementResolution/secondlevel.wsdl22
-rw-r--r--tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/AllTestCases.java50
-rw-r--r--tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/MyResolver.java33
-rw-r--r--tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/ParserTest.java73
-rw-r--r--tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/RefactoringTest.java230
-rw-r--r--tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/WSDLGenerationTest.java267
-rw-r--r--tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/WSDLTestsPlugin.java109
-rw-r--r--tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/util/DefinitionLoader.java107
-rw-r--r--tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/util/DefinitionVisitor.java211
-rw-r--r--tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/util/WSDL4JDefinitionVisitor.java223
-rw-r--r--tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/util/WSDLConverter.java608
-rw-r--r--tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/util/WSDLModelLocatorAdapterFactory.java46
-rw-r--r--tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/util/XMLDiff.java169
-rw-r--r--tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/util/XSDSchemaLocationResolverAdapterFactory.java31
-rw-r--r--tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/util/XSDSchemaLocationResolverImpl.java31
-rw-r--r--tests/org.eclipse.wst.wsdl.tests/test.xml53
30 files changed, 0 insertions, 2626 deletions
diff --git a/tests/org.eclipse.wst.wsdl.tests/.classpath b/tests/org.eclipse.wst.wsdl.tests/.classpath
deleted file mode 100644
index 751c8f2e5..000000000
--- a/tests/org.eclipse.wst.wsdl.tests/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/tests/org.eclipse.wst.wsdl.tests/.cvsignore b/tests/org.eclipse.wst.wsdl.tests/.cvsignore
deleted file mode 100644
index 8b5249c38..000000000
--- a/tests/org.eclipse.wst.wsdl.tests/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-bin
-build.xml
-temp.folder
-wsdl.tests.jar
diff --git a/tests/org.eclipse.wst.wsdl.tests/.project b/tests/org.eclipse.wst.wsdl.tests/.project
deleted file mode 100644
index 9813a74cc..000000000
--- a/tests/org.eclipse.wst.wsdl.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.wsdl.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/tests/org.eclipse.wst.wsdl.tests/about.html b/tests/org.eclipse.wst.wsdl.tests/about.html
deleted file mode 100644
index 4ec598958..000000000
--- a/tests/org.eclipse.wst.wsdl.tests/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 2, 2006</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor’s license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/tests/org.eclipse.wst.wsdl.tests/plugin.xml b/tests/org.eclipse.wst.wsdl.tests/plugin.xml
deleted file mode 100644
index b1d9ed6f1..000000000
--- a/tests/org.eclipse.wst.wsdl.tests/plugin.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin
- id="org.eclipse.wst.wsdl.tests"
- name="WSDL JUnit Test"
- version="1.0.1"
- class="org.eclipse.wst.wsdl.tests.WSDLTestsPlugin">
-
- <runtime>
- <library name="wsdl.tests.jar">
- <export name="*"/>
- </library>
- </runtime>
-
- <requires>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.wst.wsdl"/>
- <import plugin="org.eclipse.emf.ecore"/>
- <import plugin="org.eclipse.xsd"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.junit"/>
- <import plugin="org.wsdl4j"/>
- <import plugin="org.eclipse.wst.common.uriresolver"/>
- </requires>
-
-</plugin>
diff --git a/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/LoadsNamelessDefinition/MissingName.wsdl b/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/LoadsNamelessDefinition/MissingName.wsdl
deleted file mode 100644
index 8e8c996ff..000000000
--- a/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/LoadsNamelessDefinition/MissingName.wsdl
+++ /dev/null
@@ -1,3 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
-</wsdl:definitions>
diff --git a/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/LoadsNamelessDefinition/WithName.wsdl b/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/LoadsNamelessDefinition/WithName.wsdl
deleted file mode 100644
index c909b513e..000000000
--- a/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/LoadsNamelessDefinition/WithName.wsdl
+++ /dev/null
@@ -1,3 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="WSDLFile">
-</wsdl:definitions>
diff --git a/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/LocalNamespace/LocalNamespace.wsdl b/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/LocalNamespace/LocalNamespace.wsdl
deleted file mode 100644
index a829b276c..000000000
--- a/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/LocalNamespace/LocalNamespace.wsdl
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<wsdl:definitions xmlns:tns="http://tempuri.org/Simple/"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Simple"
- targetNamespace="http://tempuri.org/Simple/">
-
- <wsdl:types>
-
- <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- targetNamespace="http://tempuri.org/Simple/">
-
- <xsd:element name="OperationInput">
-
- <xsd:complexType>
-
- <xsd:sequence>
- <xsd:element name="attribute1"
- type="xsd:string" />
- <xsd:element name="attribute2"
- type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="OperationOutput">
-
- <xsd:complexType>
-
- <xsd:sequence>
- <xsd:element name="attribute1"
- type="xsd:string" />
- <xsd:element name="attribute2"
- type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- </wsdl:types>
-
- <wsdl:message name="myOperationResponse">
- <wsdl:part name="myOperationResponse"
- element="tns:OperationOutput" />
- </wsdl:message>
-
- <wsdl:message name="myOperationRequest">
- <wsdl:part xmlns:parttns="http://tempuri.org/Simple/"
- name="myOperationRequest" element="parttns:OperationInput" />
- </wsdl:message>
-
- <wsdl:portType name="MyPortType">
-
- <wsdl:operation name="myOperation">
- <wsdl:input message="tns:myOperationRequest" />
- <wsdl:output message="tns:myOperationResponse" />
- </wsdl:operation>
- </wsdl:portType>
-
-</wsdl:definitions>
diff --git a/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/OperationStyle/OperationStyleTest.wsdl b/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/OperationStyle/OperationStyleTest.wsdl
deleted file mode 100644
index 506aec60d..000000000
--- a/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/OperationStyle/OperationStyleTest.wsdl
+++ /dev/null
@@ -1,120 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://example.org"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" name="OperationStyleTest" targetNamespace="http://example.org">
-
- <jaxws:bindings xmlns:jaxws="http://java.sun.com/xml/ns/jaxws">
- <jaxws:enableWrapperStyle>true</jaxws:enableWrapperStyle>
- <jaxws:enableAsyncMapping>false</jaxws:enableAsyncMapping>
- </jaxws:bindings>
-
- <types>
- <xsd:schema targetNamespace="http://example.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified" xmlns:tns="http://example.org">
-
- <xsd:element name="quoteRequest" type="tns:quoteRequestType" />
-
- <xsd:complexType name="quoteRequestType">
- <xsd:sequence>
- <xsd:element name="stockSymbol" type="xsd:int" />
- <xsd:element name="transactionDate" type="xsd:date" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:element name="quoteResponse" type="tns:quoteResponseType" />
-
- <xsd:complexType name="quoteResponseType">
- <xsd:sequence>
- <xsd:element name="value" type="xsd:double" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:element name="quoteError" type="xsd:string" />
-
- </xsd:schema>
- </types>
-
- <message name="Quote">
- <part name="params" element="tns:quoteRequest" />
- </message>
-
- <message name="QuoteResponse">
- <part name="result" element="tns:quoteResponse" />
- </message>
-
- <message name="QuoteError">
- <part name="error" element="tns:quoteError" />
- </message>
-
- <portType name="QuotePortType">
-
- <jaxws:bindings xmlns:jaxws="http://java.sun.com/xml/ns/jaxws">
- <jaxws:class name="QuoteProviderImpl" />
- <jaxws:enableWrapperStyle>true</jaxws:enableWrapperStyle>
- <jaxws:enableAsyncMapping>false</jaxws:enableAsyncMapping>
- </jaxws:bindings>
-
- <operation name="GetQuote">
-
- <jaxws:bindings xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
- <jaxws:method name="getQuote" />
- <jaxws:parameter part="wsdl:definitions/wsdl:message[@name='Quote']/wsdl:part[@name='params']"
- childElementName="tns:stockSymbol" name="symbol" />
- <jaxws:parameter part="wsdl:definitions/wsdl:message[@name='Quote']/wsdl:part[@name='params']"
- childElementName="tns:transactionDate" name="date" />
- <jaxws:enableWrapperStyle>true</jaxws:enableWrapperStyle>
- <jaxws:enableAsyncMapping>false</jaxws:enableAsyncMapping>
- </jaxws:bindings>
-
- <input message="tns:Quote" />
-
- <output message="tns:QuoteResponse" />
-
- <fault name="QuoteError" message="tns:QuoteError">
-
- <jaxws:bindings xmlns:jaxws="http://java.sun.com/xml/ns/jaxws">
- <jaxws:class name="QuoteException" />
- </jaxws:bindings>
-
- </fault>
- </operation>
- </portType>
-
- <binding name="QuoteBinding" type="tns:QuotePortType">
-
- <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
-
- <operation name="GetQuote">
- <soap:operation soapAction="" />
- <input>
- <soap:body use="literal" />
- </input>
- <output>
- <soap:body use="literal" />
- </output>
- <fault name="QuoteError">
- <soap:fault name="QuoteError" use="literal" />
- </fault>
- </operation>
-
- </binding>
-
- <service name="QuoteService">
-
- <jaxws:bindings xmlns:jaxws="http://java.sun.com/xml/ns/jaxws">
- <jaxws:class name="QuotationService" />
- </jaxws:bindings>
-
- <port name="QuotePort" binding="tns:QuoteBinding">
-
- <jaxws:bindings xmlns:jaxws="http://java.sun.com/xml/ns/jaxws">
- <jaxws:method name="getQuotationService" />
- </jaxws:bindings>
-
- <soap:address location="http://localhost:8080/quote" />
-
- </port>
-
- </service>
-
-</definitions>
diff --git a/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/TypeAndElementResolution/Test.wsdl b/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/TypeAndElementResolution/Test.wsdl
deleted file mode 100644
index 8dde88d30..000000000
--- a/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/TypeAndElementResolution/Test.wsdl
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<definitions name="TestService"
- targetNamespace="http://test.org/Service/"
- xmlns="http://schemas.xmlsoap.org/wsdl/"
- xmlns:tns="http://test.org/Service/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:test="http://test.org/">
- <types>
- <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <xs:import namespace="http://test.org/"
- schemaLocation="Test1.xsd" />
- </xs:schema>
- <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <xs:import namespace="http://test.org/"
- schemaLocation="Test2.xsd" />
- </xs:schema>
- </types>
- <message name="testRequest">
- <part name="requestPart" type="test:MyType" />
- </message>
- <message name="testResponse">
- <part name="responsePart" element="test:MyElement" />
- </message>
- <portType name="TestPort">
- <operation name="testOperation">
- <input message="tns:testRequest" name="testRequest" />
- <output message="tns:testResponse" name="testResponse" />
- </operation>
-
- </portType>
-</definitions>
diff --git a/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/TypeAndElementResolution/Test1.xsd b/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/TypeAndElementResolution/Test1.xsd
deleted file mode 100644
index 82c36aab7..000000000
--- a/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/TypeAndElementResolution/Test1.xsd
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://test.org/"
- xmlns:tns="http://test.org/">
-</schema>
diff --git a/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/TypeAndElementResolution/Test2.xsd b/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/TypeAndElementResolution/Test2.xsd
deleted file mode 100644
index e281a196e..000000000
--- a/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/TypeAndElementResolution/Test2.xsd
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://test.org/"
- xmlns:tns="http://test.org/">
-
- <element name="MyElement" type="string"></element>
-
- <simpleType name="MyType">
- <restriction base="string"></restriction>
- </simpleType>
-
-</schema>
diff --git a/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/WSDLElementResolution/firstlevel.wsdl b/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/WSDLElementResolution/firstlevel.wsdl
deleted file mode 100644
index fcb8dc11b..000000000
--- a/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/WSDLElementResolution/firstlevel.wsdl
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://www.example.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.com">
- <import location="secondlevel.wsdl" namespace="http://www.example.com"/>
- <message name="testINPUTmessage">
- <part name="testINpart" type="xsd:string"/>
- </message>
-</definitions>
diff --git a/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/WSDLElementResolution/main.wsdl b/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/WSDLElementResolution/main.wsdl
deleted file mode 100644
index b0a42a716..000000000
--- a/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/WSDLElementResolution/main.wsdl
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
- xmlns:tns="http://www.example.com"
- targetNamespace="http://www.example.com">
-
- <import location="firstlevel.wsdl" namespace="http://www.example.com"/>
-
- <portType name="TestPortType">
-
- <operation name="TestOperation">
-
- <!-- This is located in the first level import -->
-
- <input message="tns:testINPUTmessage"/>
-
- <!-- This is located in the second level import -->
-
- <output message="tns:testOUTPUTmessage"/>
-
- </operation>
-
- </portType>
-
-</definitions>
diff --git a/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/WSDLElementResolution/secondlevel.wsdl b/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/WSDLElementResolution/secondlevel.wsdl
deleted file mode 100644
index 6e2efd98f..000000000
--- a/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/WSDLElementResolution/secondlevel.wsdl
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
- xmlns:tns="http://www.example.com"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.example.com">
-
- <!-- Here to force a cyclic import to make sure the code does not go into an infinite recursion. -->
-
- <import location="main.wsdl" namespace="http://www.example.com"/>
-
- <message name="testOUTPUTmessage">
- <part name="testOUTpart" type="xsd:string"/>
- </message>
-
- <!-- Duplicated here to allow testing the imports tree traversal order.
- This message will be "masked" by the one declared in the firstlevel.wsdl -->
-
- <message name="testINPUTmessage">
- <part name="testINpart" type="xsd:int"/>
- </message>
-
-</definitions>
diff --git a/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/AllTestCases.java b/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/AllTestCases.java
deleted file mode 100644
index 0851bb2fa..000000000
--- a/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/AllTestCases.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.tests;
-
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-/**
- * @author Kihup Boo
- */
-public class AllTestCases extends TestCase
-{
-
- public AllTestCases()
- {
- }
-
- public static void main(String[] args)
- {
- }
-
- public static Test suite()
- {
- TestSuite suite = new TestSuite();
-
- // Bug 123547 - comment out this test for now.
- // suite.addTest(InlineSchemaTest.suite());
- suite.addTest(LoadAndSerializationTest.suite());
- suite.addTest(SemanticTest.suite());
- suite.addTest(WSDLGenerationTest.suite());
- suite.addTest(WSDL4JAPITest.suite());
- suite.addTest(WSDLEMFAPITest.suite());
- suite.addTest(UtilTest.suite());
- suite.addTest(BugFixesTest.suite());
- suite.addTest(LocationTrackingTest.suite());
-
- return suite;
- }
-
-}
diff --git a/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/MyResolver.java b/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/MyResolver.java
deleted file mode 100644
index 4ccaa4dab..000000000
--- a/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/MyResolver.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.tests;
-
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-
-public class MyResolver implements EntityResolver
-{
- public InputSource resolveEntity(String publicId, String systemId)
- {
- if (systemId.equals("http://www.myhost.com/today"))
- {
- // return a special input source
- //MyReader reader = new MyReader();
- //return new InputSource(reader);
- return new InputSource(systemId); // TBD
- }
- else
- {
- // use the default behaviour
- return null;
- }
- }
-}
diff --git a/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/ParserTest.java b/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/ParserTest.java
deleted file mode 100644
index 474d9854c..000000000
--- a/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/ParserTest.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.tests;
-
-import java.io.FileInputStream;
-import java.io.InputStream;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import junit.framework.Assert;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.w3c.dom.Document;
-import org.xml.sax.EntityResolver;
-
-public class ParserTest extends TestCase
-{
-
- public ParserTest(String name)
- {
- super(name);
- }
-
- public static Test suite()
- {
- TestSuite suite = new TestSuite();
-
- suite.addTest
- (new ParserTest("Parser")
- {
- protected void runTest()
- {
- testParser();
- }
- }
- );
-
- return suite;
- }
-
- public void testParser()
- {
- EntityResolver myResolver = new MyResolver();
- try
- {
- InputStream is = new FileInputStream("./samples/LoadAndPrintTest.wsdl");
- DocumentBuilder myBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- myBuilder.setEntityResolver(myResolver);
- Document doc = myBuilder.parse(is);
- Assert.assertNotNull("Document is null",doc);
- }
- catch (Exception e)
- {
- Assert.fail("Test failed due to an exception: " + e.getLocalizedMessage());
- }
- }
-
- public static void main(String[] args)
- {
- }
-
-}
diff --git a/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/RefactoringTest.java b/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/RefactoringTest.java
deleted file mode 100644
index 16c2962af..000000000
--- a/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/RefactoringTest.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.tests;
-
-import javax.xml.namespace.QName;
-
-import junit.framework.Assert;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.WSDLFactory;
-import org.eclipse.wst.wsdl.WSDLPackage;
-import org.eclipse.wst.wsdl.binding.soap.internal.util.SOAPConstants;
-import org.eclipse.wst.wsdl.internal.util.WSDLResourceFactoryImpl;
-import org.eclipse.wst.wsdl.util.WSDLConstants;
-import org.eclipse.xsd.XSDPackage;
-import org.eclipse.xsd.util.XSDResourceFactoryImpl;
-
-public class RefactoringTest extends TestCase
-{
- public RefactoringTest()
- {
- //init();
- }
-
- public RefactoringTest(String name)
- {
- super(name);
- }
-
- public static Test suite()
- {
- TestSuite suite = new TestSuite();
-
- suite.addTest
- (new RefactoringTest("Refactoring")
- {
- protected void runTest()
- {
- testRefactoring();
- }
- }
- );
-
- return suite;
- }
-
- public void testRefactoring()
- {
- try
- {
- // Before running this test, modify the location of the generated WSDL file
- generateWSDL("RefactoringTest.wsdl");
- }
- catch (Exception e)
- {
- Assert.fail("Test failed due to an exception: " + e.getLocalizedMessage());
- }
- }
-
- protected void setUp() throws Exception
- {
- super.setUp();
-
- Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("wsdl", new WSDLResourceFactoryImpl());
- WSDLPackage pkg = WSDLPackage.eINSTANCE;
-
- // We need this for XSD <import>.
- Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("xsd", new XSDResourceFactoryImpl());
- XSDPackage xsdpkg = XSDPackage.eINSTANCE;
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- // defect 6594
- public void renameOperation(Operation op)
- {
- Input input = op.getEInput();
- Assert.assertNotNull(input);
- Message message = input.getEMessage();
- Assert.assertNotNull(message);
-
- op.setName("Renamed" + op.getName());
- QName newQName = new QName(message.getQName().getNamespaceURI(),"Renamed" + message.getQName().getLocalPart());
- message.setQName(newQName);
- }
-
- public void generateWSDL(String outputFile) throws Exception
- {
- ResourceSet resourceSet = new ResourceSetImpl();
- Resource resource = resourceSet.createResource(URI.createFileURI(outputFile));
- resourceSet.getResources().add(resource);
-
- // Create a Definition - Temperature
- Definition definition = WSDLFactory.eINSTANCE.createDefinition();
- definition.setQName(new QName(WSDLConstants.WSDL_NAMESPACE_URI,"Temparature"));
- resource.getContents().add(definition);
-
- // Target namespace - http://www.temperature.com
- definition.setTargetNamespace("http://www.temperature.com");
- definition.addNamespace("tns", "http://www.temperature.com");
-
- // Other namespaces - wsdl, soap, xsd
- definition.addNamespace("wsdl", WSDLConstants.WSDL_NAMESPACE_URI);
- definition.addNamespace("xsd", WSDLConstants.SCHEMA_FOR_SCHEMA_URI_2001);
- definition.addNamespace("soap", SOAPConstants.SOAP_NAMESPACE_URI);
-
- //
- // Let's start building two messages
- //
-
- // Create a Part - ZipCode
- Part part = WSDLFactory.eINSTANCE.createPart();
- part.setName("ZipCode");
- part.setTypeName(new QName(WSDLConstants.SCHEMA_FOR_SCHEMA_URI_2001,"string"));
-
- // Create a Message - GetTemperatureInput
- Message inputMessage = WSDLFactory.eINSTANCE.createMessage();
- inputMessage.setQName(new QName(definition.getTargetNamespace(), "GetTemparatureInput"));
- inputMessage.addPart(part);
- definition.addMessage(inputMessage);
-
- // Create a Part - Temperature
- part = WSDLFactory.eINSTANCE.createPart();
- part.setName("Temperature");
- part.setTypeName(new QName(WSDLConstants.SCHEMA_FOR_SCHEMA_URI_2001,"float"));
-
- // Create a Message - GetTemperatureOutput
- Message outputMessage = WSDLFactory.eINSTANCE.createMessage();
- outputMessage.setQName(new QName(definition.getTargetNamespace(), "GetTemparatureOutput"));
- outputMessage.addPart(part);
- definition.addMessage(outputMessage);
-
- //
- // Next, build a PortType
- //
-
- // Create an Input - GetTemperatureInput
- Input input = WSDLFactory.eINSTANCE.createInput();
- input.setMessage(inputMessage);
-
- // Create an Output - GetTemperatureOutput
- Output output = WSDLFactory.eINSTANCE.createOutput();
- output.setMessage(outputMessage);
-
- // Create an Operation - GetTemperatureForZipCode
- Operation operation = WSDLFactory.eINSTANCE.createOperation();
- operation.setName("GetTemperatureForZipCode");
- operation.setInput(input);
- operation.setOutput(output);
-
- // Create a PortType
- PortType portType = WSDLFactory.eINSTANCE.createPortType();
- portType.setQName(new QName(definition.getTargetNamespace(),"GetTemparatureInfoSOAP"));
- portType.addOperation(operation);
- definition.addPortType(portType);
-
- //
- // Create the second set op Operations
- //
-
- // Create a Part
- part = WSDLFactory.eINSTANCE.createPart();
- part.setName("Part2");
- part.setTypeName(new QName(WSDLConstants.SCHEMA_FOR_SCHEMA_URI_2001,"string"));
-
- // Create a Message
- Message inputMessage2 = WSDLFactory.eINSTANCE.createMessage();
- inputMessage2.setQName(new QName(definition.getTargetNamespace(), "InputMessage2"));
- inputMessage2.addPart(part);
- definition.addMessage(inputMessage2);
-
- // Create a Part
- part = WSDLFactory.eINSTANCE.createPart();
- part.setName("Part3");
- part.setTypeName(new QName(WSDLConstants.SCHEMA_FOR_SCHEMA_URI_2001,"float"));
-
- // Create a Message - GetTemperatureOutput
- Message outputMessage2 = WSDLFactory.eINSTANCE.createMessage();
- outputMessage2.setQName(new QName(definition.getTargetNamespace(), "OutputMessage2"));
- outputMessage2.addPart(part);
- definition.addMessage(outputMessage2);
-
- // Create an Input
- Input input2 = WSDLFactory.eINSTANCE.createInput();
- input2.setMessage(inputMessage2);
-
- // Create an Output - GetTemperatureOutput
- Output output2 = WSDLFactory.eINSTANCE.createOutput();
- output2.setMessage(outputMessage2);
-
- // Create an Operation - GetTemperatureForZipCode
- Operation operation2 = WSDLFactory.eINSTANCE.createOperation();
- operation2.setName("Operation2");
- operation2.setInput(input2);
- operation2.setOutput(output2);
-
- portType.addOperation(operation2);
-
- renameOperation(operation);
- renameOperation(operation2);
-
- resource.save(null);
-
- }
-
-}
diff --git a/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/WSDLGenerationTest.java b/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/WSDLGenerationTest.java
deleted file mode 100644
index 5f25a785a..000000000
--- a/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/WSDLGenerationTest.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.tests;
-
-import javax.xml.namespace.QName;
-
-import junit.framework.Assert;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.BindingInput;
-import org.eclipse.wst.wsdl.BindingOperation;
-import org.eclipse.wst.wsdl.BindingOutput;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.Service;
-import org.eclipse.wst.wsdl.WSDLFactory;
-import org.eclipse.wst.wsdl.WSDLPackage;
-import org.eclipse.wst.wsdl.binding.soap.SOAPAddress;
-import org.eclipse.wst.wsdl.binding.soap.SOAPBinding;
-import org.eclipse.wst.wsdl.binding.soap.SOAPBody;
-import org.eclipse.wst.wsdl.binding.soap.SOAPFactory;
-import org.eclipse.wst.wsdl.binding.soap.SOAPOperation;
-import org.eclipse.wst.wsdl.binding.soap.internal.util.SOAPConstants;
-import org.eclipse.wst.wsdl.internal.util.WSDLResourceFactoryImpl;
-import org.eclipse.wst.wsdl.util.WSDLConstants;
-import org.eclipse.xsd.XSDPackage;
-import org.eclipse.xsd.util.XSDResourceFactoryImpl;
-import org.eclipse.wst.wsdl.binding.soap.internal.impl.SOAPBodyImpl;
-
-public class WSDLGenerationTest extends TestCase
-{
- public WSDLGenerationTest()
- {
- init();
- }
-
- public WSDLGenerationTest(String name)
- {
- super(name);
- }
-
- public static Test suite()
- {
- TestSuite suite = new TestSuite();
-
- suite.addTest
- (new WSDLGenerationTest("SampleWSDLGeneration")
- {
- protected void runTest()
- {
- testSampleWSDLGeneration();
- }
- }
- );
-
- return suite;
- }
-
- public void testSampleWSDLGeneration()
- {
- try
- {
- generateTemperatureService("./TemperatureService.wsdl");
- }
- catch (Exception e)
- {
- Assert.fail("Test failed due to an exception: " + e.getLocalizedMessage());
- }
- }
-
- protected void setUp() throws Exception
- {
- super.setUp();
-
- Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("wsdl", new WSDLResourceFactoryImpl());
- WSDLPackage pkg = WSDLPackage.eINSTANCE;
-
- // We need this for XSD <import>.
- Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("xsd", new XSDResourceFactoryImpl());
- XSDPackage xsdpkg = XSDPackage.eINSTANCE;
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- public void generateTemperatureService(String outputFile) throws Exception
- {
- ResourceSet resourceSet = new ResourceSetImpl();
- Resource resource = resourceSet.createResource(URI.createFileURI(outputFile));
- resourceSet.getResources().add(resource);
-
- // Create a Definition - Temperature
- Definition definition = WSDLFactory.eINSTANCE.createDefinition();
- definition.setQName(new QName(WSDLConstants.WSDL_NAMESPACE_URI,"Temparature"));
- resource.getContents().add(definition);
-
- // Target namespace - http://www.temperature.com
- definition.setTargetNamespace("http://www.temperature.com");
- definition.addNamespace("tns", "http://www.temperature.com");
-
- // Other namespaces - wsdl, soap, xsd
- definition.addNamespace("wsdl", WSDLConstants.WSDL_NAMESPACE_URI);
- definition.addNamespace("xsd", WSDLConstants.SCHEMA_FOR_SCHEMA_URI_2001);
- definition.getNamespaces().put("soap", SOAPConstants.SOAP_NAMESPACE_URI);
-
- //
- // Let's start building two messages
- //
-
- // Create a Part - ZipCode
- Part part = WSDLFactory.eINSTANCE.createPart();
- part.setName("ZipCode");
- part.setTypeName(new QName(WSDLConstants.SCHEMA_FOR_SCHEMA_URI_2001,"string"));
-
- // Create a Message - GetTemperatureInput
- Message inputMessage = WSDLFactory.eINSTANCE.createMessage();
- inputMessage.setQName(new QName(definition.getTargetNamespace(), "GetTemparatureInput"));
- inputMessage.addPart(part);
- definition.addMessage(inputMessage);
-
- // Create a Part - Temperature
- part = WSDLFactory.eINSTANCE.createPart();
- part.setName("Temperature");
- part.setTypeName(new QName(WSDLConstants.SCHEMA_FOR_SCHEMA_URI_2001,"float"));
-
- // Create a Message - GetTemperatureOutput
- Message outputMessage = WSDLFactory.eINSTANCE.createMessage();
- outputMessage.setQName(new QName(definition.getTargetNamespace(), "GetTemparatureOutput"));
- outputMessage.addPart(part);
- definition.addMessage(outputMessage);
-
- //
- // Next, build a PortType
- //
-
- // Create an Input - GetTemperatureInput
- Input input = WSDLFactory.eINSTANCE.createInput();
- input.setMessage(inputMessage);
-
- // Create an Output - GetTemperatureOutput
- Output output = WSDLFactory.eINSTANCE.createOutput();
- output.setMessage(outputMessage);
-
- // Create an Operation - GetTemperatureForZipCode
- Operation operation = WSDLFactory.eINSTANCE.createOperation();
- operation.setName("GetTemperatureForZipCode");
- operation.setInput(input);
- operation.setOutput(output);
-
- // Create a PortType
- PortType portType = WSDLFactory.eINSTANCE.createPortType();
- portType.setQName(new QName(definition.getTargetNamespace(),"GetTemparatureInfoSOAP"));
- portType.addOperation(operation);
- definition.addPortType(portType);
-
- //
- // Now, let's work on Binding
- //
-
- // Create a Binding - GetTemperatureInfoSOAP
- Binding binding = WSDLFactory.eINSTANCE.createBinding();
- binding.setQName(new QName(definition.getTargetNamespace(), "GetTemparatureInfoSOAP"));
- binding.setPortType(portType);
- definition.addBinding(binding);
-
- // Create a SOAP Binding
- SOAPBinding soapBinding = SOAPFactory.eINSTANCE.createSOAPBinding();
- soapBinding.setStyle("rpc");
- soapBinding.setTransportURI("http://schemas.xmlsoap.org/soap/http");
- binding.addExtensibilityElement(soapBinding);
-
- // Create a Binding Operation
- BindingOperation bindingOperation = WSDLFactory.eINSTANCE.createBindingOperation();
- bindingOperation.setName("GetTemperatureForZipCode");
- binding.addBindingOperation(bindingOperation);
-
- // Create a SOAP Operation
- SOAPOperation soapOperation = SOAPFactory.eINSTANCE.createSOAPOperation();
- soapOperation.setSoapActionURI("http://www.temperature.com/GetTemperatureForZipCode");
- bindingOperation.addExtensibilityElement(soapOperation);
-
- // Create a SOAP Body
- SOAPBody soapBody = SOAPFactory.eINSTANCE.createSOAPBody();
- soapBody.setUse("encoded");
- soapBody.getEncodingStyles().add("http://schemas.xmlsoap.org/soap/encoding/");
- soapBody.setNamespaceURI("http://www.temperature.com/");
-
- // Add a part (Temperature) to the SOAP body (Bugzilla 108176)
- java.util.Vector v = new java.util.Vector();
- v.add(part);
- soapBody.setParts(v);
- ((SOAPBodyImpl)soapBody).updateElement();
-
- // Create a Binding Input
- BindingInput bindingInput = WSDLFactory.eINSTANCE.createBindingInput();
- bindingInput.addExtensibilityElement(soapBody);
- bindingOperation.setBindingInput(bindingInput);
-
- // Create a SOAP Body
- soapBody = SOAPFactory.eINSTANCE.createSOAPBody();
- soapBody.setUse("encoded");
- soapBody.getEncodingStyles().add("http://schemas.xmlsoap.org/soap/encoding/");
- soapBody.setNamespaceURI("http://www.temperature.com/");
-
- // Create a Binding Output
- BindingOutput bindingOuput = WSDLFactory.eINSTANCE.createBindingOutput();
- bindingOuput.addExtensibilityElement(soapBody);
- bindingOperation.setBindingOutput(bindingOuput);
-
- //
- // Finally, we are building a Service
- //
-
- // Create a SOAP Address
- SOAPAddress soapAddress = SOAPFactory.eINSTANCE.createSOAPAddress();
- soapAddress.setLocationURI("http://todo-some-address/");
-
- // Create a Port - GetTemperatureInfoSOAP
- Port port = WSDLFactory.eINSTANCE.createPort();
- port.setName("GetTemperatureInfoSOAP");
- port.setBinding(binding);
- port.addExtensibilityElement(soapAddress);
-
- // Create a Service - TemperatureService
- Service service = WSDLFactory.eINSTANCE.createService();
- service.setQName(new QName(definition.getTargetNamespace(),"TemperatureService"));
- service.addPort(port);
- definition.addService(service);
-
- //
- // Phew, we are done. Let's serialize it.
- //
-
- resource.save(null);
-
- }
-
- private void init()
- {
- Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("wsdl", new WSDLResourceFactoryImpl());
- WSDLPackage pkg = WSDLPackage.eINSTANCE;
- }
-
-}
diff --git a/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/WSDLTestsPlugin.java b/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/WSDLTestsPlugin.java
deleted file mode 100644
index 0bb5f4f5b..000000000
--- a/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/WSDLTestsPlugin.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved.   This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-
-package org.eclipse.wst.wsdl.tests;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-
-import java.io.IOException;
-import java.util.*;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class WSDLTestsPlugin extends Plugin {
- //The shared instance.
- private static WSDLTestsPlugin plugin;
- //Resource bundle.
- private ResourceBundle resourceBundle;
-
- private static Bundle pluginBundle = null;
-
- /**
- * The constructor.
- */
- public WSDLTestsPlugin() {
- super();
- plugin = this;
- }
-
- /**
- * This method is called upon plug-in activation
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- pluginBundle = context.getBundle();
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- plugin = null;
- resourceBundle = null;
- pluginBundle = context.getBundle();
- }
-
- /**
- * Returns the shared instance.
- */
- public static WSDLTestsPlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns the string from the plugin's resource bundle,
- * or 'key' if not found.
- */
- public static String getResourceString(String key) {
- ResourceBundle bundle = WSDLTestsPlugin.getDefault().getResourceBundle();
- try {
- return (bundle != null) ? bundle.getString(key) : key;
- } catch (MissingResourceException e) {
- return key;
- }
- }
-
- /**
- * Returns the plugin's resource bundle,
- */
- public ResourceBundle getResourceBundle() {
- try {
- if (resourceBundle == null)
- resourceBundle = ResourceBundle.getBundle("org.eclipse.wst.wsdl.tests.WSDLTestsPluginResources");
- } catch (MissingResourceException x) {
- resourceBundle = null;
- }
- return resourceBundle;
- }
-
- /**
- * Get the install URL of this plugin.
- *
- * @return the install url of this plugin
- */
- public static String getInstallURL()
- {
- try
- {
- return Platform.resolve(pluginBundle.getEntry("/")).getFile();
- }
- catch (IOException e)
- {
- return null;
- }
- }
-
-}
diff --git a/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/util/DefinitionLoader.java b/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/util/DefinitionLoader.java
deleted file mode 100644
index 6abed7718..000000000
--- a/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/util/DefinitionLoader.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.tests.util;
-
-import java.io.IOException;
-import java.util.Hashtable;
-import java.util.Iterator;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.WSDLPackage;
-import org.eclipse.wst.wsdl.internal.util.WSDLResourceFactoryImpl;
-import org.eclipse.wst.wsdl.util.WSDLResourceImpl;
-import org.eclipse.xsd.XSDPackage;
-import org.eclipse.xsd.util.XSDResourceFactoryImpl;
-
-/**
- * @author Kihup Boo
- */
-public final class DefinitionLoader
-{
- {
- // This is needed because we don't have the following in the plugin.xml
- //
- // <extension point = "org.eclipse.emf.extension_parser">
- // <parser type="wsdl" class="com.ibm.etools.wsdl.util.WSDLResourceFactoryImpl"/>
- // </extension>
- //
- Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("wsdl", new WSDLResourceFactoryImpl());
- WSDLPackage pkg = WSDLPackage.eINSTANCE;
-
- // We need this for XSD <import>.
- Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("xsd", new XSDResourceFactoryImpl());
- XSDPackage xsdpkg = XSDPackage.eINSTANCE;
- }
-
- /**
- * This class provides static methods only.
- */
- private DefinitionLoader()
- {
- }
-
- static public Definition load(String filename) throws IOException
- {
- return load(filename,false);
- }
-
- static public Definition load(String filename, boolean useExtensionFactories) throws IOException
- {
- return load(filename, useExtensionFactories, false);
- }
-
- static public Definition load(String filename, boolean useExtensionFactories, boolean trackLocation) throws IOException
- {
- // filename is an absolute path
-
- URI uri = null;
- uri = URI.createFileURI(filename);
-
- ResourceSet resourceSet = new ResourceSetImpl();
- resourceSet.getAdapterFactories().add(new WSDLModelLocatorAdapterFactory());
- resourceSet.getAdapterFactories().add(new XSDSchemaLocationResolverAdapterFactory());
-
- WSDLResourceImpl wsdlMainResource = (WSDLResourceImpl)resourceSet.createResource(URI.createURI("*.wsdl"));
- wsdlMainResource.setURI(uri);
- java.util.Map map = new Hashtable();
- map.put(WSDLResourceImpl.CONTINUE_ON_LOAD_ERROR,Boolean.valueOf(true));
- map.put(WSDLResourceImpl.USE_EXTENSION_FACTORIES,Boolean.valueOf(useExtensionFactories));
- map.put(WSDLResourceImpl.TRACK_LOCATION,Boolean.valueOf(trackLocation));
- wsdlMainResource.load(map);
-
- Definition definition = null;
- for (Iterator resources = resourceSet.getResources().iterator(); resources.hasNext(); )
- {
- Object resource = resources.next();
- if (resource instanceof WSDLResourceImpl)
- {
- WSDLResourceImpl wsdlResource = (WSDLResourceImpl)resource;
- definition = wsdlResource.getDefinition();
- return definition;
- }
- }
-
- return null;
- }
-
- static public void store(Definition definition, String filename) throws IOException
- {
- // filename is an absolute path
-
- Resource resource = definition.eResource();
- resource.setURI(URI.createFileURI(filename));
- resource.save(null);
- }
-}
diff --git a/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/util/DefinitionVisitor.java b/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/util/DefinitionVisitor.java
deleted file mode 100644
index 4b139a6f2..000000000
--- a/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/util/DefinitionVisitor.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.tests.util;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.BindingFault;
-import org.eclipse.wst.wsdl.BindingInput;
-import org.eclipse.wst.wsdl.BindingOperation;
-import org.eclipse.wst.wsdl.BindingOutput;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ExtensibilityElement;
-import org.eclipse.wst.wsdl.ExtensibleElement;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Import;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.Service;
-import org.eclipse.wst.wsdl.Types;
-
-/**
- * @author Kihup Boo
- */
-public abstract class DefinitionVisitor extends TestCase
-{
- protected Definition definition;
-
- /**
- * Use DefinitionVisitor(Definition definition)
- */
- private DefinitionVisitor()
- {
- }
-
- // Added for JUnit
- public DefinitionVisitor(String name)
- {
- super(name);
- }
-
- protected DefinitionVisitor(Definition definition)
- {
- this.definition = definition;
- }
-
- // main entry
- public void visit()
- {
- visitDefinition(definition);
- }
-
- protected void visitDefinition(Definition def)
- {
- Iterator iterator = def.getEImports().iterator();
- while (iterator.hasNext())
- visitImport((Import)iterator.next());
-
- Types types = def.getETypes();
- if (types != null)
- visitTypes(types);
-
- iterator = def.getEMessages().iterator();
- while (iterator.hasNext())
- visitMessage((Message)iterator.next());
-
- iterator = def.getEPortTypes().iterator();
- while (iterator.hasNext())
- visitPortType((PortType)iterator.next());
-
- iterator = def.getEBindings().iterator();
- while (iterator.hasNext())
- visitBinding((Binding)iterator.next());
-
- iterator = def.getEServices().iterator();
- while (iterator.hasNext())
- visitService((Service)iterator.next());
-
- iterator = def.getEExtensibilityElements().iterator();
- while (iterator.hasNext())
- visitExtensibilityElement(def,(ExtensibilityElement)iterator.next());
-
- }
-
- abstract protected void visitImport(Import wsdlImport);
-
- abstract protected void visitTypes(Types types);
-
- protected void visitMessage(Message message)
- {
- Iterator iterator = message.getEParts().iterator();
- while (iterator.hasNext())
- visitPart((Part)iterator.next());
- }
-
- abstract protected void visitPart(Part part);
-
- protected void visitPortType(PortType portType)
- {
- Iterator iterator = portType.getEOperations().iterator();
- while (iterator.hasNext())
- visitOperation((Operation)iterator.next());
- }
-
- protected void visitOperation(Operation operation)
- {
- Input input = operation.getEInput();
- visitInput((Input)input);
-
- Output output = operation.getEOutput();
- visitOutput((Output)output);
-
- Iterator iterator = operation.getEFaults().iterator();
- while (iterator.hasNext())
- visitFault((Fault)iterator.next());
- }
-
- protected abstract void visitInput(Input input);
-
- protected abstract void visitOutput(Output output);
-
- protected abstract void visitFault(Fault fault);
-
- protected void visitBinding(Binding binding)
- {
- Iterator iterator = binding.getEBindingOperations().iterator();
- while (iterator.hasNext())
- visitBindingOperation((BindingOperation)iterator.next());
-
- iterator = binding.getEExtensibilityElements().iterator();
- while (iterator.hasNext())
- visitExtensibilityElement(binding,(ExtensibilityElement)iterator.next());
- }
-
- protected void visitBindingOperation(BindingOperation operation)
- {
- BindingInput input = operation.getEBindingInput();
- visitBindingInput((BindingInput)input);
-
- BindingOutput output = operation.getEBindingOutput();
- visitBindingOutput((BindingOutput)output);
-
- Iterator iterator = operation.getEBindingFaults().iterator();
- while (iterator.hasNext())
- visitBindingFault((BindingFault)iterator.next());
-
- iterator = operation.getEExtensibilityElements().iterator();
- while (iterator.hasNext())
- visitExtensibilityElement(operation,(ExtensibilityElement)iterator.next());
-
- }
-
- protected void visitBindingInput(BindingInput input)
- {
- Iterator iterator = input.getEExtensibilityElements().iterator();
- while (iterator.hasNext())
- visitExtensibilityElement(input,(ExtensibilityElement)iterator.next());
- }
-
- protected void visitBindingOutput(BindingOutput output)
- {
- Iterator iterator = output.getEExtensibilityElements().iterator();
- while (iterator.hasNext())
- visitExtensibilityElement(output,(ExtensibilityElement)iterator.next());
- }
-
- protected void visitBindingFault(BindingFault fault)
- {
- Iterator iterator = fault.getEExtensibilityElements().iterator();
- while (iterator.hasNext())
- visitExtensibilityElement(fault,(ExtensibilityElement)iterator.next());
- }
-
- protected void visitService(Service service)
- {
- Iterator iterator = service.getEPorts().iterator();
- while (iterator.hasNext())
- visitPort((Port)iterator.next());
-
- iterator = service.getEExtensibilityElements().iterator();
- while (iterator.hasNext())
- visitExtensibilityElement(service,(ExtensibilityElement)iterator.next());
- }
-
- protected void visitPort(Port port)
- {
- Iterator iterator = port.getEExtensibilityElements().iterator();
- while (iterator.hasNext())
- visitExtensibilityElement(port,(ExtensibilityElement)iterator.next());
- }
-
- abstract protected void visitExtensibilityElement
- (ExtensibleElement owner,
- ExtensibilityElement extensibilityElement);
-
-}
diff --git a/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/util/WSDL4JDefinitionVisitor.java b/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/util/WSDL4JDefinitionVisitor.java
deleted file mode 100644
index ba7fa2dd3..000000000
--- a/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/util/WSDL4JDefinitionVisitor.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.tests.util;
-
-import java.util.Iterator;
-
-import javax.wsdl.Binding;
-import javax.wsdl.BindingFault;
-import javax.wsdl.BindingInput;
-import javax.wsdl.BindingOperation;
-import javax.wsdl.BindingOutput;
-import javax.wsdl.Definition;
-import javax.wsdl.Fault;
-import javax.wsdl.Import;
-import javax.wsdl.Input;
-import javax.wsdl.Message;
-import javax.wsdl.Operation;
-import javax.wsdl.Output;
-import javax.wsdl.Part;
-import javax.wsdl.Port;
-import javax.wsdl.PortType;
-import javax.wsdl.Service;
-import javax.wsdl.Types;
-import javax.wsdl.extensions.ExtensibilityElement;
-
-import junit.framework.TestCase;
-
-/**
- * @author Kihup Boo
- */
-public abstract class WSDL4JDefinitionVisitor extends TestCase
-{
- protected Definition definition;
-
- /**
- * Use DefinitionVisitor(Definition definition)
- */
- private WSDL4JDefinitionVisitor()
- {
- }
-
- // Added for JUnit
- public WSDL4JDefinitionVisitor(String name)
- {
- super(name);
- }
-
- protected WSDL4JDefinitionVisitor(Definition definition)
- {
- this.definition = definition;
- }
-
- // main entry
- public void visit()
- {
- visitDefinition(definition);
- }
-
- protected void visitDefinition(Definition def)
- {
- java.util.Map imports = def.getImports();
- Iterator iterator = imports.keySet().iterator();
- Import myImport = null;
- while (iterator.hasNext())
- {
- myImport = (Import)((java.util.ArrayList)imports.get(iterator.next())).get(0);
- visitImport(myImport);
- }
-
- Types types = def.getTypes();
- if (types != null)
- visitTypes(types);
-
- iterator = def.getMessages().values().iterator();
- while (iterator.hasNext())
- visitMessage((Message)iterator.next());
-
- iterator = def.getPortTypes().values().iterator();
- while (iterator.hasNext())
- visitPortType((PortType)iterator.next());
-
- iterator = def.getBindings().values().iterator();
- while (iterator.hasNext())
- visitBinding((Binding)iterator.next());
-
- iterator = def.getServices().values().iterator();
- while (iterator.hasNext())
- visitService((Service)iterator.next());
-
- iterator = def.getExtensibilityElements().iterator();
- while (iterator.hasNext())
- visitExtensibilityElement((ExtensibilityElement)iterator.next());
-
- }
-
- abstract protected void visitImport(Import wsdlImport);
-
- abstract protected void visitTypes(Types types);
-
- protected void visitMessage(Message message)
- {
- Iterator iterator = message.getParts().values().iterator();
- while (iterator.hasNext())
- visitPart((Part)iterator.next());
- }
-
- abstract protected void visitPart(Part part);
-
- protected void visitPortType(PortType portType)
- {
- Iterator iterator = portType.getOperations().iterator();
- while (iterator.hasNext())
- visitOperation((Operation)iterator.next());
- }
-
- protected void visitOperation(Operation operation)
- {
- Input input = operation.getInput();
- visitInput((Input)input);
-
- Output output = operation.getOutput();
- visitOutput((Output)output);
-
- java.util.Map faults = operation.getFaults();
- Iterator iterator = faults.keySet().iterator();
- Fault fault = null;
- while (iterator.hasNext())
- {
- fault = (Fault)faults.get(iterator.next());
- visitFault(fault);
- }
- }
-
- protected abstract void visitInput(Input input);
-
- protected abstract void visitOutput(Output output);
-
- protected abstract void visitFault(Fault fault);
-
- protected void visitBinding(Binding binding)
- {
- Iterator iterator = binding.getBindingOperations().iterator();
- while (iterator.hasNext())
- visitBindingOperation((BindingOperation)iterator.next());
-
- iterator = binding.getExtensibilityElements().iterator();
- while (iterator.hasNext())
- visitExtensibilityElement((ExtensibilityElement)iterator.next());
- }
-
- protected void visitBindingOperation(BindingOperation operation)
- {
- BindingInput input = operation.getBindingInput();
- visitBindingInput((BindingInput)input);
-
- BindingOutput output = operation.getBindingOutput();
- visitBindingOutput((BindingOutput)output);
-
- java.util.Map bindingFaults = operation.getBindingFaults();
- Iterator iterator = bindingFaults.keySet().iterator();
- BindingFault bindingFault = null;
- while (iterator.hasNext())
- {
- bindingFault = (BindingFault)bindingFaults.get(iterator.next());
- visitBindingFault(bindingFault);
- }
-
- iterator = operation.getExtensibilityElements().iterator();
- while (iterator.hasNext())
- visitExtensibilityElement((ExtensibilityElement)iterator.next());
-
- }
-
- protected void visitBindingInput(BindingInput input)
- {
- Iterator iterator = input.getExtensibilityElements().iterator();
- while (iterator.hasNext())
- visitExtensibilityElement((ExtensibilityElement)iterator.next());
- }
-
- protected void visitBindingOutput(BindingOutput output)
- {
- Iterator iterator = output.getExtensibilityElements().iterator();
- while (iterator.hasNext())
- visitExtensibilityElement((ExtensibilityElement)iterator.next());
- }
-
- protected void visitBindingFault(BindingFault fault)
- {
- Iterator iterator = fault.getExtensibilityElements().iterator();
- while (iterator.hasNext())
- visitExtensibilityElement((ExtensibilityElement)iterator.next());
- }
-
- protected void visitService(Service service)
- {
- Iterator iterator = service.getPorts().values().iterator();
- while (iterator.hasNext())
- visitPort((Port)iterator.next());
-
- iterator = service.getExtensibilityElements().iterator();
- while (iterator.hasNext())
- visitExtensibilityElement((ExtensibilityElement)iterator.next());
- }
-
- protected void visitPort(Port port)
- {
- Iterator iterator = port.getExtensibilityElements().iterator();
- while (iterator.hasNext())
- visitExtensibilityElement((ExtensibilityElement)iterator.next());
- }
-
- abstract protected void visitExtensibilityElement(ExtensibilityElement extensibilityElement);
-
-}
diff --git a/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/util/WSDLConverter.java b/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/util/WSDLConverter.java
deleted file mode 100644
index 9247256d4..000000000
--- a/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/util/WSDLConverter.java
+++ /dev/null
@@ -1,608 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.tests.util;
-
-import java.io.FileOutputStream;
-import java.util.Iterator;
-
-import javax.wsdl.OperationType;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.BindingFault;
-import org.eclipse.wst.wsdl.BindingInput;
-import org.eclipse.wst.wsdl.BindingOperation;
-import org.eclipse.wst.wsdl.BindingOutput;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ExtensibilityElement;
-import org.eclipse.wst.wsdl.ExtensibleElement;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Import;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.MessageReference;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.Service;
-import org.eclipse.wst.wsdl.Types;
-import org.eclipse.wst.wsdl.WSDLPackage;
-import org.eclipse.wst.wsdl.internal.util.WSDLResourceFactoryImpl;
-import org.eclipse.xsd.XSDPackage;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDResourceFactoryImpl;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * @author Kihup Boo
- */
-public class WSDLConverter extends DefinitionVisitor
-{
- private Document doc;
- private Element description;
- private Element currentTypes;
- private Element currentService;
- private Element currentEndpoint;
- private Element currentInterface;
- private Element currentOperation;
-
- private Element currentBinding;
- private Element currentBindingOperation;
- private Element currentBindingInput;
- private Element currentBindingOutput;
- private Element currentBindingFault;
-
- private String wsdlNamespacePrefix;
- private String xsdNamespacePrefix;
-
- {
- // This is needed because we don't have the following in the plugin.xml
- //
- // <extension point = "org.eclipse.emf.extension_parser">
- // <parser type="wsdl" class="com.ibm.etools.wsdl.util.WSDLResourceFactoryImpl"/>
- // </extension>
- //
- Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("wsdl", new WSDLResourceFactoryImpl());
- WSDLPackage pkg = WSDLPackage.eINSTANCE;
-
- // We need this for XSD <import>.
- Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("xsd", new XSDResourceFactoryImpl());
- XSDPackage xsdpkg = XSDPackage.eINSTANCE;
- }
-
- // Added for JUnit
- public WSDLConverter(String name)
- {
- super(name);
- }
-
- /**
- * @param definition
- */
- public WSDLConverter(Definition definition)
- {
- super(definition);
- // TODO Auto-generated constructor stub
- }
-
- public void generate20(String filename) throws Exception
- {
- createDocument();
- visit();
- serialize(filename);
- }
-
- private void serialize(String filename) throws Exception
- {
- Source domSource = new DOMSource(doc);
- Transformer transformer = TransformerFactory.newInstance().newTransformer();
- transformer.setOutputProperty(OutputKeys.INDENT,"yes");
- transformer.setOutputProperty(OutputKeys.ENCODING,"UTF-8");
- transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount","4");
- transformer.transform(domSource,new StreamResult(new FileOutputStream(filename)));
- }
-
- private void createDocument() throws ParserConfigurationException
- {
- doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
- }
-
- private Element createWSDLElement(String name)
- {
- Element element = doc.createElementNS("http://www.w3.org/2004/08/wsdl",name);
- if (wsdlNamespacePrefix != null)
- element.setPrefix(wsdlNamespacePrefix);
-
- return element;
- }
-
- private void processDocumentation(Element docElement, Element parent)
- {
- if (docElement == null)
- return;
-
- Element adoptedDocElement = (Element)doc.importNode(docElement,true);
- parent.appendChild(adoptedDocElement);
- }
-
- protected void visitDefinition(Definition def)
- {
- description = createWSDLElement("description");
- processDocumentation(def.getDocumentationElement(),description);
-
- // TBD - Determine later if we want to convert the document to use SOAP 1.2.
- // However adding these two namespaces may not be harmful.
- description.setAttribute("xmlns:soapenv","http://www.w3.org/2003/05/soap-envelop");
- description.setAttribute("xmlns:wsoap","http://www.w3.org/2004/08/soap12");
-
- String targetNamespace = def.getTargetNamespace();
- if (targetNamespace != null)
- description.setAttribute("targetNamespace",targetNamespace);
-
- Iterator iterator = def.getNamespaces().keySet().iterator();
- String prefix = null;
- String namespace = null;
- /*
- xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"*/
- while (iterator.hasNext())
- {
- prefix = (String)iterator.next();
- namespace = def.getNamespace(prefix);
-
- if ("http://schemas.xmlsoap.org/wsdl/".equals(namespace))
- {
- if (prefix.length() == 0) // meant to be default namespace
- description.setAttribute("xmlns","http://www.w3.org/2004/08/wsdl");
- else
- {
- description.setAttribute("xmlns:" + prefix,"http://www.w3.org/2004/08/wsdl");
- wsdlNamespacePrefix = prefix;
- description.setPrefix(wsdlNamespacePrefix);
- }
- continue;
- }
-
- // SOAP 1.2
- if ("http://schemas.xmlsoap.org/wsdl/soap/".equals(namespace))
- {
- // SOAP 1.2
- description.setAttribute("xmlns:" + prefix,"http://www.w3.org/2003/05/soap-envelop");
-
- // WSDL 2.0 binding for SOAP 1.2
- description.setAttribute("xmlns:wsoap","http://www.w3.org/2004/08/soap12");
- continue;
- }
-
- //if ("http://schemas.xmlsoap.org/soap/encoding/".equals(namespace))
- // continue;
-
- if ("http://www.w3.org/2001/XMLSchema".equals(namespace))
- xsdNamespacePrefix = prefix; // We will use this in visitImport().
-
- if (prefix.length() == 0) // meant to be default namespace
- description.setAttribute("xmlns" + prefix,namespace);
- else
- description.setAttribute("xmlns:" + prefix,namespace);
- }
-
- doc.appendChild(description);
- super.visitDefinition(def);
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.wsdl.tests.util.DefinitionVisitor#visitImport(org.eclipse.wst.wsdl.Import)
- */
- protected void visitImport(Import wsdlImport)
- {
- // Determine if we <import> a schema.
- if (importingSchema(wsdlImport))
- {
- currentTypes = createWSDLElement("types");
- description.appendChild(currentTypes);
-
- // <xs:import namespace="http://foo.com" schemaLocation= "bar.xsd"/>
- Element schemaImport = doc.createElementNS("http://www.w3.org/2001/XMLSchema","import");
- if (xsdNamespacePrefix == null) // need to add one
- {
- description.setAttribute("xmlns:xs","http://www.w3.org/2001/XMLSchema");
- xsdNamespacePrefix = "xs";
- schemaImport.setPrefix(xsdNamespacePrefix);
- }
- else if (!"".equals(xsdNamespacePrefix)) // it is not default namespace
- schemaImport.setPrefix(xsdNamespacePrefix);
-
- schemaImport.setAttribute("namespace",wsdlImport.getNamespaceURI());
- schemaImport.setAttribute("schemaLocation",wsdlImport.getLocationURI());
- processDocumentation(wsdlImport.getDocumentationElement(),schemaImport);
- currentTypes.appendChild(schemaImport);
- }
- else
- {
- Element importElement = wsdlImport.getElement();
- Element adoptedImportElement = (Element)doc.importNode(importElement,true);
- processDocumentation(wsdlImport.getDocumentationElement(),adoptedImportElement);
- description.appendChild(adoptedImportElement);
- }
- }
-
- private boolean importingSchema(Import myImport)
- {
- if (myImport.getDefinition() != null) // it is WSDL import
- return false;
- else
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.wsdl.tests.util.DefinitionVisitor#visitTypes(org.eclipse.wst.wsdl.Types)
- */
- protected void visitTypes(Types types)
- {
- // currentTypes may have been created in visitImport().
- if (currentTypes == null)
- {
- currentTypes = createWSDLElement("types");
- processDocumentation(types.getDocumentationElement(),currentTypes);
- description.appendChild(currentTypes);
- }
-
- Iterator iterator = types.getSchemas().iterator();
- XSDSchema schema = null;
- Element schemaElement = null;
- Element adoptedSchemaElement = null;
- while (iterator.hasNext())
- {
- schema = (XSDSchema)iterator.next();
- schema.updateElement();
- schemaElement = schema.getElement();
- adoptedSchemaElement = (Element)doc.importNode(schemaElement,true);
- currentTypes.appendChild(adoptedSchemaElement);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.wsdl.tests.util.DefinitionVisitor#visitPart(org.eclipse.wst.wsdl.Part)
- */
- protected void visitPart(Part part)
- {
- // TODO Auto-generated method stub
- }
-
- protected void visitPortType(PortType portType)
- {
- currentInterface = createWSDLElement("interface");
- processDocumentation(portType.getDocumentationElement(),currentInterface);
-
- Element portTypeElement = portType.getElement();
- if (portTypeElement.hasAttribute("name"))
- currentInterface.setAttribute("name",portTypeElement.getAttribute("name"));
-
- description.appendChild(currentInterface);
- super.visitPortType(portType);
- }
-
- protected void visitOperation(Operation operation)
- {
- currentOperation = createWSDLElement("operation");
- processDocumentation(operation.getDocumentationElement(),currentOperation);
-
- Element operationElement = operation.getElement();
- if (operationElement.hasAttribute("name"))
- currentOperation.setAttribute("name",operationElement.getAttribute("name"));
-
- OperationType opType = operation.getStyle();
- if (OperationType.REQUEST_RESPONSE == opType)
- currentOperation.setAttribute("pattern","http://www.w3.org/2004/03/wsdl/in-out");
- else if (OperationType.SOLICIT_RESPONSE == opType)
- currentOperation.setAttribute("pattern","http://www.w3.org/2004/03/wsdl/out-in");
- else if (OperationType.NOTIFICATION == opType)
- currentOperation.setAttribute("pattern","http://www.w3.org/2004/03/wsdl/out-only");
- else if (OperationType.ONE_WAY == opType)
- currentOperation.setAttribute("pattern","http://www.w3.org/2004/03/wsdl/in-only");
-
- currentInterface.appendChild(currentOperation);
- super.visitOperation(operation);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.wsdl.tests.util.DefinitionVisitor#visitInput(org.eclipse.wst.wsdl.Input)
- */
- protected void visitInput(Input input)
- {
- Element currentInput = createWSDLElement("input");
- processDocumentation(input.getDocumentationElement(),currentInput);
-
- Element inputElement = input.getElement();
-
- if (inputElement.hasAttribute("name"))
- currentInput.setAttribute("messageLabel",inputElement.getAttribute("name"));
-
- Element partElement = getPartElement(input);
- if (partElement.hasAttribute("element"))
- currentInput.setAttribute("element",partElement.getAttribute("element"));
- // TBD - what if the part uses "type"?
-
- currentOperation.appendChild(currentInput);
- }
-
- private Element getPartElement(MessageReference messageRef)
- {
- Iterator iterator = messageRef.getEMessage().getEParts().iterator();
- // TBD - for now, take the first part.
- Part part = (Part)iterator.next();
- Element partElement = part.getElement();
- return partElement;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.wsdl.tests.util.DefinitionVisitor#visitOutput(org.eclipse.wst.wsdl.Output)
- */
- protected void visitOutput(Output output)
- {
- Element currentOutput = createWSDLElement("output");
- processDocumentation(output.getDocumentationElement(),currentOutput);
-
- Element outputElement = output.getElement();
-
- if (outputElement.hasAttribute("name"))
- currentOutput.setAttribute("messageLabel",outputElement.getAttribute("name"));
-
- Element partElement = getPartElement(output);
- if (partElement.hasAttribute("element"))
- currentOutput.setAttribute("element",partElement.getAttribute("element"));
- // TBD - what if the part uses "type"?
-
- currentOperation.appendChild(currentOutput);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.wsdl.tests.util.DefinitionVisitor#visitFault(org.eclipse.wst.wsdl.Fault)
- */
- protected void visitFault(Fault fault)
- {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.wsdl.tests.util.DefinitionVisitor#visitBinding(org.eclipse.wst.wsdl.Binding)
- */
- protected void visitBinding(Binding binding)
- {
- currentBinding = createWSDLElement("binding");
- processDocumentation(binding.getDocumentationElement(),currentBinding);
-
- Element bindingElement = binding.getElement();
- if (bindingElement.hasAttribute("name"))
- currentBinding.setAttribute("name",bindingElement.getAttribute("name"));
- if (bindingElement.hasAttribute("type"))
- currentBinding.setAttribute("interface",bindingElement.getAttribute("type"));
-
- // TBD - is the next line fixed for SOAP?
- currentBinding.setAttribute("type","http://www.w3.org/2004/08/wsdl/soap12");
- currentBinding.setAttribute("wsoap:protocol","http://www.w3.org/2003/05/soap/bindings/HTTP");
- currentBinding.setAttribute("wsoap:mepDefault","http://www.w3.org.2003/05/soap/mep/request-response");
-
- description.appendChild(currentBinding);
- super.visitBinding(binding);
- }
-
- protected void visitBindingOperation(BindingOperation operation)
- {
- currentBindingOperation = createWSDLElement("operation");
- processDocumentation(operation.getDocumentationElement(),currentBindingOperation);
-
- Element operationElement = operation.getElement();
- String operationName = operation.getEOperation().getName();
-
- // Determine prefix
- String prefix = null;
- String targetNamespace = null;
- Definition def = operation.getEnclosingDefinition();
- if (def != null)
- targetNamespace = def.getTargetNamespace();
- if (targetNamespace != null)
- prefix = def.getPrefix(targetNamespace);
-
- if (prefix == null)
- prefix = "";
- else
- prefix += ":";
-
- currentBindingOperation.setAttribute("ref",prefix + operationName);
-
- currentBinding.appendChild(currentBindingOperation);
- super.visitBindingOperation(operation);
- }
-
- protected void visitBindingInput(BindingInput input)
- {
- currentBindingInput = createWSDLElement("input");
- processDocumentation(input.getDocumentationElement(),currentBindingInput);
-
- Element inputElement = input.getElement();
- String inputName = input.getName();
- if (inputName != null)
- inputElement.setAttribute("name",inputName);
-
- currentBindingOperation.appendChild(currentBindingInput);
- super.visitBindingInput(input);
- }
-
- protected void visitBindingOutput(BindingOutput output)
- {
- currentBindingOutput = createWSDLElement("output");
- processDocumentation(output.getDocumentationElement(),currentBindingOutput);
-
- Element outputElement = output.getElement();
- String outputName = output.getName();
- if (outputName != null)
- outputElement.setAttribute("name",outputName);
-
- currentBindingOperation.appendChild(currentBindingOutput);
- super.visitBindingOutput(output);
- }
-
- protected void visitBindingFault(BindingFault fault)
- {
- currentBindingFault = createWSDLElement("fault");
- processDocumentation(fault.getDocumentationElement(),currentBindingFault);
-
- Element faultElement = fault.getElement();
- String faultName = fault.getName();
- if (faultName != null)
- faultElement.setAttribute("name",faultName);
-
- currentBindingOperation.appendChild(currentBindingFault);
- super.visitBindingFault(fault);
- }
-
- protected void visitService(Service service)
- {
- currentService = createWSDLElement("service");
- processDocumentation(service.getDocumentationElement(),currentService);
-
- Element serviceElement = service.getElement();
- if (serviceElement.hasAttribute("name"))
- currentService.setAttribute("name",serviceElement.getAttribute("name"));
-
- description.appendChild(currentService);
- super.visitService(service);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.wsdl.tests.util.DefinitionVisitor#visitPort(org.eclipse.wst.wsdl.Port)
- */
- protected void visitPort(Port port)
- {
- currentEndpoint = createWSDLElement("endpoint");
- processDocumentation(port.getDocumentationElement(),currentEndpoint);
-
- Element portElement = port.getElement();
- if (portElement.hasAttribute("name"))
- currentEndpoint.setAttribute("name",portElement.getAttribute("name"));
- if (portElement.hasAttribute("binding"))
- currentEndpoint.setAttribute("binding",portElement.getAttribute("binding"));
-
- // Add interface to current service
- Binding binding = port.getEBinding();
- if (binding != null) // binding could not be resolved
- {
- Element bindingElement = binding.getElement();
- if (bindingElement.hasAttribute("type"))
- currentService.setAttribute("interface",bindingElement.getAttribute("type"));
- }
-
- currentService.appendChild(currentEndpoint);
- super.visitPort(port);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.wsdl.tests.util.DefinitionVisitor#visitExtensibilityElement(org.eclipse.wst.wsdl.ExtensibleElement, org.eclipse.wst.wsdl.ExtensibilityElement)
- */
- protected void visitExtensibilityElement(ExtensibleElement owner, ExtensibilityElement extensibilityElement)
- {
- // TBD - It is not just SOAP binding
- if (owner instanceof org.eclipse.wst.wsdl.internal.impl.PortImpl)
- {
- Element soapElement = extensibilityElement.getElement();
- if (soapElement.hasAttribute("location"))
- currentEndpoint.setAttribute("address",soapElement.getAttribute("location"));
- }
- else
- {
- Element domElement = extensibilityElement.getElement();
- Element adoptedDOMElement = (Element)doc.importNode(domElement,true);
-
- if (owner instanceof org.eclipse.wst.wsdl.internal.impl.DefinitionImpl)
- description.insertBefore(adoptedDOMElement,description.getFirstChild());
- else if (owner instanceof org.eclipse.wst.wsdl.internal.impl.ServiceImpl)
- currentService.insertBefore(adoptedDOMElement,currentService.getFirstChild());
- else if (owner instanceof org.eclipse.wst.wsdl.internal.impl.PortTypeImpl)
- currentInterface.insertBefore(adoptedDOMElement,currentInterface.getFirstChild());
- else if (owner instanceof org.eclipse.wst.wsdl.internal.impl.OperationImpl)
- currentOperation.insertBefore(adoptedDOMElement,currentOperation.getFirstChild());
- else if (owner instanceof org.eclipse.wst.wsdl.internal.impl.BindingImpl)
- currentBinding.insertBefore(adoptedDOMElement,currentBinding.getFirstChild());
- else if (owner instanceof org.eclipse.wst.wsdl.internal.impl.BindingOperationImpl)
- currentBindingOperation.insertBefore(adoptedDOMElement,currentBindingOperation.getFirstChild());
- else if (owner instanceof org.eclipse.wst.wsdl.internal.impl.BindingInputImpl)
- currentBindingInput.insertBefore(adoptedDOMElement,currentBindingInput.getFirstChild());
- else if (owner instanceof org.eclipse.wst.wsdl.internal.impl.BindingOutputImpl)
- currentBindingOutput.insertBefore(adoptedDOMElement,currentBindingOutput.getFirstChild());
- else if (owner instanceof org.eclipse.wst.wsdl.internal.impl.BindingFaultImpl)
- currentBindingFault.insertBefore(adoptedDOMElement,currentBindingFault.getFirstChild());
-
- }
-
- }
-
- public static Test suite()
- {
- TestSuite suite = new TestSuite();
-
- suite.addTest
- (new WSDLConverter("Convert")
- {
- protected void runTest()
- {
- testConvert();
- }
- }
- );
- return suite;
- }
-
- public void testConvert()
- {
- try
- {
- Definition def = DefinitionLoader.load("d:/eclipse301/eclipse/workspace/org.eclipse.wst.wsdl.tests/PTATimeDistribution.wsdl");
- WSDLConverter converter = new WSDLConverter(def);
- converter.generate20("d:/eclipse301/eclipse/workspace/org.eclipse.wst.wsdl.tests/PTATimeDistribution20.wsdl");
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-
- public static void main(String[] args)
- {
- junit.textui.TestRunner.run(suite());
- /*
- try
- {
- Definition def = DefinitionLoader.load(args[0]);
- WSDLConverter converter = new WSDLConverter(def);
- converter.generate20("test20.wsdl");
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }*/
- }
-}
diff --git a/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/util/WSDLModelLocatorAdapterFactory.java b/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/util/WSDLModelLocatorAdapterFactory.java
deleted file mode 100644
index a4c5b3bc8..000000000
--- a/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/util/WSDLModelLocatorAdapterFactory.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.tests.util;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.wsdl.internal.util.WSDLModelLocator;
-
-public class WSDLModelLocatorAdapterFactory extends AdapterFactoryImpl
-{
- protected CustomWSDLModelLocator customWSDLModelLocator = new CustomWSDLModelLocator();
-
- class CustomWSDLModelLocator extends AdapterImpl implements WSDLModelLocator
- {
- public String resolveURI(String baseLocation, String namespace, String location)
- {
- return URIResolverPlugin.createResolver().resolve(baseLocation, namespace, location);
- }
-
- public boolean isAdatperForType(Object type)
- {
- return type == WSDLModelLocator.class;
- }
- }
-
- public boolean isFactoryForType(Object type)
- {
- return type == WSDLModelLocator.class;
- }
-
- public Adapter adaptNew(Notifier target, Object type)
- {
- return customWSDLModelLocator;
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/util/XMLDiff.java b/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/util/XMLDiff.java
deleted file mode 100644
index 907a3306e..000000000
--- a/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/util/XMLDiff.java
+++ /dev/null
@@ -1,169 +0,0 @@
-package org.eclipse.wst.wsdl.tests.util;
-
-import org.w3c.dom.*;
-import org.xml.sax.SAXException;
-
-import java.io.*;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-/**
- * @author Kihup Boo
- */
-public class XMLDiff
-{
- private PrintStream out = System.out;
- private boolean DIFF_ELEMENT_NODE_ONLY = false;
-
- public boolean diff(String file1, String file2) throws ParserConfigurationException, SAXException, IOException
- {
- return diff(file1,file2,false);
- }
-
- public boolean diff(String file1, String file2, boolean elementOnly) throws ParserConfigurationException, SAXException, IOException
- {
- Document doc1 = getDocument(file1);
- Document doc2 = getDocument(file2);
- DIFF_ELEMENT_NODE_ONLY = elementOnly;
- return diff(doc1,doc2);
- }
-
- public boolean diff(Document doc1, Document doc2)
- {
- Element root1 = doc1.getDocumentElement();
- Element root2 = doc2.getDocumentElement();
- return compareNodes(root1,root2);
- }
-
- private Document getDocument(String uri) throws ParserConfigurationException, SAXException, IOException
- {
- DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- Document doc = builder.parse(uri);
- return doc;
- }
-
- private boolean compareNodes(Node node1, Node node2)
- {
- if (DIFF_ELEMENT_NODE_ONLY)
- {
- // Compare only element nodes in the children.
- filterNonElementNodes(node1);
- filterNonElementNodes(node2);
- }
-
- if (node1.getNodeType() != node2.getNodeType()
- || node1.getNodeName() != node2.getNodeName())
- {
- println("Node type or node name is different:");
- println("Node 1: " + node1.getNodeName());
- println("Node 2: " + node2.getNodeName());
- return false;
- }
-
- if (!compareAttributes(node1,node2))
- return false;
-
- NodeList nodeList1 = node1.getChildNodes();
- NodeList nodeList2 = node2.getChildNodes();
- if (nodeList1.getLength() != nodeList2.getLength())
- {
- println("The number of children is different:");
- //println("Node 1: " + nodeList1.getLength());
- //println("Node 2: " + nodeList2.getLength());
- println("Node 1: " + node1.getNodeName());
- println("Node 2: " + node2.getNodeName());
- return false;
- }
-
- boolean result = true;
- int length = nodeList1.getLength();
- for (int i=0; i<length; i++)
- {
- result = compareNodes(nodeList1.item(i),nodeList2.item(i));
- if (!result)
- return false;
- }
- return true;
- }
-
- private void filterNonElementNodes(Node node)
- {
- Node firstChild = node.getFirstChild();
- while (firstChild.getNodeType() != Node.ELEMENT_NODE)
- {
- node.removeChild(firstChild);
- firstChild = node.getFirstChild();
- }
-
- Node sibling = firstChild.getNextSibling();
- Node deleteMe = null;
- while (sibling != null)
- {
- if (sibling.getNodeType() != Node.ELEMENT_NODE)
- {
- deleteMe = sibling;
- sibling = sibling.getNextSibling();
- node.removeChild(deleteMe);
- }
-
- }
- }
-
- private boolean compareAttributes(Node node1, Node node2)
- {
- NamedNodeMap nodeMap1 = node1.getAttributes();
- NamedNodeMap nodeMap2 = node2.getAttributes();
-
- if (nodeMap1 == null || nodeMap2 == null)
- {
- if (nodeMap1 == null && nodeMap2 == null)
- return true;
- else
- return false;
- }
-
- if (nodeMap1.getLength() != nodeMap2.getLength())
- {
- println("The number of attributes is different:");
- println("Node 1: " + node1.getNodeName());
- println("Node 2: " + node2.getNodeName());
- return false;
- }
-
- Node attrNode1 = null;
- Node attrNode2 = null;
- int length = nodeMap1.getLength();
- for (int i=0; i<length; i++)
- {
- attrNode1 = nodeMap1.item(i);
- attrNode2 = nodeMap2.getNamedItem(attrNode1.getNodeName());
- if (attrNode2 == null)
- {
- println("The attribute is not found in Node 2: " + attrNode1.getNodeName());
- println("Node 1: " + node1.getNodeName());
- println("Node 2: " + node2.getNodeName());
- return false;
- }
- else if (!attrNode1.getNodeValue().equals(attrNode2.getNodeValue()))
- {
- println("The attribute values are different:");
- println("Node 1: " + node1.getNodeName() + "," + attrNode1.getNodeValue());
- println("Node 2: " + node2.getNodeName() + "," + attrNode2.getNodeValue());
- return false;
- }
- }
- return true;
- }
-
- private void print(String s)
- {
- out.print(s);
- }
-
- private void println(String s)
- {
- out.println(s);
- }
-}
diff --git a/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/util/XSDSchemaLocationResolverAdapterFactory.java b/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/util/XSDSchemaLocationResolverAdapterFactory.java
deleted file mode 100644
index 5bbba8750..000000000
--- a/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/util/XSDSchemaLocationResolverAdapterFactory.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.tests.util;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-import org.eclipse.xsd.util.XSDSchemaLocationResolver;
-
-public class XSDSchemaLocationResolverAdapterFactory extends AdapterFactoryImpl
-{
- protected XSDSchemaLocationResolverImpl schemaLocator = new XSDSchemaLocationResolverImpl();
-
- public boolean isFactoryForType(Object type)
- {
- return type == XSDSchemaLocationResolver.class;
- }
-
- public Adapter adaptNew(Notifier target, Object type)
- {
- return schemaLocator;
- }
-}
diff --git a/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/util/XSDSchemaLocationResolverImpl.java b/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/util/XSDSchemaLocationResolverImpl.java
deleted file mode 100644
index 7a4387a09..000000000
--- a/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/util/XSDSchemaLocationResolverImpl.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.tests.util;
-
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDSchemaLocationResolver;
-import org.eclipse.xsd.util.XSDSchemaLocator;
-
-public class XSDSchemaLocationResolverImpl extends AdapterImpl implements XSDSchemaLocationResolver
-{
- public String resolveSchemaLocation(XSDSchema xsdSchema, String namespaceURI, String schemaLocationURI)
- {
- String baseLocation = xsdSchema.getSchemaLocation();
- return URIResolverPlugin.createResolver().resolve(baseLocation, namespaceURI, schemaLocationURI);
- }
-
- public boolean isAdatperForType(Object type)
- {
- return type == XSDSchemaLocator.class;
- }
-}
diff --git a/tests/org.eclipse.wst.wsdl.tests/test.xml b/tests/org.eclipse.wst.wsdl.tests/test.xml
deleted file mode 100644
index 3ae7ed8eb..000000000
--- a/tests/org.eclipse.wst.wsdl.tests/test.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0"?>
-
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <!-- <property name="eclipse-home" value="${basedir}\..\.." /> -->
-
- <echo message="basedir ${basedir}" />
- <echo message="eclipse place ${eclipse-home}" />
-
- <!-- sets the properties plugin-name, and library-file -->
- <property name="plugin-name" value="org.eclipse.wst.wsdl.tests" />
- <property name="library-file" value="${eclipse-home}/plugins/org.eclipse.test_3.1.0/library.xml" />
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp/>
- <delete>
- <fileset dir="${eclipse-home}" includes="org.eclipse.wst.wsdl.tests.*xml" />
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite">
- <property name="wst-folder" value="${eclipse-home}/wst_folder"/>
- <delete dir="${wst-folder}" quiet="true"/>
- <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="data-dir" value="${wst-folder}"/>
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname" value="org.eclipse.wst.wsdl.tests.AllTestCases" />
- <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/>
- </ant>
- </target>
-
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- <!--<delete dir="${workspace}" quiet="true" />-->
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init,suite,cleanup">
- <ant target="collect" antfile="${library-file}" dir="${eclipse-home}">
- <property name="includes" value="org.eclipse.wst.wsdl.tests.*xml" />
- <property name="output-file" value="${plugin-name}.xml" />
- </ant>
- </target>
-
-</project> \ No newline at end of file

Back to the top