Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorlauzond2005-04-20 16:22:36 +0000
committerlauzond2005-04-20 16:22:36 +0000
commit346a85837f001cf031ce7ead2bb901c4a047543d (patch)
treea9ef7f8a4bf9e68ee87ae1ff33b50c1339b0d26e /tests
parentdbda06694ec772d4ca1058ece52247c493acb7c9 (diff)
downloadwebtools.webservices-346a85837f001cf031ce7ead2bb901c4a047543d.tar.gz
webtools.webservices-346a85837f001cf031ce7ead2bb901c4a047543d.tar.xz
webtools.webservices-346a85837f001cf031ce7ead2bb901c4a047543d.zip
Initial Junit tests for WS-I component
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.wst.wsi.tests/.classpath7
-rw-r--r--tests/org.eclipse.wst.wsi.tests/.cvsignore4
-rw-r--r--tests/org.eclipse.wst.wsi.tests/.project42
-rw-r--r--tests/org.eclipse.wst.wsi.tests/META-INF/MANIFEST.MF20
-rw-r--r--tests/org.eclipse.wst.wsi.tests/build.properties9
-rw-r--r--tests/org.eclipse.wst.wsi.tests/plugin.xml6
-rw-r--r--tests/org.eclipse.wst.wsi.tests/src/org/eclipse/wst/wsi/tests/internal/CoreWSDLConformanceTest.java280
-rw-r--r--tests/org.eclipse.wst.wsi.tests/src/org/eclipse/wst/wsi/tests/internal/RegressionBucket.java31
-rw-r--r--tests/org.eclipse.wst.wsi.tests/src/org/eclipse/wst/wsi/tests/internal/WSDLConformanceAPTest.java27
-rw-r--r--tests/org.eclipse.wst.wsi.tests/src/org/eclipse/wst/wsi/tests/internal/WSDLConformanceSSBPTest.java26
-rw-r--r--tests/org.eclipse.wst.wsi.tests/src/org/eclipse/wst/wsi/tests/internal/WSITestsPlugin.java78
-rw-r--r--tests/org.eclipse.wst.wsi.tests/test.xml53
-rw-r--r--tests/org.eclipse.wst.wsi.tests/testResources/samples/wsdl/wsiSampleAppCatalog/testcase.xml11
-rw-r--r--tests/org.eclipse.wst.wsi.tests/testResources/samples/wsdl/wsiSampleAppCatalog/wsiSampleAppCatalog.wsdl17
-rw-r--r--tests/org.eclipse.wst.wsi.tests/testResources/samples/wsdl/wsiSampleAppManufacturer/testcase.xml10
-rw-r--r--tests/org.eclipse.wst.wsi.tests/testResources/samples/wsdl/wsiSampleAppManufacturer/wsiSampleAppManufacturer.wsdl26
-rw-r--r--tests/org.eclipse.wst.wsi.tests/testResources/samples/wsdl/wsiSampleAppWarehouse/testcase.xml10
-rw-r--r--tests/org.eclipse.wst.wsi.tests/testResources/samples/wsdl/wsiSampleAppWarehouse/wsiSampleAppWarehouse.wsdl20
18 files changed, 677 insertions, 0 deletions
diff --git a/tests/org.eclipse.wst.wsi.tests/.classpath b/tests/org.eclipse.wst.wsi.tests/.classpath
new file mode 100644
index 000000000..065ac06e1
--- /dev/null
+++ b/tests/org.eclipse.wst.wsi.tests/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/tests/org.eclipse.wst.wsi.tests/.cvsignore b/tests/org.eclipse.wst.wsi.tests/.cvsignore
new file mode 100644
index 000000000..ff8300b4c
--- /dev/null
+++ b/tests/org.eclipse.wst.wsi.tests/.cvsignore
@@ -0,0 +1,4 @@
+bin
+temp.folder
+wsi.tests.jar
+build.xml
diff --git a/tests/org.eclipse.wst.wsi.tests/.project b/tests/org.eclipse.wst.wsi.tests/.project
new file mode 100644
index 000000000..05183978a
--- /dev/null
+++ b/tests/org.eclipse.wst.wsi.tests/.project
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.wst.wsi.tests</name>
+ <comment></comment>
+ <projects>
+ <project>com.ibm.etools.wsdl</project>
+ <project>com.ibm.wsdl</project>
+ <project>org.apache.xerces</project>
+ <project>org.eclipse.core.resources</project>
+ <project>org.eclipse.core.runtime.compatibility</project>
+ <project>org.eclipse.emf.ecore</project>
+ <project>org.eclipse.ui</project>
+ <project>org.eclipse.xsd</project>
+ <project>org.junit</project>
+ </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>
+ <buildCommand>
+ <name>org.eclipse.wst.sse.core.structuredbuilder</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.wsi.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.wst.wsi.tests/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..dc17c47e5
--- /dev/null
+++ b/tests/org.eclipse.wst.wsi.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,20 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: WSI JUnit Test
+Bundle-SymbolicName: org.eclipse.wst.wsi.tests
+Bundle-Version: 1.0.0
+Bundle-ClassPath: wsi.tests.jar
+Bundle-Activator: org.eclipse.wst.wsi.tests.internal.WSITestsPlugin
+Bundle-Vendor: Eclipse
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.wst.wsi,
+ org.eclipse.core.resources,
+ org.junit,
+ org.wsdl4j,
+ org.eclipse.osgi,
+ org.eclipse.jdt.core,
+ org.eclipse.core.runtime,
+ org.eclipse.wst.command.env,
+ org.eclipse.wst.command.env.core
+Eclipse-AutoStart: true
+
diff --git a/tests/org.eclipse.wst.wsi.tests/build.properties b/tests/org.eclipse.wst.wsi.tests/build.properties
new file mode 100644
index 000000000..b57eaeaf5
--- /dev/null
+++ b/tests/org.eclipse.wst.wsi.tests/build.properties
@@ -0,0 +1,9 @@
+source.wsi.tests.jar = src/
+output.wsi.tests.jar = bin/
+bin.includes = plugin.xml,\
+ wsi.tests.jar,\
+ testResources/,\
+ test.xml,\
+ runtests.bat,\
+ META-INF/,\
+ META-INF/
diff --git a/tests/org.eclipse.wst.wsi.tests/plugin.xml b/tests/org.eclipse.wst.wsi.tests/plugin.xml
new file mode 100644
index 000000000..7bf65fb5f
--- /dev/null
+++ b/tests/org.eclipse.wst.wsi.tests/plugin.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+
+
+</plugin>
diff --git a/tests/org.eclipse.wst.wsi.tests/src/org/eclipse/wst/wsi/tests/internal/CoreWSDLConformanceTest.java b/tests/org.eclipse.wst.wsi.tests/src/org/eclipse/wst/wsi/tests/internal/CoreWSDLConformanceTest.java
new file mode 100644
index 000000000..e6b8ce05c
--- /dev/null
+++ b/tests/org.eclipse.wst.wsi.tests/src/org/eclipse/wst/wsi/tests/internal/CoreWSDLConformanceTest.java
@@ -0,0 +1,280 @@
+/*******************************************************************************
+ * Copyright (c) 2002-2005 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 - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.wsi.tests.internal;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import javax.wsdl.Binding;
+import javax.wsdl.Definition;
+import javax.wsdl.Message;
+import javax.wsdl.Port;
+import javax.wsdl.PortType;
+import javax.wsdl.Service;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLReader;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.eclipse.wst.wsi.internal.WSIPreferences;
+import org.eclipse.wst.wsi.internal.WSITestToolsProperties;
+import org.eclipse.wst.wsi.internal.analyzer.WSDLAnalyzer;
+import org.eclipse.wst.wsi.internal.report.AssertionError;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+import junit.framework.*;
+
+public class CoreWSDLConformanceTest extends TestCase
+{
+ public static final String WSDL_BASE_DIRECTORY = "testResources/samples/wsdl";
+ public static final String TEST_CASE_FILE = "testcase.xml";
+ public static final String WSDL_EXTENSION = ".wsdl";
+
+ public static final String TAD_ID_AP = "AP10";
+ public static final String TAD_ID_SSBP = "SSBP10";
+
+ protected String pluginURI = null;
+ protected String tadID = TAD_ID_AP;
+
+ public CoreWSDLConformanceTest(String name)
+ {
+ super(name);
+ pluginURI = WSITestsPlugin.getInstallURL();
+ }
+
+ protected void setup()
+ {
+
+ }
+
+ /**
+ * JUnit test: validate the wsdl document against the specified WS-I Profile.
+ * @param tad he WS-I Test Assertion Document
+ * @param testName the name of the test containing the wsdl document
+ */
+ protected void runConformanceWSDLTest(String testName, String tadID)
+ {
+ this.tadID = tadID;
+
+ assertNotNull("Problems determining base url", pluginURI);
+ String testDirectory = pluginURI + WSDL_BASE_DIRECTORY + "/" + testName;
+ String wsdlFile = "file://" + testDirectory + "/" + testName + WSDL_EXTENSION;
+ String testcaseFile = testDirectory + "/" + TEST_CASE_FILE;
+
+ // validate the WSDL document
+ WSDLAnalyzer analyzer = validateConformance(wsdlFile, tadID);
+ assertNotNull("Unknown problems during validation", analyzer);
+
+ // retrieve the expected assertion failures
+ List expectedErrors = getExpectedAssertionFailures(testcaseFile);
+ assertNotNull("Problems retrieving expected failures", expectedErrors);
+
+ // compare the actual errors with the expected errors
+ analyzeResults(analyzer.getAssertionErrors(), expectedErrors);
+ }
+
+ /**
+ * Validate the wsdl document against the specified WS-I Profile.
+ * @param tad the WS-I Test Assertion Document
+ * @param filename the wsdl document
+ * @return the WSDLAnalyzer object containing the validation results
+ */
+ protected WSDLAnalyzer validateConformance(String filename, String tadID)
+ {
+ WSDLAnalyzer analyzer = null;
+ try
+ {
+ WSIPreferences preferences = new WSIPreferences();
+ preferences.setComplianceLevel( WSITestToolsProperties.STOP_NON_WSI);
+ preferences.setTADFile(getTADURI(tadID));
+
+ analyzer = new WSDLAnalyzer(filename, preferences);
+ setConfigurations(filename, analyzer);
+
+ // run the conformance check and add errors and warnings as needed
+ analyzer.validateConformance();
+ }
+ catch (Exception e)
+ {
+ return null;
+ }
+ return analyzer;
+ }
+
+ /**
+ * Retrieve the expected assertion failures.
+ * @param filename - the location of the testcase.xml file.
+ * @return the expected assertion failures.
+ */
+ protected List getExpectedAssertionFailures(String filename)
+ {
+ List assertionFailures = new ArrayList();
+ try
+ {
+ DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ Document doc = builder.parse(filename);
+ NodeList list = doc.getElementsByTagName("assertion");
+ if (list != null)
+ for (int i=0; i<list.getLength(); i++)
+ {
+ Element element = (Element)list.item(i);
+ String tad = element.getAttribute("tadID");
+ if ((tad != null) && tad.equals(this.tadID))
+ assertionFailures.add(element.getAttribute("id"));
+ }
+ }
+ catch (Exception e)
+ {
+ assertionFailures = null;
+ }
+ return assertionFailures;
+ }
+
+ /**
+ * Compare the actual errors with the expected errors.
+ * @param errors the actual assertion failures
+ * @param expectedErrors the expected assertion failures
+ */
+ protected void analyzeResults(List errors, List expectedErrors)
+ {
+ List actualErrors = new ArrayList();
+ if ((errors != null) && (expectedErrors != null))
+ {
+ Iterator i = errors.iterator();
+ while (i.hasNext())
+ {
+ AssertionError e = (AssertionError)i.next();
+ String assertionId = e.getAssertionID();
+ actualErrors.add(assertionId);
+
+ if (!expectedErrors.contains(assertionId))
+ {
+ fail("Unexpected assertion failure: " + assertionId);
+ }
+ }
+
+ i = expectedErrors.iterator();
+ while (i.hasNext())
+ {
+ String assertionId = (String)i.next();
+
+ if (!actualErrors.contains(assertionId))
+ {
+ fail("Expected assertion failure: " + assertionId);
+ }
+ }
+ assertEquals(expectedErrors.size(), errors.size());
+ }
+ }
+
+ /**
+ * Gather configuration information from the WSDL file.
+ * @param fileName the wsdl location.
+ * @param a WSDLAnalyzer object containg configuration info.
+ */
+ protected void setConfigurations(String filename, WSDLAnalyzer analyzer)
+ {
+ try
+ {
+ WSDLFactory factory = WSDLFactory.newInstance();
+ WSDLReader reader = factory.newWSDLReader();
+ Definition definition = reader.readWSDL(filename);
+
+ String namespace = definition.getTargetNamespace();
+
+ // get all the collections we may need to validate
+ Collection services = definition.getServices().values();
+ Collection bindings = definition.getBindings().values();
+ Collection portTypes = definition.getPortTypes().values();
+ Collection messages = definition.getMessages().values();
+
+ // The WS-I conformance tools require that each service be analyzed separately.
+ // Get all the services and analyze them.
+ if (services != null && !services.isEmpty())
+ {
+ Iterator serviceIterator = services.iterator();
+
+ while (serviceIterator.hasNext())
+ {
+ Service service = (Service) serviceIterator.next();
+
+ String servicename = service.getQName().getLocalPart();
+
+ Collection ports = service.getPorts().values();
+ if (ports != null && !ports.isEmpty())
+ {
+ // The WS-I tools must be called once for each port within each service.
+ Iterator portIterator = ports.iterator();
+ while (portIterator.hasNext())
+ {
+ Port port = (Port) portIterator.next();
+ analyzer.addConfigurationToTest(servicename, namespace, port.getName(), WSDLAnalyzer.PORT);
+ }
+ }
+ // validate at the binding level - check for every binding
+ else if (bindings != null && !bindings.isEmpty())
+ {
+ Iterator bindingIterator = bindings.iterator();
+
+ while (bindingIterator.hasNext())
+ {
+ Binding binding = (Binding) bindingIterator.next();
+ String bindingname = binding.getQName().getLocalPart();
+ analyzer.addConfigurationToTest(null, namespace, bindingname, WSDLAnalyzer.BINDING);
+ }
+ }
+ // validate at the portType level - check for every portType
+ else if (portTypes != null && !portTypes.isEmpty())
+ {
+ Iterator portTypeIterator = portTypes.iterator();
+ while (portTypeIterator.hasNext())
+ {
+ PortType portType = (PortType) portTypeIterator.next();
+ String portTypename = portType.getQName().getLocalPart();
+ analyzer.addConfigurationToTest(null, namespace, portTypename, WSDLAnalyzer.PORTTYPE);
+ }
+ }
+ // validate at the message level - check for every message
+ else if (messages != null && !messages.isEmpty())
+ {
+ Iterator messageIterator = messages.iterator();
+ while (messageIterator.hasNext())
+ {
+ Message message = (Message) messageIterator.next();
+ String messagename = message.getQName().getLocalPart();
+ analyzer.addConfigurationToTest(null, namespace, messagename, WSDLAnalyzer.MESSAGE);
+ }
+ }
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ fail("Unexpected problems setting configurations");
+ }
+ }
+
+ /**
+ * Return the location of the given tad.
+ * @param tid the tad id.
+ * @return the location of the tad.
+ */
+ protected String getTADURI(String tid)
+ {
+ if (tid.equals(TAD_ID_AP))
+ return WSITestToolsProperties.AP_ASSERTION_FILE;
+ else
+ return WSITestToolsProperties.SSBP_ASSERTION_FILE;
+ }
+}
diff --git a/tests/org.eclipse.wst.wsi.tests/src/org/eclipse/wst/wsi/tests/internal/RegressionBucket.java b/tests/org.eclipse.wst.wsi.tests/src/org/eclipse/wst/wsi/tests/internal/RegressionBucket.java
new file mode 100644
index 000000000..07059b509
--- /dev/null
+++ b/tests/org.eclipse.wst.wsi.tests/src/org/eclipse/wst/wsi/tests/internal/RegressionBucket.java
@@ -0,0 +1,31 @@
+/* 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.wsi.tests.internal;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+/**
+ * JUnit tests that runs all of the tests implemented
+ * in this plugin.
+ *
+ * @author lauzond
+ */
+public class RegressionBucket extends TestSuite {
+
+ public static Test suite()
+ {
+ TestSuite suite= new TestSuite("Regression Bucket");
+ suite.addTest(new TestSuite(WSDLConformanceSSBPTest.class));
+ suite.addTest(new TestSuite(WSDLConformanceAPTest.class));
+
+ return suite;
+ }
+
+}
diff --git a/tests/org.eclipse.wst.wsi.tests/src/org/eclipse/wst/wsi/tests/internal/WSDLConformanceAPTest.java b/tests/org.eclipse.wst.wsi.tests/src/org/eclipse/wst/wsi/tests/internal/WSDLConformanceAPTest.java
new file mode 100644
index 000000000..cb1f8ecff
--- /dev/null
+++ b/tests/org.eclipse.wst.wsi.tests/src/org/eclipse/wst/wsi/tests/internal/WSDLConformanceAPTest.java
@@ -0,0 +1,27 @@
+/* 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.wsi.tests.internal;
+/**
+ * JUnit tests that test wsdl documents against
+ * the WS-I Attachments profile.
+ *
+ * @author lauzond
+ */
+public class WSDLConformanceAPTest extends CoreWSDLConformanceTest
+{
+ public WSDLConformanceAPTest(String name)
+ {
+ super(name);
+ }
+
+ public void test_wsiSampleAppCatalog() { runConformanceWSDLTest("wsiSampleAppCatalog", TAD_ID_AP); }
+ public void test_wsiSampleAppManufacturer() { runConformanceWSDLTest("wsiSampleAppManufacturer", TAD_ID_AP); }
+ public void test_wsiSampleAppWarehouse() { runConformanceWSDLTest("wsiSampleAppWarehouse", TAD_ID_AP); }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.wsi.tests/src/org/eclipse/wst/wsi/tests/internal/WSDLConformanceSSBPTest.java b/tests/org.eclipse.wst.wsi.tests/src/org/eclipse/wst/wsi/tests/internal/WSDLConformanceSSBPTest.java
new file mode 100644
index 000000000..ab38441a3
--- /dev/null
+++ b/tests/org.eclipse.wst.wsi.tests/src/org/eclipse/wst/wsi/tests/internal/WSDLConformanceSSBPTest.java
@@ -0,0 +1,26 @@
+/* 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.wsi.tests.internal;
+/**
+ * JUnit tests that test wsdl documents against
+ * the WS-I Simple Soap Binding profile.
+ *
+ * @author lauzond
+ */
+public class WSDLConformanceSSBPTest extends CoreWSDLConformanceTest
+{
+ public WSDLConformanceSSBPTest(String name)
+ {
+ super(name);
+ }
+ public void test_wsiSampleAppCatalog() { runConformanceWSDLTest("wsiSampleAppCatalog", TAD_ID_SSBP); }
+ public void test_wsiSampleAppManufacturer() { runConformanceWSDLTest("wsiSampleAppManufacturer", TAD_ID_SSBP); }
+ public void test_wsiSampleAppWarehouse() { runConformanceWSDLTest("wsiSampleAppWarehouse", TAD_ID_SSBP); }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.wsi.tests/src/org/eclipse/wst/wsi/tests/internal/WSITestsPlugin.java b/tests/org.eclipse.wst.wsi.tests/src/org/eclipse/wst/wsi/tests/internal/WSITestsPlugin.java
new file mode 100644
index 000000000..b0b975c03
--- /dev/null
+++ b/tests/org.eclipse.wst.wsi.tests/src/org/eclipse/wst/wsi/tests/internal/WSITestsPlugin.java
@@ -0,0 +1,78 @@
+/* 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.wsi.tests.internal;
+
+import java.io.IOException;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Plugin;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+
+/**
+* The main plugin class to be used in the desktop.
+*/
+public class WSITestsPlugin extends Plugin
+{
+ //The shared instance.
+ private static WSITestsPlugin plugin;
+ private static Bundle pluginBundle = null;
+
+ /**
+ * The constructor.
+ */
+ public WSITestsPlugin()
+ {
+ 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);
+ }
+
+ /**
+ * Returns the shared instance.
+ */
+ public static WSITestsPlugin getDefault()
+ {
+ return plugin;
+ }
+
+ /**
+ * 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.wsi.tests/test.xml b/tests/org.eclipse.wst.wsi.tests/test.xml
new file mode 100644
index 000000000..eb1631585
--- /dev/null
+++ b/tests/org.eclipse.wst.wsi.tests/test.xml
@@ -0,0 +1,53 @@
+<?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.wsi.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.wsi.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.wsi.tests.RegressionBucket" />
+ <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.wsi.tests.*xml" />
+ <property name="output-file" value="${plugin-name}.xml" />
+ </ant>
+ </target>
+
+</project> \ No newline at end of file
diff --git a/tests/org.eclipse.wst.wsi.tests/testResources/samples/wsdl/wsiSampleAppCatalog/testcase.xml b/tests/org.eclipse.wst.wsi.tests/testResources/samples/wsdl/wsiSampleAppCatalog/testcase.xml
new file mode 100644
index 000000000..6fd98fb11
--- /dev/null
+++ b/tests/org.eclipse.wst.wsi.tests/testResources/samples/wsdl/wsiSampleAppCatalog/testcase.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<testcase name="wsiSampleAppCatalog">
+ <description>
+ This is the WS-I Sample Application demonstrating attachment support.
+ This should validate against the WS-I Attachments Profile.
+ However, this should fail to conform to the WS-I Simple Soap Binding Profile.
+ </description>
+ <expectedFailures>
+ <assertion id="SSBP2403" tadID="SSBP10"/>
+ </expectedFailures>
+</testcase> \ No newline at end of file
diff --git a/tests/org.eclipse.wst.wsi.tests/testResources/samples/wsdl/wsiSampleAppCatalog/wsiSampleAppCatalog.wsdl b/tests/org.eclipse.wst.wsi.tests/testResources/samples/wsdl/wsiSampleAppCatalog/wsiSampleAppCatalog.wsdl
new file mode 100644
index 000000000..8dc297345
--- /dev/null
+++ b/tests/org.eclipse.wst.wsi.tests/testResources/samples/wsdl/wsiSampleAppCatalog/wsiSampleAppCatalog.wsdl
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions targetNamespace="http://tempuri.org/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:intf="http://www.ws-i.org/SampleApplications/SupplyChainManagement/2003-07/Catalog.wsdl"
+ xmlns:impl="http://www.ws-i.org/SampleApplications/SupplyChainManagement/2003-07/Catalog_Impl.wsdl"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <wsdl:import namespace="http://www.ws-i.org/SampleApplications/SupplyChainManagement/2003-07/Catalog.wsdl"
+ location="http://www.ws-i.org/SampleApplications/SupplyChainManagement/2003-07/Catalog.wsdl"/>
+ <wsdl:service name="CatalogService">
+ <wsdl:port name="Catalog" binding="intf:CatalogSoapBinding">
+ <wsdlsoap:address location="http://tempuri.org/CatalogService"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions> \ No newline at end of file
diff --git a/tests/org.eclipse.wst.wsi.tests/testResources/samples/wsdl/wsiSampleAppManufacturer/testcase.xml b/tests/org.eclipse.wst.wsi.tests/testResources/samples/wsdl/wsiSampleAppManufacturer/testcase.xml
new file mode 100644
index 000000000..fbadd93ef
--- /dev/null
+++ b/tests/org.eclipse.wst.wsi.tests/testResources/samples/wsdl/wsiSampleAppManufacturer/testcase.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<testcase name="wsiSampleAppManufacturer">
+ <description>
+ This is the WS-I Sample Application exercising the Manufacturer wsdl
+ in the WS-I Basic Profile.
+ This should validate against the WS-I Simple Soap Binding Profile.
+ This should also validate against the WS-I Attachments Profile.
+ </description>
+ <expectedFailures/>
+</testcase> \ No newline at end of file
diff --git a/tests/org.eclipse.wst.wsi.tests/testResources/samples/wsdl/wsiSampleAppManufacturer/wsiSampleAppManufacturer.wsdl b/tests/org.eclipse.wst.wsi.tests/testResources/samples/wsdl/wsiSampleAppManufacturer/wsiSampleAppManufacturer.wsdl
new file mode 100644
index 000000000..fed06795b
--- /dev/null
+++ b/tests/org.eclipse.wst.wsi.tests/testResources/samples/wsdl/wsiSampleAppManufacturer/wsiSampleAppManufacturer.wsdl
@@ -0,0 +1,26 @@
+<wsdl:definitions
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:impl="http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-10/Manufacturer_Impl.wsdl"
+ xmlns:intf="http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-10/Manufacturer.wsdl"
+ xmlns:ct="http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-08/Configuration.xsd"
+ xmlns:cfg="http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-08/Configuration.wsdl"
+ xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-10/Manufacturer.wsdl"
+ targetNamespace="http://tempuri.org/">
+
+ <wsdl:import location="http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-10/Manufacturer.wsdl"
+ namespace="http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-10/Manufacturer.wsdl"/>
+ <wsdl:import namespace="http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-08/Configuration.wsdl"
+ location="http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-08/Configuration.wsdl"/>
+
+ <wsdl:service name="TestService">
+ <wsdl:port binding="intf:ManufacturerSoapBinding" name="TestPort">
+ <wsdlsoap:address location="http://tempuri.org/TestService"/>
+ </wsdl:port>
+ </wsdl:service>
+
+</wsdl:definitions> \ No newline at end of file
diff --git a/tests/org.eclipse.wst.wsi.tests/testResources/samples/wsdl/wsiSampleAppWarehouse/testcase.xml b/tests/org.eclipse.wst.wsi.tests/testResources/samples/wsdl/wsiSampleAppWarehouse/testcase.xml
new file mode 100644
index 000000000..4a5ccea64
--- /dev/null
+++ b/tests/org.eclipse.wst.wsi.tests/testResources/samples/wsdl/wsiSampleAppWarehouse/testcase.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<testcase name="wsiSampleAppWarehouse">
+ <description>
+ This is the WS-I Sample Application exercising the Warehouse wsdl
+ in the WS-I Basic Profile.
+ This should validate against the WS-I Simple Soap Binding Profile.
+ This should also validate against the WS-I Attachments Profile.
+ </description>
+ <expectedFailures/>
+</testcase> \ No newline at end of file
diff --git a/tests/org.eclipse.wst.wsi.tests/testResources/samples/wsdl/wsiSampleAppWarehouse/wsiSampleAppWarehouse.wsdl b/tests/org.eclipse.wst.wsi.tests/testResources/samples/wsdl/wsiSampleAppWarehouse/wsiSampleAppWarehouse.wsdl
new file mode 100644
index 000000000..ebe0d22c4
--- /dev/null
+++ b/tests/org.eclipse.wst.wsi.tests/testResources/samples/wsdl/wsiSampleAppWarehouse/wsiSampleAppWarehouse.wsdl
@@ -0,0 +1,20 @@
+<wsdl:definitions
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:intf="http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-08/Warehouse.wsdl"
+ xmlns:man="http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-10/Manufacturer.wsdl"
+ xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+ targetNamespace="http://tempuri.org/">
+
+ <wsdl:import location="http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-10/Manufacturer.wsdl"
+ namespace="http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-10/Manufacturer.wsdl"/>
+ <wsdl:import location="http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-08/Warehouse.wsdl"
+ namespace="http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-08/Warehouse.wsdl"/>
+
+ <wsdl:service name="TestService">
+ <wsdl:port binding="intf:WarehouseSoapBinding" name="TestPort">
+ <wsdlsoap:address location="http://tempuri.org/TestService"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions> \ No newline at end of file

Back to the top