This commit was manufactured by cvs2svn to create tag 'R3_1_2'.
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.jst.ws.consumption.ui/META-INF/MANIFEST.MF
index 6e87dff..49c6b3c 100644
--- a/bundles/org.eclipse.jst.ws.consumption.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.jst.ws.consumption.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %PLUGIN_NAME
Bundle-SymbolicName: org.eclipse.jst.ws.consumption.ui; singleton:=true
-Bundle-Version: 1.1.104.qualifier
+Bundle-Version: 1.1.106.qualifier
Bundle-Activator: org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin
Bundle-Vendor: %PLUGIN_PROVIDER
Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/common/FacetOperationDelegate.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/common/FacetOperationDelegate.java
index 2048192..5abbc8c 100644
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/common/FacetOperationDelegate.java
+++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/common/FacetOperationDelegate.java
@@ -10,6 +10,7 @@
* yyyymmdd bug Email and other contact information
* -------- -------- -----------------------------------------------------------
* 20090303 242635 mahutch@ca.ibm.com - Mark Hutchinson, Remove unnecessary UI dependencies from org.eclipse.jst.ws.consumption
+ * 20090819 286874 zina@ca.ibm.com - Zina Mostafia
*******************************************************************************/
package org.eclipse.jst.ws.internal.consumption.ui.common;
@@ -21,12 +22,18 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jst.ws.internal.common.J2EEUtils;
import org.eclipse.jst.ws.internal.consumption.ConsumptionMessages;
import org.eclipse.jst.ws.internal.consumption.common.FacetUtils;
import org.eclipse.jst.ws.internal.consumption.common.IFacetOperationDelegate;
@@ -53,6 +60,7 @@
public void run(IProgressMonitor shellMonitor) throws InvocationTargetException, InterruptedException {
try {
fproject.modify(actions, shellMonitor);
+ fixEJBClassPath(fproject);
} catch (CoreException e) {
status[0] = getErrorStatusForAddingFacets(fproject.getProject().getName(), projectFacetVersions, e);
}
@@ -71,6 +79,7 @@
} else {
try {
fproject.modify(actions, null);
+ fixEJBClassPath(fproject);
} catch (CoreException e) {
status[0] = getErrorStatusForAddingFacets(fproject.getProject().getName(), projectFacetVersions, e);
}
@@ -79,6 +88,36 @@
return status[0];
}
+ private void fixEJBClassPath(IFacetedProject project) {
+ if (!J2EEUtils.isEJBComponent(project.getProject())) return;
+ IProject ejbProject = project.getProject();
+ IJavaProject javaProject = JavaCore.create(ejbProject);
+ Path projectRoot = new Path(Path.ROOT.append(new Path(ejbProject.getName())).toString());
+ IPath ejbModulePath = projectRoot.append("ejbModule");
+ try {
+ IClasspathEntry[] originalSet = javaProject.getRawClasspath();
+ boolean foundEJBModulEntry = false;
+ for (IClasspathEntry entry : originalSet) {
+ if (entry.getPath().equals(ejbModulePath))
+ foundEJBModulEntry = true;
+ }
+ if (!foundEJBModulEntry) {
+ IClasspathEntry[] newSet = new IClasspathEntry[originalSet.length + 1];
+ int i=0;
+
+ for (IClasspathEntry entry : originalSet) {
+ newSet[i++] = entry;
+ }
+ newSet[i] = JavaCore.newSourceEntry(ejbModulePath);
+ javaProject.setRawClasspath(newSet,null);
+ }
+ }
+ catch (Exception e) {
+ // TODO: handle exception
+ }
+
+ }
+
public IStatus createNewFacetedProject(final String projectName) {
final IStatus[] status = new IStatus[1];
status[0] = Status.OK_STATUS;
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/preferences/PersistentServerRuntimeContext.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/preferences/PersistentServerRuntimeContext.java
index 9e6eaa8..0163260 100644
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/preferences/PersistentServerRuntimeContext.java
+++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/preferences/PersistentServerRuntimeContext.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 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
@@ -11,11 +11,14 @@
* -------- -------- -----------------------------------------------------------
* 20080415 227152 makandre@ca.ibm.com - Andrew Mak, Need a way to specify a backup Web service runtime
* 20080918 247537 mahutch@ca.ibm.com - Mark Hutchinson, Update default server runtime to Tomcat 6
+ * 20090714 283399 ericdp@ca.ibm.com - Eric D. Peters, Web Services > Server & Runtime preference undefined
+ * 20091007 283399 ericdp@ca.ibm.com - Eric D. Peters, Web Services > Server & Runtime preference undefined
*******************************************************************************/
package org.eclipse.jst.ws.internal.consumption.ui.preferences;
import org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin;
+import org.eclipse.jst.ws.internal.consumption.ui.wsrt.WebServiceRuntimeExtensionUtils2;
import org.eclipse.wst.command.internal.env.context.PersistentContext;
@@ -44,15 +47,20 @@
//Defaults will be set via the .ini customization. They are hard coded to default values in the
//absence of a .ini file.
String serverDefault = getDefaultString(PREFERENCE_SERVER);
- if (serverDefault==null || serverDefault.length()==0)
+ if (serverDefault==null || serverDefault.length()==0 || WebServiceRuntimeExtensionUtils2.getServerLabelById(serverDefault)==null)
{
setDefault(PREFERENCE_SERVER, SERVER_FACTORY_ID_DEFAULT);
}
String runtimeDefault = getDefaultString(PREFERENCE_RUNTIME);
- if (runtimeDefault==null || runtimeDefault.length()==0)
+ if (WebServiceRuntimeExtensionUtils2.getRuntimeLabelById(runtimeDefault)==null)
+ //try again using fall back runtime
+ runtimeDefault = getDefaultString(FALLBACK_RUNTIME);
+ if (runtimeDefault==null || runtimeDefault.length()==0 || WebServiceRuntimeExtensionUtils2.getRuntimeLabelById(runtimeDefault)==null)
{
setDefault(PREFERENCE_RUNTIME, RUNTIME_ID_DEFAULT);
+ } else {
+ setDefault(PREFERENCE_RUNTIME, runtimeDefault);
}
}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/extensions/ClientExtensionDefaultingCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/extensions/ClientExtensionDefaultingCommand.java
index 592f39c..0e78537 100644
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/extensions/ClientExtensionDefaultingCommand.java
+++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/extensions/ClientExtensionDefaultingCommand.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 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
@@ -19,6 +19,7 @@
* 20080325 184761 gilberta@ca.ibm.com - Gilbert Andrews
* 20080506 227848 makandre@ca.ibm.com - Andrew Mak, Disabled "Run on Server" checkbox is in checked state
* 20080729 241275 ericdp@ca.ibm.com - Eric D. Peters, No Validation error generating Web Service client if dialog hidden
+ * 20090714 283312 ericdp@ca.ibm.com - Eric D. Peters, ANT Client gen- message missing server name subst. variable
*******************************************************************************/
package org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions;
@@ -612,6 +613,8 @@
}
if (noRuntimeInstalled){
String serverLabel = WebServiceRuntimeExtensionUtils2.getServerLabelById(serverId);
+ if (serverLabel == null) // Cannot translate from id to label, so let's just use the id
+ serverLabel = serverId;
status = StatusUtils.errorStatus(NLS.bind(ConsumptionUIMessages.MSG_ERROR_NO_SERVER_RUNTIME_INSTALLED, new String[] {serverLabel}));
env.getStatusHandler().reportError(status);
}
diff --git a/bundles/org.eclipse.jst.ws.consumption/META-INF/MANIFEST.MF b/bundles/org.eclipse.jst.ws.consumption/META-INF/MANIFEST.MF
index cd9a18b..d510ee2 100644
--- a/bundles/org.eclipse.jst.ws.consumption/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.jst.ws.consumption/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %PLUGIN_NAME
Bundle-SymbolicName: org.eclipse.jst.ws.consumption; singleton:=true
-Bundle-Version: 1.0.407.qualifier
+Bundle-Version: 1.0.408.qualifier
Bundle-ClassPath: .,
webserviceutils.jar
Bundle-Activator: org.eclipse.jst.ws.internal.consumption.plugin.WebServiceConsumptionPlugin
diff --git a/bundles/org.eclipse.jst.ws.consumption/webserviceutils/org/eclipse/jst/ws/util/SoapElementSaxHandler.java b/bundles/org.eclipse.jst.ws.consumption/webserviceutils/org/eclipse/jst/ws/util/SoapElementSaxHandler.java
index 26bbf6e..ac43cda 100644
--- a/bundles/org.eclipse.jst.ws.consumption/webserviceutils/org/eclipse/jst/ws/util/SoapElementSaxHandler.java
+++ b/bundles/org.eclipse.jst.ws.consumption/webserviceutils/org/eclipse/jst/ws/util/SoapElementSaxHandler.java
@@ -1,15 +1,16 @@
/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 2009 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
* yyyymmdd bug Email and other contact information
* -------- -------- -----------------------------------------------------------
* 20060131 123963 andyzhai@ca.ibm.com - Andy Zhai
+ * 20090806 285933 ericdp@ca.ibm.com - Eric D. Peters, SOAPElementSaxHandler to create text nodes results in null return for char size 1
*******************************************************************************/
package org.eclipse.jst.ws.util;
@@ -68,7 +69,7 @@
{
String str = String.valueOf(ch);
//Add non-trivial text as a text node
- if (length > 1)
+ if (length > 0)
{
try
{
diff --git a/bundles/org.eclipse.jst.ws.creation.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.jst.ws.creation.ui/META-INF/MANIFEST.MF
index 2af1cca..62a3d17 100644
--- a/bundles/org.eclipse.jst.ws.creation.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.jst.ws.creation.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %PLUGIN_NAME
Bundle-SymbolicName: org.eclipse.jst.ws.creation.ui; singleton:=true
-Bundle-Version: 1.0.408.qualifier
+Bundle-Version: 1.0.409.qualifier
Bundle-Activator: org.eclipse.jst.ws.internal.creation.ui.plugin.WebServiceCreationUIPlugin
Bundle-Vendor: %PLUGIN_PROVIDER
Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.jst.ws.creation.ui/plugin.xml b/bundles/org.eclipse.jst.ws.creation.ui/plugin.xml
index 9271f77..99c1b77 100644
--- a/bundles/org.eclipse.jst.ws.creation.ui/plugin.xml
+++ b/bundles/org.eclipse.jst.ws.creation.ui/plugin.xml
@@ -333,11 +333,7 @@
operation="org.eclipse.jst.ws.internal.creation.ui.widgets.ServerWizardWidgetOutputCommand"
property="ServiceTypeRuntimeServer"
transform="org.eclipse.jst.ws.internal.common.String2TypeRuntimeServerModifier"/>
- <map
- key="GenerateProxy"
- operation="org.eclipse.jst.ws.internal.creation.ui.widgets.ServerWizardWidgetOutputCommand"
- property="GenerateProxy"/>
- <map
+ <map
key="Service.RuntimeId"
operation="org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions.ServerExtensionDefaultingCommand"
property="ServiceTypeRuntimeServer"
diff --git a/bundles/org.eclipse.wst.ws.explorer/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.ws.explorer/META-INF/MANIFEST.MF
index ec6cfab..5ba2285 100644
--- a/bundles/org.eclipse.wst.ws.explorer/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.ws.explorer/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %PLUGIN_NAME
Bundle-SymbolicName: org.eclipse.wst.ws.explorer; singleton:=true
-Bundle-Version: 1.0.407.qualifier
+Bundle-Version: 1.0.408.qualifier
Bundle-Activator: org.eclipse.wst.ws.internal.explorer.plugin.ExplorerPlugin
Bundle-Vendor: %PLUGIN_PROVIDER
Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.wst.ws.explorer/src/org/eclipse/wst/ws/internal/explorer/platform/wsdl/transport/SOAPMessageProcessor.java b/bundles/org.eclipse.wst.ws.explorer/src/org/eclipse/wst/ws/internal/explorer/platform/wsdl/transport/SOAPMessageProcessor.java
index 0532112..af763ee 100644
--- a/bundles/org.eclipse.wst.ws.explorer/src/org/eclipse/wst/ws/internal/explorer/platform/wsdl/transport/SOAPMessageProcessor.java
+++ b/bundles/org.eclipse.wst.ws.explorer/src/org/eclipse/wst/ws/internal/explorer/platform/wsdl/transport/SOAPMessageProcessor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2009 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
@@ -11,6 +11,7 @@
* -------- -------- -----------------------------------------------------------
* 20070413 176493 makandre@ca.ibm.com - Andrew Mak, WSE: Make message/transport stack pluggable
* 20081020 251269 mahutch@ca.ibm.com - Mark Hutchinson, WSE Sends Wrong Namespace for child elements of the SOAP body
+ * 20091104 294260 mahutch@ca.ibm.com - Mark Hutchinson, WSE source view missing some namespace prefixes in SOAP response message
*******************************************************************************/
package org.eclipse.wst.ws.internal.explorer.platform.wsdl.transport;
@@ -357,7 +358,7 @@
for (int i = 0; i < instanceVector.size(); i++) {
Element element = (Element) instanceVector.get(i);
- if (!element.getTagName().equals(fragName)) {
+ if (!element.getLocalName().equals(fragName)) {
Document doc = element.getOwnerDocument();
NodeList children = element.getChildNodes();
NamedNodeMap attributes = element.getAttributes();
diff --git a/bundles/org.eclipse.wst.wsdl.validation/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.wsdl.validation/META-INF/MANIFEST.MF
index ef3ad14..cfbd48f 100644
--- a/bundles/org.eclipse.wst.wsdl.validation/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.wsdl.validation/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %_PLUGIN_NAME
Bundle-SymbolicName: org.eclipse.wst.wsdl.validation; singleton:=true
-Bundle-Version: 1.1.401.qualifier
+Bundle-Version: 1.1.402.qualifier
Bundle-Activator: org.eclipse.wst.wsdl.validation.internal.eclipse.ValidateWSDLPlugin
Bundle-Vendor: %_PROVIDER_NAME
Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/wsdl11/WSDL11BasicValidator.java b/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/wsdl11/WSDL11BasicValidator.java
index f99b09f..7c36a27 100644
--- a/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/wsdl11/WSDL11BasicValidator.java
+++ b/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/wsdl11/WSDL11BasicValidator.java
@@ -102,8 +102,6 @@
*/
public void validate(Object element, List parents, IWSDL11ValidationInfo valInfo)
{
- //this.validatorcontroller = validatorcontroller;
- //setDefaultResourceBundleIfNeeded(validatorcontroller);
Definition wsdlDefinition = (Definition)element;
validateTypes(wsdlDefinition, valInfo);
validateServices(wsdlDefinition, valInfo);
@@ -111,6 +109,13 @@
validatePortTypes(wsdlDefinition, valInfo);
validateMessages(wsdlDefinition, valInfo);
+ // The parents list is expected to be empty here, so simply add the definition
+ // being validated to the parents list, validate its extensibility elements,
+ // then remove it.
+
+ parents.add(wsdlDefinition);
+ validateExtensibilityElementList(parents, wsdlDefinition.getExtensibilityElements(), valInfo);
+ parents.remove(0);
}
/**
diff --git a/bundles/org.eclipse.wst.wsdl/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.wsdl/META-INF/MANIFEST.MF
index 7bb7b1b..2ba0029 100644
--- a/bundles/org.eclipse.wst.wsdl/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.wsdl/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.wst.wsdl; singleton:=true
-Bundle-Version: 1.2.0.qualifier
+Bundle-Version: 1.2.2.qualifier
Bundle-Activator: org.eclipse.wst.wsdl.WSDLPluginImplementation
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/BindingFaultImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/BindingFaultImpl.java
index 5a15ee4..04e892c 100644
--- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/BindingFaultImpl.java
+++ b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/BindingFaultImpl.java
@@ -299,14 +299,6 @@
super.handleUnreconciledElement(child, remainingModelObjects);
}
- protected void handleReconciliation(Collection remainingModelObjects)
- {
- for (Iterator i = remainingModelObjects.iterator(); i.hasNext();)
- {
- getEExtensibilityElements().remove(i.next());
- }
- }
-
public Collection getModelObjects(Object component)
{
BindingFault bindingFault = (BindingFault)component;
diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/BindingInputImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/BindingInputImpl.java
index 4398d1a..6c1d59b 100644
--- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/BindingInputImpl.java
+++ b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/BindingInputImpl.java
@@ -302,14 +302,6 @@
super.handleUnreconciledElement(child, remainingModelObjects);
}
- protected void handleReconciliation(Collection remainingModelObjects)
- {
- for (Iterator i = remainingModelObjects.iterator(); i.hasNext();)
- {
- getEExtensibilityElements().remove(i.next());
- }
- }
-
public Collection getModelObjects(Object component)
{
BindingInput bindingInput = (BindingInput)component;
diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/BindingOutputImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/BindingOutputImpl.java
index 92d37b2..6f16bcb 100644
--- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/BindingOutputImpl.java
+++ b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/BindingOutputImpl.java
@@ -302,14 +302,6 @@
super.handleUnreconciledElement(child, remainingModelObjects);
}
- protected void handleReconciliation(Collection remainingModelObjects)
- {
- for (Iterator i = remainingModelObjects.iterator(); i.hasNext();)
- {
- getEExtensibilityElements().remove(i.next());
- }
- }
-
public Collection getModelObjects(Object component)
{
BindingOutput bindingOutput = (BindingOutput)component;
diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/ExtensibleElementImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/ExtensibleElementImpl.java
index bbf9bba..c3c05c7 100644
--- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/ExtensibleElementImpl.java
+++ b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/ExtensibleElementImpl.java
@@ -12,6 +12,7 @@
import java.util.Collection;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -262,4 +263,22 @@
return getEnclosingDefinition() == null ? true : ((DefinitionImpl)getEnclosingDefinition()).getUseExtensionFactories();
}
+ /**
+ * Override this method if the remainingModelObjects contain elements that are not only ExtensibilityElement
+ */
+ protected void handleReconciliation(Collection remainingModelObjects)
+ {
+ super.handleReconciliation(remainingModelObjects);
+ Iterator iterator = remainingModelObjects.iterator();
+ List extensibilityElements = getExtensibilityElements();
+ while (iterator.hasNext())
+ {
+ Object modelObject = iterator.next();
+ if (modelObject instanceof ExtensibilityElement)
+ {
+ extensibilityElements.remove(modelObject);
+ }
+ }
+ }
+
} //ExtensibleElementImpl
diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/ImportImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/ImportImpl.java
index 9fd2590..017b596 100644
--- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/ImportImpl.java
+++ b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/ImportImpl.java
@@ -31,8 +31,14 @@
import org.eclipse.wst.wsdl.util.WSDLConstants;
import org.eclipse.wst.wsdl.util.WSDLResourceImpl;
import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
import org.eclipse.xsd.util.XSDResourceImpl;
import org.w3c.dom.Element;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.DefaultHandler;
+import org.xml.sax.helpers.XMLReaderFactory;
/**
@@ -510,7 +516,7 @@
try
{
InputStream inputStream = resourceSet.getURIConverter().createInputStream(uri);
- resolvedResource = resourceSet.createResource(uri);
+ resolvedResource = getResource(uri, resourceSet);
resolvedResource.load(inputStream, resourceSet.getLoadOptions());
}
catch (IOException exception)
@@ -586,4 +592,76 @@
}
return result;
}
+
+ private static String getRootElementName(String uri)
+ {
+ RootElementNameContentHandler handler = new RootElementNameContentHandler();
+ try
+ {
+ XMLReader reader = XMLReaderFactory.createXMLReader();
+ reader.setContentHandler(handler);
+ reader.parse(uri);
+ }
+ catch (Exception e)
+ {
+ // Explicitly ignore any exceptions.
+ }
+
+ return handler.rootElementName;
+ }
+
+ private static class RootElementNameContentHandler extends DefaultHandler
+ {
+ public String rootElementName;
+
+ public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
+ {
+ rootElementName = localName;
+
+ // Throw an exception to make the SAX Parser to stop parsing
+ throw new SAXException("SAXParser intentionally stopped"); //$NON-NLS-1$
+ }
+ }
+
+ private static final URI XSD_URI = URI.createURI("*.xsd"); //$NON-NLS-1$
+ private static final URI WSDL_URI = URI.createURI("*.wsdl"); //$NON-NLS-1$
+
+ private static Resource getResource(URI uri, ResourceSet resourceSet)
+ {
+ // Allow the resource set the first chance to create the resource based on
+ // the registered resource factories.
+
+ Resource resource = resourceSet.createResource(uri);
+
+ boolean isWsdlOrXsdResource = resource instanceof WSDLResourceImpl || resource instanceof XSDResourceImpl;
+
+ if (!isWsdlOrXsdResource)
+ {
+ // The URI was not mapped to a WSDL or XSD resource.
+ // Try to peek inside the resource to determine if its an XSD or WSDL document.
+
+ String rootElementName = getRootElementName(uri.toString());
+
+ if (rootElementName != null)
+ {
+ URI resourceURI = null;
+
+ if (XSDConstants.SCHEMA_ELEMENT_TAG.equals(rootElementName))
+ {
+ resourceURI = XSD_URI;
+ }
+ else if (WSDLConstants.DEFINITION_ELEMENT_TAG.equals(rootElementName))
+ {
+ resourceURI = WSDL_URI;
+ }
+
+ if (resourceURI != null)
+ {
+ resource = resourceSet.createResource(resourceURI);
+ resource.setURI(uri);
+ }
+ }
+ }
+ return resource;
+ }
} //ImportImpl
diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/MessageImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/MessageImpl.java
index fa61571..f02876e 100644
--- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/MessageImpl.java
+++ b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/MessageImpl.java
@@ -31,6 +31,7 @@
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.wst.wsdl.Definition;
+import org.eclipse.wst.wsdl.ExtensibilityElement;
import org.eclipse.wst.wsdl.Message;
import org.eclipse.wst.wsdl.Part;
import org.eclipse.wst.wsdl.WSDLPackage;
@@ -431,13 +432,28 @@
protected void remove(Object component, Object modelObject)
{
+ List list = getList(component, modelObject);
+ if (list != null)
+ {
+ list.remove(modelObject);
+ }
+ }
+
+ private List getList(Object component, Object modelObject)
+ {
+ List result = null;
Message message = (Message)component;
if (modelObject instanceof Part)
{
- message.getEParts().remove(modelObject);
- // message.getEParts().clear();
+ result = message.getEParts();
}
- }
+ else if (modelObject instanceof ExtensibilityElement)
+ {
+ result = getExtensibilityElements();
+ }
+
+ return result;
+ }
//
// For reconciliation: Model -> DOM
diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/MessageReferenceImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/MessageReferenceImpl.java
index 069b0ef..1d400bb 100644
--- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/MessageReferenceImpl.java
+++ b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/MessageReferenceImpl.java
@@ -267,10 +267,6 @@
super.handleUnreconciledElement(child, remainingModelObjects);
}
- protected void handleReconciliation(Collection remainingModelObjects)
- {
- }
-
//
// For reconciliation: Model -> DOM
//
diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/OperationImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/OperationImpl.java
index 08afb2a..9ba8b32 100644
--- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/OperationImpl.java
+++ b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/OperationImpl.java
@@ -33,6 +33,7 @@
import org.eclipse.emf.ecore.util.EObjectResolvingEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.wst.wsdl.Definition;
+import org.eclipse.wst.wsdl.ExtensibilityElement;
import org.eclipse.wst.wsdl.Fault;
import org.eclipse.wst.wsdl.Input;
import org.eclipse.wst.wsdl.Operation;
@@ -913,6 +914,10 @@
{
operation.getEFaults().remove(modelObject);
}
+ else if (modelObject instanceof ExtensibilityElement)
+ {
+ getExtensibilityElements().remove(modelObject);
+ }
}
public Collection getModelObjects(Object component)
diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/PortImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/PortImpl.java
index e9be965..015eb62 100644
--- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/PortImpl.java
+++ b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/PortImpl.java
@@ -298,14 +298,6 @@
super.handleUnreconciledElement(child, remainingModelObjects);
}
- protected void handleReconciliation(Collection remainingModelObjects)
- {
- for (Iterator i = remainingModelObjects.iterator(); i.hasNext();)
- {
- getEExtensibilityElements().remove(i.next());
- }
- }
-
public Collection getModelObjects(Object component)
{
Port port = (Port)component;
diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/PortTypeImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/PortTypeImpl.java
index f9484dd..6805bac 100644
--- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/PortTypeImpl.java
+++ b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/PortTypeImpl.java
@@ -28,6 +28,7 @@
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.wst.wsdl.Definition;
+import org.eclipse.wst.wsdl.ExtensibilityElement;
import org.eclipse.wst.wsdl.Operation;
import org.eclipse.wst.wsdl.PortType;
import org.eclipse.wst.wsdl.WSDLFactory;
@@ -458,6 +459,11 @@
{
result = portType.getEOperations();
}
+ else if (modelObject instanceof ExtensibilityElement)
+ {
+ result = getExtensibilityElements();
+ }
+
return result;
}
diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/TypesImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/TypesImpl.java
index 150fa3f..feead2b 100644
--- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/TypesImpl.java
+++ b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/TypesImpl.java
@@ -170,20 +170,10 @@
protected void handleReconciliation(Collection remainingModelObjects)
{
- for (Iterator i = remainingModelObjects.iterator(); i.hasNext();)
- {
- remove(this, i.next());
- }
+ super.handleReconciliation(remainingModelObjects);
((DefinitionImpl)getEnclosingDefinition()).reconcileReferences(true);
}
- protected void remove(Object component, Object modelObject)
- {
- Types types = (Types)component;
- List list = types.getEExtensibilityElements();
- list.remove(modelObject);
- }
-
public Collection getModelObjects(Object component)
{
Types types = (Types)component;
diff --git a/features/org.eclipse.wst.ws_core.feature/feature.xml b/features/org.eclipse.wst.ws_core.feature/feature.xml
index cee1879..e3e4c36 100644
--- a/features/org.eclipse.wst.ws_core.feature/feature.xml
+++ b/features/org.eclipse.wst.ws_core.feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.wst.ws_core.feature"
label="%featureName"
- version="3.1.0.qualifier"
+ version="3.1.2.qualifier"
provider-name="%providerName">
<description>
diff --git a/features/org.eclipse.wst.ws_sdk.feature/feature.xml b/features/org.eclipse.wst.ws_sdk.feature/feature.xml
index 8c94c4f..c1cd9fa 100644
--- a/features/org.eclipse.wst.ws_sdk.feature/feature.xml
+++ b/features/org.eclipse.wst.ws_sdk.feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.wst.ws_sdk.feature"
label="%featureName"
- version="3.1.0.qualifier"
+ version="3.1.2.qualifier"
provider-name="%providerName">
<description>
diff --git a/features/org.eclipse.wst.ws_tests.feature/feature.xml b/features/org.eclipse.wst.ws_tests.feature/feature.xml
index 03ec766..44ef113 100644
--- a/features/org.eclipse.wst.ws_tests.feature/feature.xml
+++ b/features/org.eclipse.wst.ws_tests.feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.wst.ws_tests.feature"
label="%featureName"
- version="3.0.201.qualifier"
+ version="3.0.302.qualifier"
provider-name="%providerName">
<description>
diff --git a/features/org.eclipse.wst.ws_ui.feature/feature.xml b/features/org.eclipse.wst.ws_ui.feature/feature.xml
index 0c507dd..0cca355 100644
--- a/features/org.eclipse.wst.ws_ui.feature/feature.xml
+++ b/features/org.eclipse.wst.ws_ui.feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.wst.ws_ui.feature"
label="%featureName"
- version="3.1.0.qualifier"
+ version="3.1.2.qualifier"
provider-name="%providerName">
<description>
diff --git a/tests/org.eclipse.wst.ws.service.policy.test/.classpath b/tests/org.eclipse.wst.ws.service.policy.test/.classpath
deleted file mode 100644
index 472ee29..0000000
--- a/tests/org.eclipse.wst.ws.service.policy.test/.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.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/tests/org.eclipse.wst.ws.service.policy.test/.project b/tests/org.eclipse.wst.ws.service.policy.test/.project
deleted file mode 100644
index bb3e1a4..0000000
--- a/tests/org.eclipse.wst.ws.service.policy.test/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.ws.service.policy.test</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.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/tests/org.eclipse.wst.ws.service.policy.test/META-INF/MANIFEST.MF b/tests/org.eclipse.wst.ws.service.policy.test/META-INF/MANIFEST.MF
deleted file mode 100644
index 2156a3a..0000000
--- a/tests/org.eclipse.wst.ws.service.policy.test/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,18 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %PLUGIN_NAME
-Bundle-SymbolicName: org.eclipse.wst.ws.service.policy.test;singleton:=true
-Bundle-Version: 1.0.0
-Bundle-Activator: org.eclipse.wst.ws.service.policy.test.ServicePolicytTestActivator
-Bundle-Vendor: %PLUGIN_PROVIDER
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.core.runtime,
- org.junit4,
- org.eclipse.wst.ws.service.policy,
- org.eclipse.wst.ws.service.policy.ui,
- org.eclipse.core.resources,
- org.eclipse.wst.ws,
- org.eclipse.core.expressions,
- org.eclipse.ui
-Eclipse-LazyStart: true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/tests/org.eclipse.wst.ws.service.policy.test/about.html b/tests/org.eclipse.wst.ws.service.policy.test/about.html
deleted file mode 100644
index 6eafb63..0000000
--- a/tests/org.eclipse.wst.ws.service.policy.test/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, 2008</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.ws.service.policy.test/build.properties b/tests/org.eclipse.wst.ws.service.policy.test/build.properties
deleted file mode 100644
index 68f43c7..0000000
--- a/tests/org.eclipse.wst.ws.service.policy.test/build.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.properties,\
- plugin.xml,\
- about.html
-src.includes = META-INF/,\
- plugin.properties,\
- plugin.xml,\
- src/
diff --git a/tests/org.eclipse.wst.ws.service.policy.test/plugin.properties b/tests/org.eclipse.wst.ws.service.policy.test/plugin.properties
deleted file mode 100644
index c6f290e..0000000
--- a/tests/org.eclipse.wst.ws.service.policy.test/plugin.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-###############################################################################
-# Copyright (c) 2007 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
-# yyyymmdd bug Email and other contact information
-# -------- -------- -----------------------------------------------------------
-# 20071024 196997 pmoogk@ca.ibm.com - Peter Moogk
-###############################################################################
-
-#
-# Messages in plugin.xml.
-#
-PLUGIN_NAME=Service policy
-PLUGIN_PROVIDER=Eclipse.org
diff --git a/tests/org.eclipse.wst.ws.service.policy.test/plugin.xml b/tests/org.eclipse.wst.ws.service.policy.test/plugin.xml
deleted file mode 100644
index 352183a..0000000
--- a/tests/org.eclipse.wst.ws.service.policy.test/plugin.xml
+++ /dev/null
@@ -1,224 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<plugin>
-
- <!-- We need this plugin to be loaded at startup time so that the
- ServicePolicyPropertyTester class will always be loaded. If this is
- not done then the Service Policy project property page will appear
- on all project property pages until the plugin has been loaded.
- -->
- <extension point="org.eclipse.ui.startup"/>
-
- <extension point="org.eclipse.core.expressions.propertyTesters">
- <propertyTester
- id="org.eclipse.wst.ws.service.policy.test.service.ws.service.policy.foo"
- type="org.eclipse.core.resources.IProject"
- namespace="org.eclipse.wst.ws.service.policy.test.service.ws.service.policy.foo"
- properties="projectHasFOOfiles"
- class="org.eclipse.wst.ws.service.policy.test.internal.properties.FOOFilePropertyTester">
- </propertyTester>
- </extension>
- <extension point="org.eclipse.wst.ws.service.policy.servicepolicy">
- <servicePolicy>
- <enablement>
- <test property="org.eclipse.wst.ws.service.policy.test.service.ws.service.policy.foo.projectHasFOOfiles"/>
- </enablement>
- <policy parentPolicyId="someparent" id="id1" enumListId="org.eclipse.wst.service.policy.errorWarnEnum" mutable="true">
- <descriptor shortName="id1 shortName" description="id1 description"/>
- <relationship enumList="org.eclipse.wst.warn org.eclipse.wst.error">
- <targetPolicy id="id2"
- itemList="org.eclipse.wst.warn org.eclipse.wst.error"/>
- <targetPolicy id="id3"
- itemList="org.eclipse.wst.warn"/>
- <targetPolicy id="id4"
- itemList="org.eclipse.wst.error"/>
- <targetPolicy id="id22"
- itemList="org.eclipse.wst.warn2 org.eclipse.wst.error2"/>
- <targetPolicy id="id_boolean2"
- itemList="org.eclipse.wst.false"/>
- </relationship>
-
- <relationship enumList="org.eclipse.wst.ignore">
- <targetPolicy id="id3"
- itemList="org.eclipse.wst.warn org.eclipse.wst.error"/>
- </relationship>
- </policy>
-
- <policy id="someparent">
- <descriptor longName="parent longname" />
- </policy>
-
- <policy id="id2" parentPolicyId="someparent"
- enumListId="org.eclipse.wst.service.policy.errorWarnEnum"
- defaultEnumId="org.eclipse.wst.warn"
- mutable="true">
- <descriptor shortName="id2 shortname" contextHelpId="somecontextid.A001"/>
- <state key="id2_key" value="id2_value" />
- </policy>
-
- <policy id="id3" parentPolicyId="id2"
- enumListId="org.eclipse.wst.service.policy.errorWarnEnum"
- defaultEnumId="org.eclipse.wst.error">
- <descriptor shortName="id3 short name"/>
- </policy>
- <policy id="id5" parentPolicyId="id3"
- enumListId="org.eclipse.wst.service.policy.errorWarnEnum"
- defaultEnumId="org.eclipse.wst.error">
- <descriptor shortName="id5 short name"/>
- <relationship enumList="org.eclipse.wst.warn">
- <targetPolicy id="id2"
- itemList="org.eclipse.wst.ignore"/>
- </relationship>
- </policy>
- <policy id="id6" parentPolicyId="id5"
- enumListId="org.eclipse.wst.service.policy.errorWarnEnum"
- defaultEnumId="org.eclipse.wst.error">
- <descriptor shortName="id6 short name"/>
- </policy>
-
- <policy id="id10" parentPolicyId="id22"
- enumListId="org.eclipse.wst.service.policy.errorWarnEnum"
- defaultEnumId="org.eclipse.wst.error">
- <descriptor shortName="id10 short name"/>
- </policy>
- <policy id="id11" parentPolicyId="id10"
- enumListId="org.eclipse.wst.service.policy.errorWarnEnum"
- defaultEnumId="org.eclipse.wst.error">
- <descriptor shortName="id11 short name"/>
- <relationship enumList="org.eclipse.wst.warn">
- <targetPolicy id="id2"
- itemList="org.eclipse.wst.ignore"/>
- </relationship>
- </policy>
- <policy id="id12" parentPolicyId="id11"
- enumListId="org.eclipse.wst.service.policy.errorWarnEnum"
- defaultEnumId="org.eclipse.wst.error">
- <descriptor shortName="id12 short name"/>
- </policy>
-
- <policy id="id7" parentPolicyId="id2"
- enumListId="org.eclipse.wst.service.policy.errorWarnEnum"
- defaultEnumId="org.eclipse.wst.error">
- <descriptor shortName="id7 short name"/>
- </policy>
- <policy id="id8" parentPolicyId="id7"
- enumListId="org.eclipse.wst.service.policy.errorWarnEnum"
- defaultEnumId="org.eclipse.wst.error">
- <descriptor shortName="id8 short name"/>
- </policy>
- <policy id="id9" parentPolicyId="id8"
- enumListId="org.eclipse.wst.service.policy.errorWarnEnum"
- defaultEnumId="org.eclipse.wst.error">
- <descriptor shortName="id9 short name"/>
- <relationship enumList="org.eclipse.wst.warn">
- <targetPolicy id="id2"
- itemList="org.eclipse.wst.ignore"/>
- </relationship>
- </policy>
-
- <policy id="id4" enumListId="org.eclipse.wst.service.policy.errorWarnEnum">
- <descriptor shortName="id4 short name" longName="id4 long name" />
- </policy>
-
- <policy id="id22" parentPolicyId="someparent"
- enumListId="org.eclipse.wst.service.policy.errorWarnEnum2"
- defaultEnumId="org.eclipse.wst.warn2">
- <descriptor shortName="id22 shortname" contextHelpId="somecontextid.A001"/>
- </policy>
-
- <policy id="id_boolean1" enumListId="org.eclipse.wst.service.policy.booleanEnum"
- defaultEnumId="org.eclipse.wst.true">
- <descriptor shortName="boolean1 short name" longName="boolean1 long name" />
- </policy>
-
- <policy id="id_boolean2" enumListId="org.eclipse.wst.service.policy.booleanEnum"
- defaultEnumId="org.eclipse.wst.true">
- <descriptor shortName="boolean2 short name" longName="boolean2 long name" />
- </policy>
- <enumeration id="org.eclipse.wst.service.policy.errorWarnEnum2"
- default="org.eclipse.wst.ignore2">
- <item id="org.eclipse.wst.ignore2"
- shortName="IGNORE SHORTNAME2" longName="IGNORE LONGNAME2" />
- <item id="org.eclipse.wst.warn2"
- shortName="WARN SHORTNAME2" longName="WARN LONGNAME2" />
- <item id="org.eclipse.wst.error2"
- shortName="ERROR SHORTNAME2" longName="ERROR LONGNAME2" />
- </enumeration>
-
- </servicePolicy>
- </extension>
-
- <extension point="org.eclipse.wst.ws.service.policy.ui.servicepolicyui">
- <servicePolicyUI>
- <operation id="service.ui.operation1" defaultdata="true"
- policyPattern="id3|id2" >
- <descriptor shortName="UI policy1 short name" longName="UI policy1 long name" />
- <enumeration id="org.eclipse.wst.service.policy.errorWarnEnum"/>
- <enabled multiselect="true"/>
- </operation>
-
- <operation id="service.ui.operation2" defaultdata="true"
- policyPattern="id\d.*" >
- <descriptor shortName="UI policy2 short name" longName="UI policy2 long name" />
- <enumeration id="org.eclipse.wst.service.policy.errorWarnEnum"/>
- <enabled multiselect="false"/>
- </operation>
-
- <operation id="service.ui.operation3" defaultdata="false"
- policyPattern="id4" >
- <descriptor shortName="UI policy3 short name" longName="UI policy3 long name" />
- <enumeration id="org.eclipse.wst.service.policy.errorWarnEnum"/>
- </operation>
-
- <operation id="service.ui.operation4" defaultdata="true"
- policyPattern="id1|id2|id3" >
- <descriptor shortName="UI policy4 short name" longName="UI policy4 long name" />
- <enumeration id="org.eclipse.wst.service.policy.errorWarnEnum"/>
- </operation>
-
- <operation id="service.ui.operation5" defaultdata="false"
- policyPattern="id22" workspaceOnly="true">
- <descriptor shortName="UI policy5 short name" longName="UI policy5 long name" />
- <enumeration id="org.eclipse.wst.service.policy.errorWarnEnum2"/>
- </operation>
- <operation id="service.ui.boolean.operation1" defaultdata="false"
- policyPattern="id_bool.*" workspaceOnly="true">
- <descriptor shortName="UI policy2b bool short name" longName="UI policy2b bool long name" />
- <selection/>
- </operation>
-
- <operation id="service.ui.boolean.operation2" defaultdata="true"
- policyPattern="id_boolean2" >
- <descriptor shortName="UI policy3 bool short name" longName="UI policy3 bool long name" />
- <selection icon="true"/>
- </operation>
-
- <operation id="service.ui.complex.operation1" defaultdata="false"
- policyPattern="someparent| id4" >
- <descriptor shortName="UI policy4 short name" longName="UI policy4 long name" />
- <complex launchClass="org.eclipse.wst.ws.service.policy.test.TestLaunchClass"/>
- <enabled multiselect="true"
- enabledClass="org.eclipse.wst.ws.service.policy.test.TestEnabledClass"/>
- </operation>
-
- <quickFix pluginId="org.eclipse.wst.ws.service.policy.test"
- code="1">
- <action class="org.eclipse.wst.ws.service.policy.test.action1">
- <descriptor shortName="quick fix 1 for code 1"/>
- </action>
- <action class="org.eclipse.wst.ws.service.policy.test.action2">
- <descriptor shortName="quick fix 2 for code 1"/>
- </action>
- </quickFix>
-
- <quickFix pluginId="org.eclipse.wst.ws.service.policy.test"
- code="2">
- <action class="org.eclipse.wst.ws.service.policy.test.action3">
- <descriptor shortName="quick fix 1 for code 2"/>
- </action>
- </quickFix>
- </servicePolicyUI>
- </extension>
-
-</plugin>
diff --git a/tests/org.eclipse.wst.ws.service.policy.test/src/org/eclipse/wst/ws/service/policy/test/MainTester.java b/tests/org.eclipse.wst.ws.service.policy.test/src/org/eclipse/wst/ws/service/policy/test/MainTester.java
deleted file mode 100644
index 4bb903b..0000000
--- a/tests/org.eclipse.wst.ws.service.policy.test/src/org/eclipse/wst/ws/service/policy/test/MainTester.java
+++ /dev/null
@@ -1,401 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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
- * yyyymmdd bug Email and other contact information
- * -------- -------- -----------------------------------------------------------
- * 20071024 196997 pmoogk@ca.ibm.com - Peter Moogk
- *******************************************************************************/
-package org.eclipse.wst.ws.service.policy.test;
-
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.wst.ws.internal.preferences.PersistentWSIAPContext;
-import org.eclipse.wst.ws.internal.preferences.PersistentWSIContext;
-import org.eclipse.wst.ws.internal.preferences.PersistentWSISSBPContext;
-import org.eclipse.wst.ws.service.policy.IDescriptor;
-import org.eclipse.wst.ws.service.policy.IPolicyEnumerationList;
-import org.eclipse.wst.ws.service.policy.IPolicyRelationship;
-import org.eclipse.wst.ws.service.policy.IPolicyStateEnum;
-import org.eclipse.wst.ws.service.policy.IServicePolicy;
-import org.eclipse.wst.ws.service.policy.IStateEnumerationItem;
-import org.eclipse.wst.ws.service.policy.ServicePolicyActivator;
-import org.eclipse.wst.ws.service.policy.ServicePolicyPlatform;
-import org.eclipse.wst.ws.service.policy.listeners.IPolicyChildChangeListener;
-
-@SuppressWarnings("restriction") //$NON-NLS-1$
-public class MainTester extends TestCase
-{
-
- public void testExtensions()
- {
- ServicePolicyPlatform platform = ServicePolicyPlatform.getInstance();
- List<IServicePolicy> policyList = platform.getRootServicePolicies( null );
-
- for( IServicePolicy policy : policyList )
- {
- displayPolicyNode( policy );
- }
-
- System.out.println( "" ); //$NON-NLS-1$
- System.out.println("=========== Enumerations:" ); //$NON-NLS-1$
-
- List<IStateEnumerationItem> errorWarnEnum = platform.getStateEnumeration( "org.eclipse.wst.service.policy.errorWarnEnum" ); //$NON-NLS-1$
-
- System.out.println( "Enum id: " + "org.eclipse.wst.service.policy.errorWarnEnum" ); //$NON-NLS-1$ //$NON-NLS-2$
-
- for( IStateEnumerationItem item : errorWarnEnum )
- {
- System.out.println( " id: " + item.getId() ); //$NON-NLS-1$
- System.out.println( " shortname: " + item.getShortName() ); //$NON-NLS-1$
- System.out.println( " longname: " + item.getLongName() ); //$NON-NLS-1$
- System.out.println( " isDefault: " + item.isDefault() ); //$NON-NLS-1$
- System.out.println( "" ); //$NON-NLS-1$
- }
- }
-
- private void displayPolicyNode( IServicePolicy policy )
- {
- IServicePolicy parentPolicy = policy.getParentPolicy();
- IDescriptor descriptor = policy.getDescriptor();
-
- System.out.println( "Found policy: " + policy.getId() + " parentid:" + (parentPolicy == null ? "null" : parentPolicy.getId()) ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- for( IServicePolicy child : policy.getChildren() )
- {
- System.out.println( " child id: " + child.getId() ); //$NON-NLS-1$
- }
-
- List<IPolicyRelationship> relationships = policy.getRelationships();
-
- System.out.println( " relationships:" ); //$NON-NLS-1$
-
- for( IPolicyRelationship relationship : relationships )
- {
- IPolicyEnumerationList sourceList = relationship.getPolicyEnumerationList();
- List<IPolicyEnumerationList> targetList = relationship.getRelatedPolicies();
- List<IStateEnumerationItem> sourceEnumList = sourceList.getEnumerationList();
-
- for( IStateEnumerationItem item : sourceEnumList )
- {
- System.out.println( " " + item.getId() ); //$NON-NLS-1$
- }
-
- for( IPolicyEnumerationList policyEnumList : targetList )
- {
- String policyId = policyEnumList.getPolicy().getId();
- List<IStateEnumerationItem> targetEnumList = policyEnumList.getEnumerationList();
-
- System.out.println( " policy id: " + policyId ); //$NON-NLS-1$
-
- for( IStateEnumerationItem targetItem : targetEnumList )
- {
- System.out.println( " target enum id: " + targetItem.getId() ); //$NON-NLS-1$
- }
- }
- }
-
- System.out.println( "Descriptor:" ); //$NON-NLS-1$
- System.out.println( " short name: " + descriptor.getShortName() ); //$NON-NLS-1$
- System.out.println( " long name: " + descriptor.getLongName() ); //$NON-NLS-1$
- System.out.println( " description: " + descriptor.getDescription() ); //$NON-NLS-1$
- System.out.println( " context help: " + descriptor.getContextHelpId() ); //$NON-NLS-1$
- System.out.println( " icon path: " + descriptor.getIconPath() ); //$NON-NLS-1$
- System.out.println( " icon path bundle id: " + descriptor.getIconBundleId() ); //$NON-NLS-1$
- System.out.println( "===" ); //$NON-NLS-1$
- System.out.println( "" ); //$NON-NLS-1$
-
- for( IServicePolicy child : policy.getChildren() )
- {
- displayPolicyNode( child );
- }
- }
-
- public void testEnumerations()
- {
- ServicePolicyPlatform platform = ServicePolicyPlatform.getInstance();
- IServicePolicy id1 = platform.getServicePolicy( "id1" ); //$NON-NLS-1$
- IServicePolicy id2 = platform.getServicePolicy( "id2" ); //$NON-NLS-1$
- IServicePolicy id3 = platform.getServicePolicy( "id3" ); //$NON-NLS-1$
- IPolicyStateEnum state1 = id1.getPolicyStateEnum();
- IPolicyStateEnum state2 = id2.getPolicyStateEnum();
- IPolicyStateEnum state3 = id3.getPolicyStateEnum();
- IStateEnumerationItem item1 = state1.getCurrentItem();
- IStateEnumerationItem item2 = state2.getCurrentItem();
- IStateEnumerationItem item3 = state3.getCurrentItem();
-
- assertTrue( "Unexpected shortname:" + item1.getShortName(), item1.getShortName().equals( "ignore") ); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue( "Unexpected shortname:" + item2.getShortName(), item2.getShortName().equals( "warn") ); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue( "Unexpected shortname:" + item3.getShortName(), item3.getShortName().equals( "error") ); //$NON-NLS-1$ //$NON-NLS-2$
- System.out.println( "id1 value:" + item1.getShortName() ); //$NON-NLS-1$
- System.out.println( "id2 value:" + item2.getShortName() ); //$NON-NLS-1$
- }
-
- public void testPolicyState()
- {
- ServicePolicyPlatform platform = ServicePolicyPlatform.getInstance();
- IServicePolicy id1 = platform.getServicePolicy( "id1" ); //$NON-NLS-1$
- IPolicyStateEnum enumState = id1.getPolicyStateEnum();
- IStateEnumerationItem enumItem = enumState.getCurrentItem();
- String ignoreId = "org.eclipse.wst.ignore"; //$NON-NLS-1$
- String warnId = "org.eclipse.wst.warn"; //$NON-NLS-1$
- String errorId = "org.eclipse.wst.error"; //$NON-NLS-1$
-
- assertTrue( "Default enum not:" + ignoreId, enumItem.getId().equals( ignoreId ) ); //$NON-NLS-1$
-
- enumState.setCurrentItem( warnId );
- enumItem = enumState.getCurrentItem();
-
- assertTrue( "Updated enum not:" + warnId, enumItem.getId().equals( warnId ) ); //$NON-NLS-1$
-
- platform.discardChanges();
- enumItem = enumState.getCurrentItem();
-
- assertTrue( "Discard enum not:" + ignoreId, enumItem.getId().equals( ignoreId ) ); //$NON-NLS-1$
-
- enumState.setCurrentItem( errorId );
- enumItem = enumState.getCurrentItem();
- assertTrue( "Error enum not:" + errorId, enumItem.getId().equals( errorId ) ); //$NON-NLS-1$
-
- platform.commitChanges();
- enumItem = enumState.getCurrentItem();
- assertTrue( "Error enum not:" + errorId, enumItem.getId().equals( errorId ) ); //$NON-NLS-1$
-
- IEclipsePreferences projectPreferences = new InstanceScope().getNode( ServicePolicyActivator.PLUGIN_ID );
-
- try
- {
- String[] keys = projectPreferences.keys();
-
- for( String key : keys )
- {
- System.out.println( "Key=" + key + " value=" + projectPreferences.get( key, "" )); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- }
- catch( Exception exc )
- {
- assertTrue( "Exception thrown" + exc.getMessage(), false ); //$NON-NLS-1$
- }
- }
-
- public void testUniqueIds()
- {
- ServicePolicyPlatform platform = ServicePolicyPlatform.getInstance();
- IServicePolicy policy = platform.createServicePolicy( null, "someid", null, null ); //$NON-NLS-1$
-
- assertTrue( policy.getId().equals( "someid" ) ); //$NON-NLS-1$
-
- policy = platform.createServicePolicy( null, "someid", null, null ); //$NON-NLS-1$
- assertTrue( policy.getId().equals( "someid1" ) ); //$NON-NLS-1$
-
- policy = platform.createServicePolicy( null, "someid", null, null ); //$NON-NLS-1$
- assertTrue( policy.getId().equals( "someid2" ) ); //$NON-NLS-1$
-
- policy = platform.createServicePolicy( null, "someid1", null, null ); //$NON-NLS-1$
- assertTrue( policy.getId().equals( "someid3" ) ); //$NON-NLS-1$
-
- policy = platform.createServicePolicy( null, "some55id5", null, null ); //$NON-NLS-1$
- assertTrue( policy.getId().equals( "some55id5" ) ); //$NON-NLS-1$
-
- policy = platform.createServicePolicy( null, "some55id5", null, null ); //$NON-NLS-1$
- assertTrue( policy.getId().equals( "some55id1" ) ); //$NON-NLS-1$
- }
-
-
- @SuppressWarnings("restriction") //$NON-NLS-1$
- public void testOldWSIContext()
- {
- ServicePolicyPlatform platform = ServicePolicyPlatform.getInstance();
- IServicePolicy apPolicy = platform.getServicePolicy( "org.eclipse.wst.ws.service.policy.ui.servicepols.wsiprofilecomp.wsiap" ); //$NON-NLS-1$
- IPolicyStateEnum apState = apPolicy.getPolicyStateEnum();
- IServicePolicy ssbpPolicy = platform.getServicePolicy( "org.eclipse.wst.ws.service.policy.ui.servicepols.wsiprofilecomp.wsissbp" ); //$NON-NLS-1$
- PersistentWSIAPContext apContext = new PersistentWSIAPContext();
- PersistentWSISSBPContext ssbpContext = new PersistentWSISSBPContext();
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IProject project = root.getProject("TestProject"); //$NON-NLS-1$
- String item = null;
-
- try
- {
- project.create(new NullProgressMonitor());
- }
- catch( CoreException exc )
- {
- assertTrue( "Core exception:" + exc.getMessage(), false ); //$NON-NLS-1$
- }
-
- IPolicyStateEnum apProjState = apPolicy.getPolicyStateEnum( project );
- IPolicyStateEnum ssbpProjState = ssbpPolicy.getPolicyStateEnum( project );
-
- // Ensure that project preferences are gotten from the workspace
- apState.setCurrentItem( "org.eclipse.wst.sug.ignore" ); //$NON-NLS-1$
- platform.commitChanges();
- apProjState.setCurrentItem( "org.eclipse.wst.sug.suggest" ); //$NON-NLS-1$
- item = apProjState.getCurrentItem().getId();
- assertTrue( "Ap value not ignore, but got " + item, item.equals("org.eclipse.wst.sug.ignore")); //$NON-NLS-1$ //$NON-NLS-2$
-
- apState.setCurrentItem( "org.eclipse.wst.sug.require" ); //$NON-NLS-1$
- platform.commitChanges();
- apProjState.setCurrentItem( "org.eclipse.wst.sug.ignore" ); //$NON-NLS-1$
- item = apProjState.getCurrentItem().getId();
- assertTrue( "Ap value not require, but got " + item, item.equals("org.eclipse.wst.sug.require")); //$NON-NLS-1$ //$NON-NLS-2$
-
- platform.setProjectPreferencesEnabled( project , true );
- item = apProjState.getCurrentItem().getId();
- assertTrue( "Ap value not ingore, but got " + item, item.equals("org.eclipse.wst.sug.ignore")); //$NON-NLS-1$ //$NON-NLS-2$
-
- platform.commitChanges( project );
- item = apProjState.getCurrentItem().getId();
- assertTrue( "Ap value not ingore, but got " + item, item.equals("org.eclipse.wst.sug.ignore")); //$NON-NLS-1$ //$NON-NLS-2$
-
- String apContextValue = apContext.getProjectWSICompliance( project );
- assertTrue( "Ap context not ignore, but " + apContextValue, apContextValue.equals( PersistentWSIContext.IGNORE_NON_WSI ) ); //$NON-NLS-1$
-
- apState.setCurrentItem( "org.eclipse.wst.sug.suggest" ); //$NON-NLS-1$
- platform.commitChanges();
- apContextValue = apContext.getProjectWSICompliance( project );
- assertTrue( "Ap context not ignore, but " + apContextValue, apContextValue.equals( PersistentWSIContext.IGNORE_NON_WSI ) ); //$NON-NLS-1$
-
- platform.setProjectPreferencesEnabled( project, false );
- apContextValue = apContext.getProjectWSICompliance( project );
- assertTrue( "Ap context not ignore, but " + apContextValue, apContextValue.equals( PersistentWSIContext.WARN_NON_WSI ) ); //$NON-NLS-1$
-
- apProjState.setCurrentItem( "org.eclipse.wst.sug.require" ); //$NON-NLS-1$
- platform.commitChanges( project );
- apContextValue = apContext.getProjectWSICompliance( project );
- assertTrue( "Ap context not suggest, but " + apContextValue, apContextValue.equals( PersistentWSIContext.WARN_NON_WSI ) ); //$NON-NLS-1$
-
- platform.setProjectPreferencesEnabled( project, true );
- apContextValue = apContext.getProjectWSICompliance( project );
- assertTrue( "Ap context not require, but " + apContextValue, apContextValue.equals( PersistentWSIContext.STOP_NON_WSI ) ); //$NON-NLS-1$
-
- ssbpProjState.setCurrentItem( "org.eclipse.wst.sug.suggest" ); //$NON-NLS-1$
-
- String ssbpContextValue = ssbpContext.getProjectWSICompliance( project );
-
- assertTrue( "Ap context not require, but " + apContextValue, apContextValue.equals( PersistentWSIContext.STOP_NON_WSI ) ); //$NON-NLS-1$
- assertTrue( "SSBP context not suggest, but " + ssbpContextValue, ssbpContextValue.equals( PersistentWSIContext.WARN_NON_WSI ) ); //$NON-NLS-1$
-
- ssbpProjState.setCurrentItem( "org.eclipse.wst.sug.require" ); //$NON-NLS-1$
-
- ssbpContextValue = ssbpContext.getProjectWSICompliance( project );
- assertTrue( "Ap context not require, but " + apContextValue, apContextValue.equals( PersistentWSIContext.STOP_NON_WSI ) ); //$NON-NLS-1$
- assertTrue( "SSBP context not require, but " + ssbpContextValue, ssbpContextValue.equals( PersistentWSIContext.STOP_NON_WSI ) ); //$NON-NLS-1$
-
- }
-
- public void testMutable()
- {
- ServicePolicyPlatform platform = ServicePolicyPlatform.getInstance();
- IServicePolicy apPolicy = platform.getServicePolicy( "org.eclipse.wst.ws.service.policy.ui.servicepols.wsiprofilecomp.wsiap" ); //$NON-NLS-1$
- IServicePolicy ssbpPolicy = platform.getServicePolicy( "org.eclipse.wst.ws.service.policy.ui.servicepols.wsiprofilecomp.wsissbp" ); //$NON-NLS-1$
- IServicePolicy wsiPolicy = platform.getServicePolicy( "org.eclipse.wst.ws.service.policy.ui.servicepols.wsiprofilecomp" ); //$NON-NLS-1$
-
- assertTrue( "Root wsi policy is mutable", !wsiPolicy.getPolicyState().isMutable() ); //$NON-NLS-1$
- assertTrue( "Ap policy is not mutable", apPolicy.getPolicyState().isMutable() ); //$NON-NLS-1$
- assertTrue( "SSBP policy is not mutable", ssbpPolicy.getPolicyState().isMutable() ); //$NON-NLS-1$
- }
-
- public void testChildChangeListeners()
- {
- ServicePolicyPlatform platform = ServicePolicyPlatform.getInstance();
- ChildChangeListener listener = new ChildChangeListener();
-
- platform.addChildChangeListener(listener, false );
- listener.childEventOccured = false;
- listener.isAdded = false;
-
- IServicePolicy parent = platform.createServicePolicy( null, "parent_id1", null, null );
-
- assertTrue( "Listener not called", listener.childEventOccured );
- assertTrue( "Listener not added", listener.isAdded );
-
- listener.childEventOccured = false;
- listener.isAdded = false;
- IServicePolicy child1 = platform.createServicePolicy( parent, "parent_id1", null, null );
-
- assertTrue( "Listener not called", listener.childEventOccured );
- assertTrue( "Listener not added", listener.isAdded );
-
- listener.childEventOccured = false;
- listener.isAdded = false;
- listener.count = 0;
- IServicePolicy child2 = platform.createServicePolicy( child1, "parent_id1", null, null );
- IServicePolicy child3 = platform.createServicePolicy( child2, "parent_id1", null, null );
-
- assertTrue( "Listener not called", listener.childEventOccured );
- assertTrue( "Listener not added", listener.isAdded );
- assertTrue( "Listener count not 2", listener.count == 2 );
-
- listener.childEventOccured = false;
- listener.isAdded = true;
- listener.count = 0;
-
- child2.removeChild( child3 );
-
- assertTrue( "Listener not called", listener.childEventOccured );
- assertTrue( "Listener not removed", !listener.isAdded );
- assertTrue( "Listener count not 1", listener.count == 1 );
-
- listener.childEventOccured = false;
- listener.isAdded = true;
- listener.count = 0;
-
- // Should remove parent, child1, and child2
- platform.removeServicePolicy( parent );
-
- assertTrue( "Listener not called", listener.childEventOccured );
- assertTrue( "Listener not removed", !listener.isAdded );
- assertTrue( "Listener count not 3", listener.count == 3 );
-
- platform.removeChildChangeListener( listener, false );
-
- listener.childEventOccured = false;
- listener.isAdded = true;
- listener.count = 0;
-
- parent = platform.createServicePolicy( null, "parent_id1", null, null );
- child1 = platform.createServicePolicy( parent, "parent_id1", null, null );
-
- assertTrue( "Listener called", !listener.childEventOccured );
- assertTrue( "Listener isadded changed", listener.isAdded );
- assertTrue( "Listener count not 0", listener.count == 0 );
- }
-
- public void testState()
- {
- ServicePolicyPlatform platform = ServicePolicyPlatform.getInstance();
- IServicePolicy id2 = platform.getServicePolicy( "id2" );
- String value = id2.getPolicyState().getValue( "id2_key" );
-
- assertTrue( "Expected state value to be id2_value.", value.equals( "id2_value" ) );
- }
-
- private class ChildChangeListener implements IPolicyChildChangeListener
- {
- public boolean childEventOccured = false;
- public boolean isAdded = false;
- public int count = 0;;
-
- public void childChange(List<IServicePolicy> childList, List<Boolean> addedList)
- {
- childEventOccured = true;
- isAdded = addedList.get(0);
- count++;
- }
- }
-}
diff --git a/tests/org.eclipse.wst.ws.service.policy.test/src/org/eclipse/wst/ws/service/policy/test/MainUITester.java b/tests/org.eclipse.wst.ws.service.policy.test/src/org/eclipse/wst/ws/service/policy/test/MainUITester.java
deleted file mode 100644
index 7bae559..0000000
--- a/tests/org.eclipse.wst.ws.service.policy.test/src/org/eclipse/wst/ws/service/policy/test/MainUITester.java
+++ /dev/null
@@ -1,333 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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
- * yyyymmdd bug Email and other contact information
- * -------- -------- -----------------------------------------------------------
- * 20071024 196997 pmoogk@ca.ibm.com - Peter Moogk
- *******************************************************************************/
-package org.eclipse.wst.ws.service.policy.test;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Vector;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.ws.service.policy.IDescriptor;
-import org.eclipse.wst.ws.service.policy.IFilter;
-import org.eclipse.wst.ws.service.policy.IServicePolicy;
-import org.eclipse.wst.ws.service.policy.ServicePolicyPlatform;
-import org.eclipse.wst.ws.service.policy.ui.IPolicyOperation;
-import org.eclipse.wst.ws.service.policy.ui.IQuickFixAction;
-import org.eclipse.wst.ws.service.policy.ui.IQuickFixActionInfo;
-import org.eclipse.wst.ws.service.policy.ui.ServicePolicyPlatformUI;
-import org.eclipse.wst.ws.service.policy.ui.utils.ActivityUtils;
-
-public class MainUITester extends TestCase
-{
-
- public void testExtensions()
- {
- ServicePolicyPlatformUI platformUI = ServicePolicyPlatformUI.getInstance();
- List<IPolicyOperation> operations = platformUI.getAllOperations();
-
- for( IPolicyOperation operation : operations )
- {
- displayOperation( operation );
- }
- }
-
- public void testOperationCache()
- {
- ServicePolicyPlatform platform = ServicePolicyPlatform.getInstance();
- ServicePolicyPlatformUI platformUI = ServicePolicyPlatformUI.getInstance();
- IServicePolicy id1 = platform.getServicePolicy( "id1" ); //$NON-NLS-1$
- IServicePolicy id2 = platform.getServicePolicy( "id2" ); //$NON-NLS-1$
- IServicePolicy id3 = platform.getServicePolicy( "id3" ); //$NON-NLS-1$
- IServicePolicy id4 = platform.getServicePolicy( "id4" ); //$NON-NLS-1$
- IPolicyOperation op1_id2 = platformUI.getOperation( id2, "service.ui.operation1" ); //$NON-NLS-1$
- IPolicyOperation op1_id3 = platformUI.getOperation( id3, "service.ui.operation1" ); //$NON-NLS-1$
- IPolicyOperation op2_id1 = platformUI.getOperation( id1, "service.ui.operation2" ); //$NON-NLS-1$
- IPolicyOperation op2_id2 = platformUI.getOperation( id2, "service.ui.operation2" ); //$NON-NLS-1$
- IPolicyOperation op2_id3 = platformUI.getOperation( id3, "service.ui.operation2" ); //$NON-NLS-1$
- IPolicyOperation op2_id4 = platformUI.getOperation( id4, "service.ui.operation2" ); //$NON-NLS-1$
- IPolicyOperation op3_id4 = platformUI.getOperation( id4, "service.ui.operation3" ); //$NON-NLS-1$
- IPolicyOperation op4_id1 = platformUI.getOperation( id1, "service.ui.operation4" ); //$NON-NLS-1$
- IPolicyOperation op4_id2 = platformUI.getOperation( id2, "service.ui.operation4" ); //$NON-NLS-1$
- IPolicyOperation op4_id3 = platformUI.getOperation( id3, "service.ui.operation4" ); //$NON-NLS-1$
-
- List<IPolicyOperation> list1 = platformUI.getOperations( id1, true );
- List<IPolicyOperation> list2 = platformUI.getOperations( id2, true );
- List<IPolicyOperation> list3 = platformUI.getOperations( id3, true );
- List<IPolicyOperation> list4 = platformUI.getOperations( id4, true );
-
- System.out.println( "\nDisplay lists" ); //$NON-NLS-1$
- displayList( "List1", list1 ); //$NON-NLS-1$
- displayList( "List2", list2 ); //$NON-NLS-1$
- displayList( "List3", list3 ); //$NON-NLS-1$
- displayList( "List4", list4 ); //$NON-NLS-1$
-
- checkContents( "List1", list1, new IPolicyOperation[]{ op2_id1, op4_id1 } ); //$NON-NLS-1$
- checkContents( "List2", list2, new IPolicyOperation[]{ op1_id2, op2_id2, op4_id2 } ); //$NON-NLS-1$
- checkContents( "List3", list3, new IPolicyOperation[]{ op1_id3, op2_id3, op4_id3 } ); //$NON-NLS-1$
- checkContents( "List4", list4, new IPolicyOperation[]{ op2_id4, op3_id4 } ); //$NON-NLS-1$
- }
-
- public void testEnabledOperations()
- {
- ServicePolicyPlatform platform = ServicePolicyPlatform.getInstance();
- ServicePolicyPlatformUI platformUI = ServicePolicyPlatformUI.getInstance();
- IServicePolicy id1 = platform.getServicePolicy( "id1" ); //$NON-NLS-1$
- IServicePolicy id2 = platform.getServicePolicy( "id2" ); //$NON-NLS-1$
- IServicePolicy id3 = platform.getServicePolicy( "id3" ); //$NON-NLS-1$
- IServicePolicy id4 = platform.getServicePolicy( "id4" ); //$NON-NLS-1$
- List<IServicePolicy> policyList1 = new Vector<IServicePolicy>();
- List<IServicePolicy> policyList2 = new Vector<IServicePolicy>();
- IPolicyOperation op1 = platformUI.getOperation( id4, "service.ui.operation3" ); //$NON-NLS-1$
-
- policyList1.add( id1 );
- policyList1.add( id2 );
- policyList1.add( id3 );
- policyList1.add( id4 );
- policyList2.add( id4 );
-
- assertTrue( "Expected operation to not be enabled", !op1.isEnabled( policyList1 ) ); //$NON-NLS-1$
- assertTrue( "Expected operation to be enabled", op1.isEnabled( policyList2 ) ); //$NON-NLS-1$
- }
-
- public void testQuickFixActions()
- {
- ServicePolicyPlatform platform = ServicePolicyPlatform.getInstance();
- ServicePolicyPlatformUI platformUI = ServicePolicyPlatformUI.getInstance();
- IServicePolicy id1 = platform.getServicePolicy( "id1" ); //$NON-NLS-1$
- IStatus status1 = new Status( IStatus.ERROR, "org.eclipse.wst.ws.service.policy.test", 1, "some error", null ); //$NON-NLS-1$ //$NON-NLS-2$
- IStatus status2 = new Status( IStatus.ERROR, "org.eclipse.wst.ws.service.policy.test", 2, "some error", null ); //$NON-NLS-1$ //$NON-NLS-2$
- List<IQuickFixActionInfo> fixList1 = platformUI.getQuickFixes( status1 );
- List<IQuickFixActionInfo> fixList2 = platformUI.getQuickFixes( status2 );
-
- assertTrue( "Expecting two quick fixes", fixList1.size() == 2 ); //$NON-NLS-1$
- assertTrue( "Expection one quick fix", fixList2.size() == 1 ); //$NON-NLS-1$
-
- for( IQuickFixActionInfo actionInfo : fixList1 )
- {
- IQuickFixAction action = actionInfo.getAction();
- id1.setStatus( status1 );
-
- assertTrue( "Status is not OK", !id1.getStatus().isOK() ); //$NON-NLS-1$
- action.action( id1 );
- assertTrue( "Status is Ok ", id1.getStatus().isOK() ); //$NON-NLS-1$
- }
-
- for( IQuickFixActionInfo actionInfo : fixList2 )
- {
- IQuickFixAction action = actionInfo.getAction();
- id1.setStatus( status2 );
-
- assertTrue( "Status is not OK", !id1.getStatus().isOK() ); //$NON-NLS-1$
- action.action( id1 );
- assertTrue( "Status is Ok ", id1.getStatus().isOK() ); //$NON-NLS-1$
- }
- }
-
- public void testActivitiesFilter()
- {
- IFilter activitiesFilter = ActivityUtils.getCurrentActivitiesFilter();
- ServicePolicyPlatform platform = ServicePolicyPlatform.getInstance();
- List<IServicePolicy> policyList = platform.getRootServicePolicies( activitiesFilter );
-
- displayPolicies( policyList );
- }
-
- @SuppressWarnings("unchecked")
- public void testGetOperationsList()
- {
- ServicePolicyPlatform platform = ServicePolicyPlatform.getInstance();
- ServicePolicyPlatformUI platformUI = ServicePolicyPlatformUI.getInstance();
- IServicePolicy id1 = platform.getServicePolicy( "id1" ); //$NON-NLS-1$
- IServicePolicy id2 = platform.getServicePolicy( "id2" ); //$NON-NLS-1$
- IServicePolicy id3 = platform.getServicePolicy( "id3" ); //$NON-NLS-1$
- IServicePolicy id4 = platform.getServicePolicy( "id4" ); //$NON-NLS-1$
- IPolicyOperation op1_id2 = platformUI.getOperation( id2, "service.ui.operation1" ); //$NON-NLS-1$
- IPolicyOperation op1_id3 = platformUI.getOperation( id3, "service.ui.operation1" ); //$NON-NLS-1$
- IPolicyOperation op2_id1 = platformUI.getOperation( id1, "service.ui.operation2" ); //$NON-NLS-1$
- IPolicyOperation op2_id2 = platformUI.getOperation( id2, "service.ui.operation2" ); //$NON-NLS-1$
- IPolicyOperation op2_id3 = platformUI.getOperation( id3, "service.ui.operation2" ); //$NON-NLS-1$
- IPolicyOperation op2_id4 = platformUI.getOperation( id4, "service.ui.operation2" ); //$NON-NLS-1$
- IPolicyOperation op3_id4 = platformUI.getOperation( id4, "service.ui.operation3" ); //$NON-NLS-1$
- IPolicyOperation op4_id1 = platformUI.getOperation( id1, "service.ui.operation4" ); //$NON-NLS-1$
- IPolicyOperation op4_id2 = platformUI.getOperation( id2, "service.ui.operation4" ); //$NON-NLS-1$
- IPolicyOperation op4_id3 = platformUI.getOperation( id3, "service.ui.operation4" ); //$NON-NLS-1$
- List<IServicePolicy> idList1 = null;
- List<IServicePolicy> idList2 = null;
- List<IServicePolicy> idList3 = null;
- List<IServicePolicy> idList4 = null;
-
- List<List<IPolicyOperation>> checkList1 = null;
- List<List<IPolicyOperation>> checkList2 = null;
- List<List<IPolicyOperation>> checkList3 = null;
- List<List<IPolicyOperation>> checkList4 = null;
-
- checkList1 = ll( l(op2_id1), l(op4_id1) );
- checkList2 = ll( l(op1_id2), l(op2_id1, op2_id2), l(op4_id1, op4_id2) );
- checkList3 = ll( l(op1_id2, op1_id3), l(op2_id1, op2_id2, op2_id3), l(op4_id1, op4_id2, op4_id3) );
- checkList4 = ll( l(op1_id2, op1_id3), l(op2_id1, op2_id2, op2_id3, op2_id4), l(op3_id4), l(op4_id1, op4_id2, op4_id3) );
-
- idList1 = Arrays.asList( new IServicePolicy[]{ id1 } );
- idList2 = Arrays.asList( new IServicePolicy[]{ id1, id2 } );
- idList3 = Arrays.asList( new IServicePolicy[]{ id1, id2, id3 } );
- idList4 = Arrays.asList( new IServicePolicy[]{ id1, id2, id3, id4 } );
-
- List<List<IPolicyOperation>> opList1 = platformUI.getOperationsList( idList1, true );
- List<List<IPolicyOperation>> opList2 = platformUI.getOperationsList( idList2, true );
- List<List<IPolicyOperation>> opList3 = platformUI.getOperationsList( idList3, true );
- List<List<IPolicyOperation>> opList4 = platformUI.getOperationsList( idList4, true );
-
- verifyLists( "List1", opList1, checkList1 );
- verifyLists( "List2", opList2, checkList2 );
- verifyLists( "List3", opList3, checkList3 );
- verifyLists( "List4", opList4, checkList4 );
- }
-
- private List<List<IPolicyOperation>> ll( List<IPolicyOperation>... opList )
- {
- return Arrays.asList( opList );
- }
-
- private List<IPolicyOperation> l( IPolicyOperation... opList )
- {
- return Arrays.asList( opList );
- }
-
- private void verifyLists( String listName, List<List<IPolicyOperation>> list1, List<List<IPolicyOperation>> list2 )
- {
- assertTrue( listName + " does not have the same size.", list1.size() == list2.size() );
-
- for( int listIndex = 0 ; listIndex < list1.size(); listIndex++ )
- {
- List<IPolicyOperation> policyList1 = list1.get( listIndex );
- List<IPolicyOperation> policyList2 = findList( policyList1.get(0).getId(), list2 );
-
- assertTrue( listName + " nested list at index " + listIndex + " is not the same size.", policyList1.size() == policyList2.size() );
-
- for( int index = 0; index < policyList1.size(); index++ )
- {
- IPolicyOperation op1 = policyList1.get( index );
-
- assertTrue( listName + " operation not found", findOp( op1, policyList2 ) );
- }
- }
- }
-
- private boolean findOp( IPolicyOperation op, List<IPolicyOperation> list )
- {
- boolean result = false;
-
- for( IPolicyOperation foundOp : list )
- {
- if( op == foundOp )
- {
- result = true;
- break;
- }
- }
-
- return result;
- }
-
- private List<IPolicyOperation> findList( String id, List<List<IPolicyOperation>> searchList )
- {
- for( List<IPolicyOperation> policyList : searchList )
- {
- if( policyList.get(0).getId().equals( id ) )
- {
- return policyList;
- }
- }
-
- assertTrue( "List not found for id" + id, false );
- return null;
- }
-
- private void displayPolicies( List<IServicePolicy> policyList )
- {
- System.out.println( "Listing service policies:" );
- for( IServicePolicy policy : policyList )
- {
- System.out.println( " " + policy.getId() );
- }
- }
-
- private void displayList( String setName, List<IPolicyOperation> operationList )
- {
- System.out.print( setName + ": " ); //$NON-NLS-1$
-
- for( IPolicyOperation operation : operationList )
- {
- System.out.print( operation.getId() + "," ); //$NON-NLS-1$
- }
-
- System.out.println( "" ); //$NON-NLS-1$
- }
-
- private void checkContents( String setName, List<IPolicyOperation> operationSet, IPolicyOperation[] operationArray )
- {
- assertTrue( "Set and array sizes don't match for " + setName + ".", operationSet.size() == operationArray.length ); //$NON-NLS-1$ //$NON-NLS-2$
-
- for( IPolicyOperation operation : operationArray )
- {
- assertTrue( setName + " does not contain operation " + operation.getId() + ".", operationSet.contains( operation ) ); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- private void displayOperation( IPolicyOperation operation )
- {
- List<IServicePolicy> zeroPolicies = new Vector<IServicePolicy>();
- List<IServicePolicy> manyPolicies = ServicePolicyPlatform.getInstance().getRootServicePolicies( null );
- IDescriptor descriptor = operation.getDescriptor();
- String shortName = descriptor.getShortName();
- String longName = descriptor.getLongName();
-
- System.out.println( "Operation id: " + operation.getId() ); //$NON-NLS-1$
- System.out.println( " short name: " + shortName ); //$NON-NLS-1$
- System.out.println( " long name: " + longName ); //$NON-NLS-1$
- System.out.println( " pattern: " + operation.getPolicyIdPattern() ); //$NON-NLS-1$
- System.out.println( " isEnabled zero: " + operation.isEnabled( zeroPolicies ) ); //$NON-NLS-1$
- System.out.println( " isEnabled many: " + operation.isEnabled( manyPolicies ) ); //$NON-NLS-1$
-
- switch( operation.getOperationKind() )
- {
- case selection:
- {
- System.out.println( " selection: true" ); //$NON-NLS-1$
- break;
- }
-
- case iconSelection:
- {
- System.out.println( " selection icon: true" ); //$NON-NLS-1$
- break;
- }
-
- case enumeration:
- {
- System.out.println( " enumeration id: " + operation.getEnumerationId() ); //$NON-NLS-1$
- break;
- }
-
- case complex:
- {
- System.out.println( " complex: true" ); //$NON-NLS-1$
- operation.launchOperation( zeroPolicies );
- break;
- }
- }
- }
-}
diff --git a/tests/org.eclipse.wst.ws.service.policy.test/src/org/eclipse/wst/ws/service/policy/test/ServicePolicytTestActivator.java b/tests/org.eclipse.wst.ws.service.policy.test/src/org/eclipse/wst/ws/service/policy/test/ServicePolicytTestActivator.java
deleted file mode 100644
index c6afcd0..0000000
--- a/tests/org.eclipse.wst.ws.service.policy.test/src/org/eclipse/wst/ws/service/policy/test/ServicePolicytTestActivator.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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
- * yyyymmdd bug Email and other contact information
- * -------- -------- -----------------------------------------------------------
- * 20071024 196997 pmoogk@ca.ibm.com - Peter Moogk
- *******************************************************************************/
-package org.eclipse.wst.ws.service.policy.test;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.ui.IStartup;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class ServicePolicytTestActivator extends Plugin implements IStartup {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.wst.service.policy.test"; //$NON-NLS-1$
-
- // The shared instance
- private static ServicePolicytTestActivator plugin;
-
- /**
- * The constructor
- */
- public ServicePolicytTestActivator() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static ServicePolicytTestActivator getDefault() {
- return plugin;
- }
-
- public static void logError( String message, Throwable exc )
- {
- IStatus status = new Status( IStatus.ERROR, PLUGIN_ID, 0, message, exc );
-
- getDefault().getLog().log(status);
- }
-
- public void earlyStartup()
- {
- // DO nothing. All we want to do is get the plugin loaded at UI start time.
- }
-}
diff --git a/tests/org.eclipse.wst.ws.service.policy.test/src/org/eclipse/wst/ws/service/policy/test/TestEnabledClass.java b/tests/org.eclipse.wst.ws.service.policy.test/src/org/eclipse/wst/ws/service/policy/test/TestEnabledClass.java
deleted file mode 100644
index 4bb8d33..0000000
--- a/tests/org.eclipse.wst.ws.service.policy.test/src/org/eclipse/wst/ws/service/policy/test/TestEnabledClass.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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
- * yyyymmdd bug Email and other contact information
- * -------- -------- -----------------------------------------------------------
- * 20071024 196997 pmoogk@ca.ibm.com - Peter Moogk
- *******************************************************************************/
-package org.eclipse.wst.ws.service.policy.test;
-
-import java.util.List;
-
-import org.eclipse.wst.ws.service.policy.IServicePolicy;
-import org.eclipse.wst.ws.service.policy.ui.IEnableOperation;
-
-public class TestEnabledClass implements IEnableOperation
-{
-
- public boolean isEnabled(List<IServicePolicy> selectedPolicies)
- {
- System.out.println( " Is enabled operation called." ); //$NON-NLS-1$
- return true;
- }
-}
diff --git a/tests/org.eclipse.wst.ws.service.policy.test/src/org/eclipse/wst/ws/service/policy/test/TestLaunchClass.java b/tests/org.eclipse.wst.ws.service.policy.test/src/org/eclipse/wst/ws/service/policy/test/TestLaunchClass.java
deleted file mode 100644
index 77945b0..0000000
--- a/tests/org.eclipse.wst.ws.service.policy.test/src/org/eclipse/wst/ws/service/policy/test/TestLaunchClass.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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
- * yyyymmdd bug Email and other contact information
- * -------- -------- -----------------------------------------------------------
- * 20071024 196997 pmoogk@ca.ibm.com - Peter Moogk
- *******************************************************************************/
-package org.eclipse.wst.ws.service.policy.test;
-
-import java.util.List;
-
-import org.eclipse.wst.ws.service.policy.IServicePolicy;
-import org.eclipse.wst.ws.service.policy.ui.ILaunchOperation;
-
-public class TestLaunchClass implements ILaunchOperation
-{
-
- public void launch(List<IServicePolicy> selectedPolicies)
- {
- System.out.println( " Launch class called." ); //$NON-NLS-1$
- }
-}
diff --git a/tests/org.eclipse.wst.ws.service.policy.test/src/org/eclipse/wst/ws/service/policy/test/action1.java b/tests/org.eclipse.wst.ws.service.policy.test/src/org/eclipse/wst/ws/service/policy/test/action1.java
deleted file mode 100644
index d4c34ad..0000000
--- a/tests/org.eclipse.wst.ws.service.policy.test/src/org/eclipse/wst/ws/service/policy/test/action1.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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
- * yyyymmdd bug Email and other contact information
- * -------- -------- -----------------------------------------------------------
- * 20071120 196997 pmoogk@ca.ibm.com - Peter Moogk, Initial coding.
- *******************************************************************************/
-package org.eclipse.wst.ws.service.policy.test;
-
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.ws.service.policy.IServicePolicy;
-import org.eclipse.wst.ws.service.policy.ui.IQuickFixAction;
-
-public class action1 implements IQuickFixAction
-{
-
- public void action(IServicePolicy policy)
- {
- policy.setStatus( Status.OK_STATUS );
- }
-}
diff --git a/tests/org.eclipse.wst.ws.service.policy.test/src/org/eclipse/wst/ws/service/policy/test/action2.java b/tests/org.eclipse.wst.ws.service.policy.test/src/org/eclipse/wst/ws/service/policy/test/action2.java
deleted file mode 100644
index f93e858..0000000
--- a/tests/org.eclipse.wst.ws.service.policy.test/src/org/eclipse/wst/ws/service/policy/test/action2.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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
- * yyyymmdd bug Email and other contact information
- * -------- -------- -----------------------------------------------------------
- * 20071120 196997 pmoogk@ca.ibm.com - Peter Moogk, Initial coding.
- *******************************************************************************/
-package org.eclipse.wst.ws.service.policy.test;
-
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.ws.service.policy.IServicePolicy;
-import org.eclipse.wst.ws.service.policy.ui.IQuickFixAction;
-
-public class action2 implements IQuickFixAction
-{
-
- public void action(IServicePolicy policy)
- {
- policy.setStatus( Status.OK_STATUS );
- }
-}
diff --git a/tests/org.eclipse.wst.ws.service.policy.test/src/org/eclipse/wst/ws/service/policy/test/action3.java b/tests/org.eclipse.wst.ws.service.policy.test/src/org/eclipse/wst/ws/service/policy/test/action3.java
deleted file mode 100644
index 84d977d..0000000
--- a/tests/org.eclipse.wst.ws.service.policy.test/src/org/eclipse/wst/ws/service/policy/test/action3.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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
- * yyyymmdd bug Email and other contact information
- * -------- -------- -----------------------------------------------------------
- * 20071120 196997 pmoogk@ca.ibm.com - Peter Moogk, Initial coding.
- *******************************************************************************/
-package org.eclipse.wst.ws.service.policy.test;
-
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.ws.service.policy.IServicePolicy;
-import org.eclipse.wst.ws.service.policy.ui.IQuickFixAction;
-
-public class action3 implements IQuickFixAction
-{
-
- public void action(IServicePolicy policy)
- {
- policy.setStatus( Status.OK_STATUS );
- }
-}
diff --git a/tests/org.eclipse.wst.ws.service.policy.test/src/org/eclipse/wst/ws/service/policy/test/internal/properties/FOOFilePropertyTester.java b/tests/org.eclipse.wst.ws.service.policy.test/src/org/eclipse/wst/ws/service/policy/test/internal/properties/FOOFilePropertyTester.java
deleted file mode 100644
index b983ea7..0000000
--- a/tests/org.eclipse.wst.ws.service.policy.test/src/org/eclipse/wst/ws/service/policy/test/internal/properties/FOOFilePropertyTester.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.eclipse.wst.ws.service.policy.test.internal.properties;
-
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-
-public class FOOFilePropertyTester extends PropertyTester
-{
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue)
- {
- boolean result = false;
-
- if( receiver instanceof IContainer)
- {
- result = hasFOOfile( (IContainer) receiver );
- }
-
- return result;
- }
-
- private boolean hasFOOfile( IContainer container )
- {
- boolean result = false;
-
- try
- {
- IResource[] children = container.members();
-
- for( IResource child : children )
- {
- if( child instanceof IContainer )
- {
- result = hasFOOfile( (IContainer) child );
-
- }
- else if( child instanceof IFile )
- {
- result = child.getFileExtension().equalsIgnoreCase( "foo" );
- }
-
- // If we found a single foo file we will break out of the loop.
- if( result ) break;
- }
- }
- catch( CoreException exc )
- {
- // Ignore exception and return false.
- }
-
- return result;
- }
-}
diff --git a/tests/org.eclipse.wst.wsdl.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.wst.wsdl.tests/META-INF/MANIFEST.MF
index 52f017d..c1a3523 100644
--- a/tests/org.eclipse.wst.wsdl.tests/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.wst.wsdl.tests/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.wst.wsdl.tests; singleton:=true
-Bundle-Version: 1.0.204.qualifier
+Bundle-Version: 1.0.206.qualifier
Bundle-Activator: org.eclipse.wst.wsdl.tests.WSDLTestsPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/ImportsWithNonStandardFileExtension/ImportWithNonStandardFileExtension.wsdl b/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/ImportsWithNonStandardFileExtension/ImportWithNonStandardFileExtension.wsdl
new file mode 100644
index 0000000..3607a8b
--- /dev/null
+++ b/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/ImportsWithNonStandardFileExtension/ImportWithNonStandardFileExtension.wsdl
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions name="ImportWithNonStandardFileExtension"
+ targetNamespace="http://www.example.org/ImportWithNonStandardFileExtension/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.example.org/ImportWithNonStandardFileExtension/"
+ xmlns:wsdl0="http://www.example.org/ImportWithNonStandardWSDLFileExtension/wsdl0/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsd1="http://www.example.org/NonStandardSchemaFileExtension/xsd0">
+
+ <wsdl:import
+ namespace="http://www.example.org/ImportWithNonStandardWSDLFileExtension/wsdl0/"
+ location="NonStandardWSDLFileExtension.wsdl0"></wsdl:import>
+
+ <wsdl:import
+ namespace="http://www.example.org/NonStandardSchemaFileExtension/xsd0"
+ location="NonStandardSchemaFileExtension.xsd1">
+ </wsdl:import>
+ <wsdl:types>
+ <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://www.example.org/ImportWithNonStandardFileExtension/">
+ <xsd:element name="NewOperation">
+ <xsd:complexType>
+ <xsd:sequence>
+
+ <xsd:element name="in" type="xsd:string"></xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="NewOperationResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+
+ <xsd:element name="out" type="xsd:string"></xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ </wsdl:types>
+
+ <wsdl:message name="NewOperationRequest">
+ <wsdl:part name="parameters" type="xsd1:ImportedTypeViaWSDLImport"></wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="NewOperationResponse">
+ <wsdl:part name="parameters" element="tns:NewOperationResponse"></wsdl:part>
+ </wsdl:message>
+ <wsdl:portType name="NewPortType">
+ <wsdl:operation name="NewOperation">
+ <wsdl:input message="tns:NewOperationRequest"></wsdl:input>
+ <wsdl:output message="tns:NewOperationResponse"></wsdl:output>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:service name="ImportWithNonStandardFileExtension">
+ <wsdl:port binding="wsdl0:ImportWithNonStandardFileExtensionSOAP"
+ name="ImportWithNonStandardFileExtensionSOAP">
+ <soap:address location="http://www.example.org/" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/ImportsWithNonStandardFileExtension/NonStandardSchemaFileExtension.xsd0 b/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/ImportsWithNonStandardFileExtension/NonStandardSchemaFileExtension.xsd0
new file mode 100644
index 0000000..889db83
--- /dev/null
+++ b/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/ImportsWithNonStandardFileExtension/NonStandardSchemaFileExtension.xsd0
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/NonStandardSchemaFileExtension/xsd0" xmlns:tns="http://www.example.org/NonStandardSchemaFileExtension/xsd0" elementFormDefault="qualified">
+
+ <complexType name="NewType" testXSD0="passed">
+ <sequence>
+ <element name="NewElement" type="string"></element>
+ <element name="NewElement1" type="string"></element>
+ </sequence>
+ </complexType>
+</schema>
diff --git a/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/ImportsWithNonStandardFileExtension/NonStandardSchemaFileExtension.xsd1 b/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/ImportsWithNonStandardFileExtension/NonStandardSchemaFileExtension.xsd1
new file mode 100644
index 0000000..625fd71
--- /dev/null
+++ b/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/ImportsWithNonStandardFileExtension/NonStandardSchemaFileExtension.xsd1
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/NonStandardSchemaFileExtension/xsd0" xmlns:tns="http://www.example.org/NonStandardSchemaFileExtension/xsd0" elementFormDefault="qualified">
+
+ <complexType name="ImportedTypeViaWSDLImport" testXSD1="passed">
+ <sequence>
+ <element name="NewElement" type="string"></element>
+ <element name="NewElement1" type="string"></element>
+ </sequence>
+ </complexType>
+</schema>
diff --git a/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/ImportsWithNonStandardFileExtension/NonStandardWSDLFileExtension.wsdl0 b/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/ImportsWithNonStandardFileExtension/NonStandardWSDLFileExtension.wsdl0
new file mode 100644
index 0000000..d99e375
--- /dev/null
+++ b/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/ImportsWithNonStandardFileExtension/NonStandardWSDLFileExtension.wsdl0
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?><wsdl:definitions name="ImportWithNonStandardFileExtension" targetNamespace="http://www.example.org/ImportWithNonStandardWSDLFileExtension/wsdl0/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.example.org/ImportWithNonStandardWSDLFileExtension/wsdl0/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <wsdl:types>
+ <xsd:schema targetNamespace="http://www.example.org/ImportWithNonStandardWSDLFileExtension/wsdl0/" xmlns:xsd0="http://www.example.org/NonStandardSchemaFileExtension/xsd0">
+ <xsd:import schemaLocation="NonStandardSchemaFileExtension.xsd0" namespace="http://www.example.org/NonStandardSchemaFileExtension/xsd0"></xsd:import>
+ <xsd:element name="NewOperation">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="in" type="xsd0:NewType"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="NewOperationResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="out" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ </wsdl:types>
+ <wsdl:message name="NewOperationRequest">
+ <wsdl:part element="tns:NewOperation" name="parameters"/>
+ </wsdl:message>
+ <wsdl:message name="NewOperationResponse">
+ <wsdl:part element="tns:NewOperationResponse" name="parameters"/>
+ </wsdl:message>
+ <wsdl:portType name="ImportWithNonStandardFileExtension">
+ <wsdl:operation name="NewOperation">
+ <wsdl:input message="tns:NewOperationRequest"/>
+ <wsdl:output message="tns:NewOperationResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="ImportWithNonStandardFileExtensionSOAP" type="tns:ImportWithNonStandardFileExtension">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="NewOperation">
+ <soap:operation soapAction="http://www.example.org/ImportWithNonStandardWSDLFileExtension/wsdl0/NewOperation"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+</wsdl:definitions>
diff --git a/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/ReconcilesExtensibleElements/ExtensibleElementSample.wsdl b/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/ReconcilesExtensibleElements/ExtensibleElementSample.wsdl
new file mode 100644
index 0000000..c936109
--- /dev/null
+++ b/tests/org.eclipse.wst.wsdl.tests/samples/BugFixes/ReconcilesExtensibleElements/ExtensibleElementSample.wsdl
@@ -0,0 +1,222 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.example.org/BindingFaultSample/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="BindingFaultSample"
+ targetNamespace="http://www.example.org/BindingFaultSample/">
+ <xsd:annotation>
+ <xsd:documentation>
+ Annotation
+ </xsd:documentation>
+ </xsd:annotation>
+ <wsdl:import namespace="" location="">
+ <xsd:annotation>
+ <xsd:documentation>
+ Annotation
+ </xsd:documentation>
+ </xsd:annotation>
+ </wsdl:import>
+ <wsdl:types>
+ <xsd:annotation>
+ <xsd:documentation>
+ Annotation
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:schema targetNamespace="http://www.example.org/BindingFaultSample/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <xsd:element name="Operation1">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="in" type="xsd:string" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="Operation1Response">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="out" type="xsd:string" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="Operation1Fault">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="fault" type="xsd:string" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="Operation2">
+ <xsd:complexType>
+ <xsd:sequence>
+
+ <xsd:element name="in" type="xsd:string"></xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="Operation2Response">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="out" type="xsd:string"></xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="Operation2Fault1">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="Operation2Fault1" type="xsd:string"></xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="Operation2Fault2">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="Operation2Fault2" type="xsd:string"></xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="Operation1Fault1">
+ <xsd:complexType>
+ <xsd:sequence>
+
+ <xsd:element name="Operation1Fault" type="xsd:string">
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ </wsdl:types>
+ <wsdl:message name="Operation1Request">
+ <xsd:annotation>
+ <xsd:documentation>
+ Annotation
+ </xsd:documentation>
+ </xsd:annotation>
+ <wsdl:part element="tns:Operation1" name="parameters">
+ <xsd:annotation>
+ <xsd:documentation>
+ Annotation
+ </xsd:documentation>
+ </xsd:annotation>
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="Operation1Response">
+ <wsdl:part element="tns:Operation1Response" name="parameters" />
+ </wsdl:message>
+ <wsdl:message name="Operation1Fault">
+ <wsdl:part name="Fault" element="tns:Operation1Fault" />
+ </wsdl:message>
+ <wsdl:message name="Operation2Request">
+ <wsdl:part name="parameters" element="tns:Operation2"></wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="Operation2Response">
+ <wsdl:part name="parameters" element="tns:Operation2Response"></wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="Operation2Fault1">
+ <wsdl:part name="parameters" element="tns:Operation2Fault1"></wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="Operation2Fault2">
+ <wsdl:part name="parameters" element="tns:Operation2Fault2"></wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="Operation1Fault1">
+ <wsdl:part name="parameters" element="tns:Operation1Fault1"></wsdl:part>
+ </wsdl:message>
+ <wsdl:portType name="SamplePort">
+ <xsd:annotation>
+ <xsd:documentation>
+ Annotation
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <wsdl:operation name="Operation1">
+ <xsd:annotation>
+ <xsd:documentation>
+ Annotation
+ </xsd:documentation>
+ </xsd:annotation>
+ <wsdl:input message="tns:Operation1Request">
+ <xsd:annotation>
+ <xsd:documentation>
+ Annotation
+ </xsd:documentation>
+ </xsd:annotation>
+ </wsdl:input>
+ <wsdl:output message="tns:Operation1Response">
+ <xsd:annotation>
+ <xsd:documentation>
+ Annotation
+ </xsd:documentation>
+ </xsd:annotation>
+ </wsdl:output>
+ <wsdl:fault name="fault" message="tns:Operation1Fault1">
+ <xsd:annotation>
+ <xsd:documentation>
+ Annotation
+ </xsd:documentation>
+ </xsd:annotation>
+ </wsdl:fault>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="SamplePortSOAPBinding" type="tns:SamplePort">
+ <xsd:annotation>
+ <xsd:documentation>
+ Annotation
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="Operation1">
+ <xsd:annotation>
+ <xsd:documentation>
+ Annotation
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <soap:operation
+ soapAction="http://www.example.org/BindingFaultSample/Operation1" />
+ <wsdl:input>
+ <xsd:annotation>
+ <xsd:documentation>
+ Annotation
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <xsd:annotation>
+ <xsd:documentation>
+ Annotation
+ </xsd:documentation>
+ </xsd:annotation>
+ <soap:body use="literal" />
+ </wsdl:output>
+ <wsdl:fault name="Operation1Fault">
+ <xsd:annotation>
+ <xsd:documentation>
+ Annotation
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <soap:fault name="Operation1Fault" />
+ </wsdl:fault>
+ </wsdl:operation>
+
+ </wsdl:binding>
+ <wsdl:service name="SampleService">
+ <xsd:annotation>
+ <xsd:documentation>
+ Annotation
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <wsdl:port binding="tns:SamplePortSOAPBinding" name="SamplePort">
+ <xsd:annotation>
+ <xsd:documentation>
+ Annotation
+ </xsd:documentation>
+ </xsd:annotation>
+ <soap:address location="http://www.example.org/" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/BugFixesTest.java b/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/BugFixesTest.java
index b1fedba..715f7d8 100644
--- a/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/BugFixesTest.java
+++ b/tests/org.eclipse.wst.wsdl.tests/src/org/eclipse/wst/wsdl/tests/BugFixesTest.java
@@ -37,6 +37,7 @@
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.ExtensibleElement;
import org.eclipse.wst.wsdl.Fault;
@@ -49,6 +50,7 @@
import org.eclipse.wst.wsdl.PortType;
import org.eclipse.wst.wsdl.Service;
import org.eclipse.wst.wsdl.Types;
+import org.eclipse.wst.wsdl.UnknownExtensibilityElement;
import org.eclipse.wst.wsdl.WSDLFactory;
import org.eclipse.wst.wsdl.WSDLPackage;
import org.eclipse.wst.wsdl.WSDLPlugin;
@@ -67,6 +69,7 @@
import org.eclipse.wst.wsdl.internal.util.WSDLUtil;
import org.eclipse.wst.wsdl.tests.util.DefinitionLoader;
import org.eclipse.wst.wsdl.util.WSDLConstants;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
import org.eclipse.xsd.XSDElementDeclaration;
import org.eclipse.xsd.XSDImport;
import org.eclipse.xsd.XSDSchema;
@@ -314,7 +317,23 @@
{
testReconcilesImportsWithNoLocation();
}
- });
+ });
+
+ suite.addTest(new BugFixesTest("ReconcilesExtensibleElements") //$NON-NLS-1$
+ {
+ protected void runTest()
+ {
+ testReconcilesExtensibleElements();
+ }
+ });
+
+ suite.addTest(new BugFixesTest("ImportsWithNonStandardFileExtension") //$NON-NLS-1$
+ {
+ protected void runTest()
+ {
+ testImportsWithNonStandardFileExtension();
+ }
+ });
return suite;
}
@@ -1764,4 +1783,189 @@
fail();
}
}
+
+ /**
+ * See https://bugs.eclipse.org/bugs/show_bug.cgi?id=236404
+ */
+ public void testReconcilesExtensibleElements()
+ {
+ Definition definition = null;
+
+ // The sample WSDL already has an <annotation> extensibility element for each extensible element
+ // We will loop through every extensible element and remove the annotation extensibility element
+ // and force the model to update, thus calling the reconciliation code. The expected result is that
+ // the annotation extensibility element will be removed in the model.
+ try
+ {
+ definition = DefinitionLoader.load(PLUGIN_ABSOLUTE_PATH + "samples/BugFixes/ReconcilesExtensibleElements/ExtensibleElementSample.wsdl"); //$NON-NLS-1$
+ }
+ catch (IOException e)
+ {
+ fail(e.getMessage());
+ }
+
+ // Definition
+ ensureExtensibilityElementRemoved(definition, 1);
+
+ // Import
+ EList imports = definition.getEImports();
+ Import myImport = (Import) imports.get(0);
+ ensureExtensibilityElementRemoved(myImport, 1);
+
+ // Type: original is two because it has <annotation> and <schema>
+ Types types = definition.getETypes();
+ ensureExtensibilityElementRemoved(types, 2);
+
+ // Service
+ Service service = (Service)definition.getEServices().get(0);
+ ensureExtensibilityElementRemoved(service, 1);
+
+ // Port
+ org.eclipse.wst.wsdl.Port port = (org.eclipse.wst.wsdl.Port)service.getEPorts().get(0);
+ ensureExtensibilityElementRemoved(port, 2);
+
+ // Binding: original is 2 because it has <annotation> and <soap:binding>
+ Binding binding = port.getEBinding();
+ ensureExtensibilityElementRemoved(binding, 2);
+
+ // Binding Operation: original is 2 because it has <annotation> and <soap:operation>
+ List bindingOperations = binding.getBindingOperations();
+ BindingOperation bindingOperation = (BindingOperation)bindingOperations.get(0);
+ ensureExtensibilityElementRemoved(bindingOperation, 2);
+
+ // Binding Input: original is 2 because it has <annotation> and <soap:body>
+ BindingInput bindingInput = bindingOperation.getEBindingInput();
+ ensureExtensibilityElementRemoved(bindingInput, 2);
+
+ // Binding Output: original is 2 because it has <annotation> and <soap:body>
+ BindingOutput bindingOutput = bindingOperation.getEBindingOutput();
+ ensureExtensibilityElementRemoved(bindingOutput, 2);
+
+ // Binding Fault: original is 2 because it has <annotation> and <soap:fault>
+ EList bindingFaults = bindingOperation.getEBindingFaults();
+ BindingFault bindingFault = (BindingFault)bindingFaults.get(0);
+ ensureExtensibilityElementRemoved(bindingFault, 2);
+
+ // Port Type
+ PortType portType = binding.getEPortType();
+ ensureExtensibilityElementRemoved(portType, 1);
+
+ // Operation
+ EList operations = portType.getEOperations();
+ Operation operation = (Operation) operations.get(0);
+ ensureExtensibilityElementRemoved(operation, 1);
+
+ // Output
+ Output output = operation.getEOutput();
+ ensureExtensibilityElementRemoved(output, 1);
+
+ // Input
+ Input input = operation.getEInput();
+ ensureExtensibilityElementRemoved(input, 1);
+
+ // fault
+ EList faults = operation.getEFaults();
+ Fault fault = (Fault) faults.get(0);
+ ensureExtensibilityElementRemoved(fault, 1);
+
+ // Message
+ Message message = input.getEMessage();
+ ensureExtensibilityElementRemoved(message, 1);
+
+ // Part
+ EList parts = message.getEParts();
+ Part part = (Part) parts.get(0);
+ ensureExtensibilityElementRemoved(part, 1);
+ }
+
+ /**
+ * Remove the first UnknownExtensibilityElement. The expected result is original size will decrement by 1
+ */
+ private void ensureExtensibilityElementRemoved(ExtensibleElement extensibleElement, int originalSize)
+ {
+ List extensibilityElements = extensibleElement.getExtensibilityElements();
+ assertEquals(originalSize, extensibilityElements.size());
+ UnknownExtensibilityElement unknownExtensibilityElement = null;
+ Iterator extensibilityElementsIterator = extensibilityElements.iterator();
+ while (extensibilityElementsIterator.hasNext())
+ {
+ Object object = extensibilityElementsIterator.next();
+ if (object instanceof UnknownExtensibilityElement)
+ {
+ unknownExtensibilityElement = (UnknownExtensibilityElement) object;
+ break;
+ }
+ }
+
+ if (unknownExtensibilityElement == null)
+ {
+ fail("Cannot find the UnknownExtensibilityElement.");
+ }
+ Element element = unknownExtensibilityElement.getElement();
+ extensibleElement.getElement().removeChild(element);
+ extensibleElement.elementChanged(extensibleElement.getElement());
+ assertEquals(originalSize - 1, extensibilityElements.size());
+ }
+
+ public void testImportsWithNonStandardFileExtension()
+ {
+ String WSDL_NS = "http://www.example.org/ImportWithNonStandardWSDLFileExtension/wsdl0/"; //$NON-NLS-1$
+ String XSD_NS = "http://www.example.org/NonStandardSchemaFileExtension/xsd0"; //$NON-NLS-1$
+
+ try
+ {
+ // load a wsdl that imports another WSDL with non-standard file extension (.wsdl0) which in turn
+ // imports a XSD with non-standard file extension (.xsd0)
+ // ImportWithNonStandardFileExtension.wsdl also imports a XSD (NonStandardSchemaFileExtension.xsd1) using <wsdl:import>
+ Definition definition = DefinitionLoader.load(PLUGIN_ABSOLUTE_PATH + "samples/BugFixes/ImportsWithNonStandardFileExtension/ImportWithNonStandardFileExtension.wsdl", true); //$NON-NLS-1$
+
+ // there should only be two valid <wsdl:import>s - NonStandardWSDLFileExtension.wsdl0 and NonStandardSchemaFileExtension.xsd1
+ EList imports = definition.getEImports();
+ assertEquals("Incorrect number of imports", 2, imports.size()); //$NON-NLS-1$
+
+
+ for (int i = 0; i < imports.size(); i++) {
+ Import myImport = (Import) imports.get(i);
+ assertTrue("Incorrect imported namespace", WSDL_NS.equals(myImport.getNamespaceURI()) || XSD_NS.equals(myImport.getNamespaceURI())); //$NON-NLS-1$
+ if (WSDL_NS.equals(myImport.getNamespaceURI())) {
+ // WSDL import: make sure the binding in the imported NonStandardWSDLFileExtension.wsdl0 is resolved
+ Definition importedDefinition = myImport.getEDefinition();
+ assertNotNull(importedDefinition);
+ Map bindings = importedDefinition.getBindings();
+ assertEquals("Incorrect number of binding elements in imported WSDL", 1, bindings.size()); //$NON-NLS-1$
+
+ // Go to the resolved "NewType" complex type element and reads its testXSD0 attribute, and verify it's accessible.
+ List schemas = importedDefinition.getETypes().getSchemas();
+ assertEquals(1, schemas.size());
+ XSDSchema schema = (XSDSchema)schemas.get(0);
+ EList types = schema.getTypeDefinitions();
+ assertEquals("Incorrect number of types definitions in the inline schema of the imported WSDL", 1, types.size()); //$NON-NLS-1$
+ Object type = types.get(0);
+ assertTrue("Not complex type", type instanceof XSDComplexTypeDefinition);
+ XSDComplexTypeDefinition complexTypeDefinition = (XSDComplexTypeDefinition) type;
+ assertEquals("Incorrect name for the ComplexType imported from NonStandardSchemaFileExtension.xsd0", "NewType", complexTypeDefinition.getName()); //$NON-NLS-1$ $NON-NLS-2$
+ String testAttribute = complexTypeDefinition.getElement().getAttribute("testXSD0");
+ assertEquals("Incorrect test attribute for the ComplexType imported from NonStandardSchemaFileExtension.xsd0", "passed", testAttribute); //$NON-NLS-1$ $NON-NLS-2$
+ } else {
+ // schema import: make sure the complex type in the imported NonStandardSchemaFileExtension.xsd1 is resolved
+ // Go to the resolved "ImportedTypeViaWSDLImport" complex type element and reads its testXSD1 attribute, and verify it's accessible.
+ XSDSchema schema = myImport.getESchema();
+ EList types = schema.getTypeDefinitions();
+ assertEquals("Incorrect number of types definitions in imported XSD", 1, types.size()); //$NON-NLS-1$
+
+ Object type = types.get(0);
+ assertTrue("Not complex type", type instanceof XSDComplexTypeDefinition);
+ XSDComplexTypeDefinition complexTypeDefinition = (XSDComplexTypeDefinition) type;
+ assertEquals("Incorrect name for the ComplexType imported from NonStandardSchemaFileExtension.xsd1", "ImportedTypeViaWSDLImport", complexTypeDefinition.getName()); //$NON-NLS-1$ $NON-NLS-2$
+ String testAttribute = complexTypeDefinition.getElement().getAttribute("testXSD1"); //$NON-NLS-1$
+ assertEquals("Incorrect test attribute for the ComplexType imported from NonStandardSchemaFileExtension.xsd1", "passed", testAttribute); //$NON-NLS-1$ $NON-NLS-2$
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ fail();
+ }
+ }
}
diff --git a/tests/org.eclipse.wst.wsdl.validation.tests/.classpath b/tests/org.eclipse.wst.wsdl.validation.tests/.classpath
index 099908e..7d6d00f 100644
--- a/tests/org.eclipse.wst.wsdl.validation.tests/.classpath
+++ b/tests/org.eclipse.wst.wsdl.validation.tests/.classpath
@@ -4,6 +4,7 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4">
<accessrules>
<accessrule kind="accessible" pattern="org/apache/xerces/**"/>
+ <accessrule kind="accessible" pattern="javax/xml/namespace/QName"/>
</accessrules>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
diff --git a/tests/org.eclipse.wst.wsdl.validation.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.wst.wsdl.validation.tests/META-INF/MANIFEST.MF
index 642990c..99322cf 100644
--- a/tests/org.eclipse.wst.wsdl.validation.tests/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.wst.wsdl.validation.tests/META-INF/MANIFEST.MF
@@ -1,8 +1,8 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %_PLUGIN_NAME
-Bundle-SymbolicName: org.eclipse.wst.wsdl.validation.tests
-Bundle-Version: 1.0.203
+Bundle-SymbolicName: org.eclipse.wst.wsdl.validation.tests;singleton:=true
+Bundle-Version: 1.0.204
Bundle-ClassPath: wsdlvalidatetests.jar
Bundle-Activator: org.eclipse.wst.wsdl.validation.tests.internal.WSDLValidatorTestsPlugin
Bundle-Vendor: %_PROVIDER_NAME
diff --git a/tests/org.eclipse.wst.wsdl.validation.tests/build.properties b/tests/org.eclipse.wst.wsdl.validation.tests/build.properties
index 1c9a689..b719df6 100644
--- a/tests/org.eclipse.wst.wsdl.validation.tests/build.properties
+++ b/tests/org.eclipse.wst.wsdl.validation.tests/build.properties
@@ -15,5 +15,6 @@
test.xml,\
META-INF/,\
about.html,\
- plugin.properties
+ plugin.properties,\
+ plugin.xml
src.includes = build.properties
diff --git a/tests/org.eclipse.wst.wsdl.validation.tests/plugin.xml b/tests/org.eclipse.wst.wsdl.validation.tests/plugin.xml
new file mode 100644
index 0000000..e4e7c6a
--- /dev/null
+++ b/tests/org.eclipse.wst.wsdl.validation.tests/plugin.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.wst.wsdl.validation.wsdl11validator">
+ <validator
+ class="org.eclipse.wst.wsdl.validation.tests.internal.SimpleExtensionsValidator"
+ namespace="http://org.eclipse.wst.wsdl.validation.tests/Extensions">
+ </validator>
+ </extension>
+ <extension
+ point="org.eclipse.wst.xml.core.catalogContributions">
+ <catalogContribution>
+ <uri
+ name="http://org.eclipse.wst.wsdl.validation.tests/Extensions"
+ uri="testresources/samples/WSDL/ExtensibleElements/Extensions.xsd">
+ </uri>
+ </catalogContribution>
+ </extension>
+</plugin>
diff --git a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/ui/text/WSDLValidateTest.java b/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/ui/text/WSDLValidateTest.java
index b6458f2..fd97e54 100644
--- a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/ui/text/WSDLValidateTest.java
+++ b/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/ui/text/WSDLValidateTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 2009 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
@@ -17,6 +17,8 @@
import org.eclipse.wst.wsdl.validation.internal.IValidationReport;
import org.eclipse.wst.wsdl.validation.internal.ValidationMessageImpl;
import org.eclipse.wst.wsdl.validation.internal.ValidatorRegistry;
+import org.eclipse.wst.wsdl.validation.internal.WSDLValidator;
+import org.eclipse.wst.wsdl.validation.internal.eclipse.URIResolverWrapper;
import org.eclipse.wst.wsdl.validation.internal.logging.ILogger;
import org.eclipse.wst.wsdl.validation.internal.logging.LoggerFactory;
import org.eclipse.wst.wsdl.validation.internal.logging.StandardLogger;
@@ -33,6 +35,9 @@
{
super.setUp();
validate = new WSDLValidateWrapper();
+ WSDLValidator wsdlValidator = validate.getWSDLValidator();
+ URIResolverWrapper resolver = new URIResolverWrapper();
+ wsdlValidator.addURIResolver(resolver);
}
/* (non-Javadoc)
diff --git a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/tests/internal/SimpleExtensionsValidator.java b/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/tests/internal/SimpleExtensionsValidator.java
new file mode 100644
index 0000000..15491bb
--- /dev/null
+++ b/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/tests/internal/SimpleExtensionsValidator.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2009 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.validation.tests.internal;
+
+
+import java.util.List;
+
+import javax.wsdl.extensions.ElementExtensible;
+import javax.wsdl.extensions.ExtensibilityElement;
+import javax.xml.namespace.QName;
+
+import org.eclipse.wst.wsdl.validation.internal.wsdl11.IWSDL11ValidationInfo;
+import org.eclipse.wst.wsdl.validation.internal.wsdl11.IWSDL11Validator;
+
+
+/**
+ * An extensions validator used to test that a registered extensions
+ * validator is called by the main WSDL 1.1 validator when validating
+ * definitions level extensibility elements.
+ */
+public class SimpleExtensionsValidator implements IWSDL11Validator
+{
+ public static final String NS_URI = "http://org.eclipse.wst.wsdl.validation.tests/Extensions"; //$NON-NLS-1$
+
+ public void validate(Object element, List parents, IWSDL11ValidationInfo valInfo)
+ {
+ ExtensibilityElement extensibilityElement = (ExtensibilityElement)element;
+ QName elementType = extensibilityElement.getElementType();
+ String namespaceURI = elementType.getNamespaceURI();
+
+ if (parents.isEmpty() || !(parents.get(0) instanceof ElementExtensible))
+ {
+ valInfo.addWarning("The current parent is expected to have extensibility elements.", element); //$NON-NLS-1$
+ }
+
+ if (NS_URI.equals(namespaceURI))
+ {
+ valInfo.addWarning("The test extensions validator got called.", element); //$NON-NLS-1$
+ }
+ else
+ {
+ valInfo.addError("Bad extensibility element namespace.", element); //$NON-NLS-1$
+ }
+ }
+}
\ No newline at end of file
diff --git a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/tests/internal/WSDLTest.java b/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/tests/internal/WSDLTest.java
index de9e7e2..c230ba6 100644
--- a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/tests/internal/WSDLTest.java
+++ b/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/tests/internal/WSDLTest.java
@@ -677,4 +677,17 @@
runTest(testfile, loglocation, idealloglocation);
}
+
+ /**
+ * Test /WSDL/ExtensibleElements/ExtensibleDefinitions.wsdl
+ */
+ public void testExtensibleDefinitions()
+ {
+ String testname = "ExtensibleDefinitions";
+ String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "ExtensibleElements/" + testname + ".wsdl";
+ String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "ExtensibleElements/" + testname + ".wsdl-log";
+ String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "ExtensibleElements/" + testname + ".wsdl-log";
+
+ runTest(testfile, loglocation, idealloglocation);
+ }
}
diff --git a/tests/org.eclipse.wst.wsdl.validation.tests/testresources/idealResults/WSDL/ExtensibleElements/ExtensibleDefinitions.wsdl-log b/tests/org.eclipse.wst.wsdl.validation.tests/testresources/idealResults/WSDL/ExtensibleElements/ExtensibleDefinitions.wsdl-log
new file mode 100644
index 0000000..e18e95f
--- /dev/null
+++ b/tests/org.eclipse.wst.wsdl.validation.tests/testresources/idealResults/WSDL/ExtensibleElements/ExtensibleDefinitions.wsdl-log
@@ -0,0 +1,8 @@
+number of errors : 0
+number of warnings : 1
+
+------------error list-------------------------------------------
+(none)
+------------warning list-----------------------------------------
+The test extensions validator got called. [8, 40]
+-----------------------------------------------------------------
diff --git a/tests/org.eclipse.wst.wsdl.validation.tests/testresources/samples/WSDL/ExtensibleElements/ExtensibleDefinitions.wsdl b/tests/org.eclipse.wst.wsdl.validation.tests/testresources/samples/WSDL/ExtensibleElements/ExtensibleDefinitions.wsdl
new file mode 100644
index 0000000..b6c2fed
--- /dev/null
+++ b/tests/org.eclipse.wst.wsdl.validation.tests/testresources/samples/WSDL/ExtensibleElements/ExtensibleDefinitions.wsdl
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions name="ExtensibleDefinitions"
+ targetNamespace="http://www.example.org/ExtensibleDefinitions/"
+ xmlns:tns="http://www.example.org/ExtensibleDefinitions/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:ext="http://org.eclipse.wst.wsdl.validation.tests/Extensions">
+ <wsdl:documentation>Testing the validation of definitions level extensibility elements.</wsdl:documentation>
+ <ext:testExtension testAttribute="10">test</ext:testExtension>
+</wsdl:definitions>
\ No newline at end of file
diff --git a/tests/org.eclipse.wst.wsdl.validation.tests/testresources/samples/WSDL/ExtensibleElements/Extensions.xsd b/tests/org.eclipse.wst.wsdl.validation.tests/testresources/samples/WSDL/ExtensibleElements/Extensions.xsd
new file mode 100644
index 0000000..3ec3794
--- /dev/null
+++ b/tests/org.eclipse.wst.wsdl.validation.tests/testresources/samples/WSDL/ExtensibleElements/Extensions.xsd
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://org.eclipse.wst.wsdl.validation.tests/Extensions"
+ xmlns:tns="http://org.eclipse.wst.wsdl.validation.tests/Extensions"
+ elementFormDefault="qualified">
+
+ <xsd:element name="testExtension">
+ <xsd:complexType>
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:string" >
+ <xsd:attribute name="testAttribute" type="xsd:integer" />
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+ </xsd:element>
+</xsd:schema>
\ No newline at end of file