diff options
author | Christian W. Damus | 2014-04-09 22:56:14 +0000 |
---|---|---|
committer | Christian W. Damus | 2014-04-22 16:26:30 +0000 |
commit | 36d7adb27eab6e1f99a41b90c4106d61726412f6 (patch) | |
tree | d62466ab85e651b080d7a6d72bdd4b84065d4d92 /tests | |
parent | 5ebf7f2fb8d1734fa7e18638df56ff8ce07be53f (diff) | |
download | org.eclipse.papyrus-36d7adb27eab6e1f99a41b90c4106d61726412f6.tar.gz org.eclipse.papyrus-36d7adb27eab6e1f99a41b90c4106d61726412f6.tar.xz org.eclipse.papyrus-36d7adb27eab6e1f99a41b90c4106d61726412f6.zip |
431953: Stereotype garbage left in .uml file after removing profile (crash reason?)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=431953
Automated tests for the stereotype repair model-set snippet. Includes refactorings and improvements in JUnit utilities to support
- plain ModelSet fixtures
- new association implementation for ModelSet's service registry
- loading test resources from test fragments (not just plug-ins)
Diffstat (limited to 'tests')
24 files changed, 1038 insertions, 15 deletions
diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF index d9cbe4ec4a2..3f78ff05f33 100644 --- a/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF +++ b/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF @@ -45,7 +45,8 @@ Require-Bundle: org.eclipse.ui, org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="1.0.0",
org.eclipse.papyrus.infra.emf.readonly;bundle-version="1.0.0",
org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="1.0.0",
- org.eclipse.papyrus.uml.diagram.wizards.tests;bundle-version="1.0.0"
+ org.eclipse.papyrus.uml.diagram.wizards.tests;bundle-version="1.0.0",
+ org.eclipse.papyrus.uml.modelrepair;bundle-version="1.0.0"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-Version: 1.0.0.qualifier
diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java b/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java index 762f31ecc80..2e6f43abbd6 100644 --- a/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java +++ b/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java @@ -8,7 +8,7 @@ *
* Contributors:
* Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- * Christian W. Damus (CEA) - bugs 402525, 323802
+ * Christian W. Damus (CEA) - bugs 402525, 323802, 431953
*
*****************************************************************************/
package org.eclipse.papyrus.tests;
@@ -81,8 +81,9 @@ public class AllTests { suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.tools.tests.tests.AllTests.class));
suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.diagram.stereotypeproperty.AllTests.class));
suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.wizards.AllTests.class));
+ suiteClasses.add(new FragmentTestSuiteClass(org.eclipse.papyrus.uml.modelrepair.Activator.PLUGIN_ID, "org.eclipse.papyrus.uml.modelrepair.tests.AllTests"));
- /* uml idagrams */
+ /* uml diagrams */
suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.diagram.clazz.test.AllTests.class));
suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.activity.tests.AllTests.class));
suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.deployment.test.AllTests.class));
diff --git a/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.readonly.tests/src/org/eclipse/papyrus/infra/emf/readonly/tests/PapyrusModelSetFixture.java b/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.readonly.tests/src/org/eclipse/papyrus/infra/emf/readonly/tests/PapyrusModelSetFixture.java index 6f96df8d47e..f3c1ed1117b 100644 --- a/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.readonly.tests/src/org/eclipse/papyrus/infra/emf/readonly/tests/PapyrusModelSetFixture.java +++ b/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.readonly.tests/src/org/eclipse/papyrus/infra/emf/readonly/tests/PapyrusModelSetFixture.java @@ -25,7 +25,6 @@ import org.eclipse.papyrus.infra.core.services.ServiceDescriptor.ServiceTypeKind import org.eclipse.papyrus.infra.core.services.ServiceStartKind; import org.eclipse.papyrus.infra.core.services.ServicesRegistry; import org.eclipse.papyrus.infra.emf.readonly.PapyrusROTransactionalEditingDomain; -import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForResourceInitializerService; import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForResourceSet; import org.eclipse.papyrus.junit.utils.rules.AbstractModelFixture; import org.junit.runner.Description; @@ -68,7 +67,6 @@ public class PapyrusModelSetFixture extends AbstractModelFixture<PapyrusROTransa protected ServicesRegistry createServiceRegistry() throws Exception { ServicesRegistry result = new ServicesRegistry(); result.add(ModelSet.class, 10, new ModelSet()); - result.add(ServiceUtilsForResourceInitializerService.class, 10, new ServiceUtilsForResourceInitializerService()); ServiceDescriptor desc = new ServiceDescriptor(TransactionalEditingDomain.class, EditingDomainServiceFactory.class.getName(), ServiceStartKind.STARTUP, 10, Collections.singletonList(ModelSet.class.getName())); desc.setServiceTypeKind(ServiceTypeKind.serviceFactory); diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/AbstractModelFixture.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/AbstractModelFixture.java index 25829351a1f..f1d09e29d7c 100644 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/AbstractModelFixture.java +++ b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/AbstractModelFixture.java @@ -19,14 +19,18 @@ import static org.junit.Assert.fail; import java.io.InputStream; import java.lang.reflect.Method; import java.net.URL; +import java.util.ArrayList; +import java.util.Enumeration; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.emf.ecore.resource.ResourceSet; import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.emf.edit.domain.EditingDomain; import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.papyrus.junit.utils.rules.ProjectFixture; +import org.eclipse.papyrus.infra.core.resource.ModelSet; import org.eclipse.uml2.uml.Model; import org.junit.Rule; import org.junit.rules.TestWatcher; @@ -61,6 +65,8 @@ public abstract class AbstractModelFixture<T extends EditingDomain> extends Test private T domain; + private ResourceSet resourceSet; + private Model model; public AbstractModelFixture() { @@ -88,6 +94,10 @@ public abstract class AbstractModelFixture<T extends EditingDomain> extends Test return domain; } + public ResourceSet getResourceSet() { + return resourceSet; + } + /** * Obtains the test model, which is resident in the <tt>model.uml</tt> file in the test project (as indicated by its * {@linkplain #getModelResourceURI() URI}). @@ -115,8 +125,12 @@ public abstract class AbstractModelFixture<T extends EditingDomain> extends Test @Override protected void starting(Description description) { domain = createEditingDomain(); - - Resource res = domain.getResourceSet().createResource(project.getURI("model.uml")); + resourceSet = domain.getResourceSet(); + + Resource res = resourceSet.createResource(project.getURI("model.uml")); + if(resourceSet instanceof ModelSet) { + ((ModelSet)resourceSet).getInternal().setPrimaryModelResourceURI(res.getURI()); + } try { InputStream input = getResourceURL(description).openStream(); @@ -136,8 +150,6 @@ public abstract class AbstractModelFixture<T extends EditingDomain> extends Test @Override protected void finished(Description description) { - ResourceSet rset = domain.getResourceSet(); - model = null; if(domain instanceof TransactionalEditingDomain) { @@ -145,13 +157,15 @@ public abstract class AbstractModelFixture<T extends EditingDomain> extends Test } domain = null; - for(Resource next : rset.getResources()) { + for(Resource next : new ArrayList<Resource>(resourceSet.getResources())) { next.unload(); next.eAdapters().clear(); } - rset.getResources().clear(); - rset.eAdapters().clear(); + resourceSet.getResources().clear(); + resourceSet.eAdapters().clear(); + + resourceSet = null; } protected URL getResourceURL(Description description) { @@ -170,13 +184,13 @@ public abstract class AbstractModelFixture<T extends EditingDomain> extends Test if(testMethod.isAnnotationPresent(JavaResource.class)) { result = testClass.getResource(testMethod.getAnnotation(JavaResource.class).value()); } else if(testMethod.isAnnotationPresent(PluginResource.class)) { - result = FrameworkUtil.getBundle(testClass).getEntry(testMethod.getAnnotation(PluginResource.class).value()); + result = getBundleURL(testClass, testMethod.getAnnotation(PluginResource.class).value()); } else { // The class must have an annotation if(testClass.isAnnotationPresent(JavaResource.class)) { result = testClass.getResource(testClass.getAnnotation(JavaResource.class).value()); } else if(testClass.isAnnotationPresent(PluginResource.class)) { - result = FrameworkUtil.getBundle(testClass).getEntry(testClass.getAnnotation(PluginResource.class).value()); + result = getBundleURL(testClass, testClass.getAnnotation(PluginResource.class).value()); } } @@ -184,4 +198,23 @@ public abstract class AbstractModelFixture<T extends EditingDomain> extends Test return result; } + + private URL getBundleURL(Class<?> testClass, String resourcePath) { + URL result = null; + + IPath path = new Path(resourcePath); + String pattern = path.lastSegment(); + IPath search; + if(path.segmentCount() > 1) { + search = path.removeLastSegments(1); + } else { + search = Path.ROOT; + } + Enumeration<URL> urls = FrameworkUtil.getBundle(testClass).findEntries(search.toPortableString(), pattern, false); + if((urls != null) && urls.hasMoreElements()) { + result = urls.nextElement(); + } + + return result; + } } diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ModelSetFixture.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ModelSetFixture.java new file mode 100644 index 00000000000..0100865f2ea --- /dev/null +++ b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ModelSetFixture.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2014 CEA 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: + * Christian W. Damus (CEA) - Initial API and implementation + * + */ +package org.eclipse.papyrus.junit.utils.rules; + +import static org.junit.Assert.fail; + +import java.util.Collections; + +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.papyrus.infra.core.resource.EditingDomainServiceFactory; +import org.eclipse.papyrus.infra.core.resource.ModelSet; +import org.eclipse.papyrus.infra.core.services.ServiceDescriptor; +import org.eclipse.papyrus.infra.core.services.ServiceStartKind; +import org.eclipse.papyrus.infra.core.services.ServicesRegistry; +import org.eclipse.papyrus.infra.core.services.ServiceDescriptor.ServiceTypeKind; +import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForResourceSet; +import org.junit.runner.Description; + + +/** + * This is the ModelSetFixture type. Enjoy. + */ +public class ModelSetFixture extends AbstractModelFixture<TransactionalEditingDomain> { + + public ModelSetFixture() { + super(); + } + + @Override + public ModelSet getResourceSet() { + return (ModelSet)super.getResourceSet(); + } + + protected TransactionalEditingDomain createEditingDomain() { + try { + ServicesRegistry services = createServiceRegistry(); + return (TransactionalEditingDomain)services.getService(ModelSet.class).getTransactionalEditingDomain(); + } catch (Exception e) { + e.printStackTrace(); + fail("Failed to initialize service registry and/or editing domain: " + e.getLocalizedMessage()); + return null; // unreachable + } + } + + @Override + protected void finished(Description description) { + ResourceSet rset = getEditingDomain().getResourceSet(); + + try { + ServicesRegistry services = ServiceUtilsForResourceSet.getInstance().getServiceRegistry(rset); + services.disposeRegistry(); + } catch (Exception e) { + e.printStackTrace(); + } finally { + super.finished(description); + } + } + + protected ServicesRegistry createServiceRegistry() throws Exception { + ServicesRegistry result = new ServicesRegistry(); + + result.add(ModelSet.class, 10, new ModelSet()); + + ServiceDescriptor desc = new ServiceDescriptor(TransactionalEditingDomain.class, EditingDomainServiceFactory.class.getName(), ServiceStartKind.STARTUP, 10, Collections.singletonList(ModelSet.class.getName())); + desc.setServiceTypeKind(ServiceTypeKind.serviceFactory); + desc.setClassBundleID(org.eclipse.papyrus.infra.core.Activator.PLUGIN_ID); + result.add(desc); + + result.startRegistry(); + + return result; + } +} diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/.classpath b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/.classpath new file mode 100644 index 00000000000..ad32c83a788 --- /dev/null +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/.project b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/.project new file mode 100644 index 00000000000..0c142be7b51 --- /dev/null +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.papyrus.uml.modelrepair.tests</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..c537b63063c --- /dev/null +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..d9e7f1372b0 --- /dev/null +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/META-INF/MANIFEST.MF @@ -0,0 +1,11 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: org.eclipse.papyrus.uml.modelrepair.tests +Bundle-Version: 1.0.0.qualifier +Bundle-Vendor: %providerName +Fragment-Host: org.eclipse.papyrus.uml.modelrepair;bundle-version="1.0.0" +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Bundle-Localization: fragment +Require-Bundle: org.junit;bundle-version="4.10.0", + org.eclipse.papyrus.junit.utils;bundle-version="1.0.0" diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/about.html b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/about.html new file mode 100644 index 00000000000..d35d5aed64c --- /dev/null +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/about.html @@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>June 5, 2007</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/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</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/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/build.properties b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/build.properties new file mode 100644 index 00000000000..d0b601e9361 --- /dev/null +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/build.properties @@ -0,0 +1,8 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + fragment.properties,\ + about.html,\ + resources/ +src.includes = about.html diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/fragment.properties b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/fragment.properties new file mode 100644 index 00000000000..022d8c14829 --- /dev/null +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/fragment.properties @@ -0,0 +1,15 @@ +# +# Copyright (c) 2014 CEA 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: +# Christian W. Damus (CEA) - Initial API and implementation +# + +providerName=Eclipse Modeling Project +pluginName= UML Model Repair Tests + diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/org.eclipse.papyrus.uml.modelrepair.tests.launch b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/org.eclipse.papyrus.uml.modelrepair.tests.launch new file mode 100644 index 00000000000..d458284f459 --- /dev/null +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/org.eclipse.papyrus.uml.modelrepair.tests.launch @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig"> +<booleanAttribute key="append.args" value="true"/> +<booleanAttribute key="askclear" value="false"/> +<booleanAttribute key="automaticAdd" value="true"/> +<booleanAttribute key="automaticValidate" value="false"/> +<stringAttribute key="bootstrap" value=""/> +<stringAttribute key="checked" value="[NONE]"/> +<booleanAttribute key="clearConfig" value="true"/> +<booleanAttribute key="clearws" value="true"/> +<booleanAttribute key="clearwslog" value="false"/> +<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/> +<booleanAttribute key="default" value="true"/> +<booleanAttribute key="includeOptional" value="true"/> +<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> +<listEntry value="/org.eclipse.papyrus.uml.modelrepair.tests/src/org/eclipse/papyrus/uml/modelrepair/tests/AllTests.java"/> +</listAttribute> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> +<listEntry value="1"/> +</listAttribute> +<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/> +<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/> +<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/> +<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/> +<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/> +<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> +<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.papyrus.uml.modelrepair.tests.AllTests"/> +<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/> +<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.papyrus.uml.modelrepair.tests"/> +<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/> +<stringAttribute key="pde.version" value="3.3"/> +<stringAttribute key="product" value="org.eclipse.sdk.ide"/> +<booleanAttribute key="run_in_ui_thread" value="true"/> +<booleanAttribute key="show_selected_only" value="false"/> +<booleanAttribute key="tracing" value="false"/> +<booleanAttribute key="useCustomFeatures" value="false"/> +<booleanAttribute key="useDefaultConfig" value="true"/> +<booleanAttribute key="useDefaultConfigArea" value="false"/> +<booleanAttribute key="useProduct" value="true"/> +</launchConfiguration> diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/resources/missingProfileApplication/model.uml b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/resources/missingProfileApplication/model.uml new file mode 100644 index 00000000000..6b363e47dac --- /dev/null +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/resources/missingProfileApplication/model.uml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xmi:XMI xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:MyProfile="http:///schemas/MyProfile/_V3GxoMASEeOtPYrql1dzPg/0" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xsi:schemaLocation="http:///schemas/MyProfile/_V3GxoMASEeOtPYrql1dzPg/0 platform:/plugin/org.eclipse.papyrus.uml.modelrepair.tests/resources/profile/myprofile.profile.uml#_7ruGMMA6EeONOZU5O_ye6g"> + <uml:Model xmi:id="_dvVSIMASEeOtPYrql1dzPg" name="Model"> + <packageImport xmi:type="uml:PackageImport" xmi:id="_dvVSIcASEeOtPYrql1dzPg"> + <importedPackage xmi:type="uml:Model" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/> + </packageImport> + <packagedElement xmi:type="uml:Class" xmi:id="_eiqzkMASEeOtPYrql1dzPg" name="Class1"> + <ownedAttribute xmi:type="uml:Property" xmi:id="_gM4SoMASEeOtPYrql1dzPg" name="Attribute1"/> + <ownedAttribute xmi:type="uml:Property" xmi:id="_xMJ3MMASEeOtPYrql1dzPg" name="Attribute2"/> + </packagedElement> + </uml:Model> + <MyProfile:Stereo xmi:id="_mPac0MASEeOtPYrql1dzPg" base_Class="_eiqzkMASEeOtPYrql1dzPg" alertLevel="yellow" appliesTo="_gM4SoMASEeOtPYrql1dzPg _xMJ3MMASEeOtPYrql1dzPg"> + <tag>p2</tag> + <tag>silver</tag> + <name xmi:type="MyProfile:Name" xmi:id="_2vm4sMASEeOtPYrql1dzPg" lastName="Damus" firstName="Christian"> + <initials>W</initials> + </name> + </MyProfile:Stereo> +</xmi:XMI> diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/resources/missingSchema/model.uml b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/resources/missingSchema/model.uml new file mode 100644 index 00000000000..aedb241ea36 --- /dev/null +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/resources/missingSchema/model.uml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xmi:XMI xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:MyProfile="http:///schemas/MyProfile/_V3GxoMASEeOtPYrql1dzPg/0" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xsi:schemaLocation="http:///schemas/MyProfile/_V3GxoMASEeOtPYrql1dzPg/0 myprofile.profile.uml#_7ruGMMA6EeONOZU5O_ye6g"> + <uml:Model xmi:id="_dvVSIMASEeOtPYrql1dzPg" name="Model"> + <packageImport xmi:type="uml:PackageImport" xmi:id="_dvVSIcASEeOtPYrql1dzPg"> + <importedPackage xmi:type="uml:Model" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/> + </packageImport> + <packagedElement xmi:type="uml:Class" xmi:id="_eiqzkMASEeOtPYrql1dzPg" name="Class1"> + <ownedAttribute xmi:type="uml:Property" xmi:id="_gM4SoMASEeOtPYrql1dzPg" name="Attribute1"/> + <ownedAttribute xmi:type="uml:Property" xmi:id="_xMJ3MMASEeOtPYrql1dzPg" name="Attribute2"/> + </packagedElement> + <profileApplication xmi:type="uml:ProfileApplication" xmi:id="_kovZ8MASEeOtPYrql1dzPg"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_ko_4oMASEeOtPYrql1dzPg" source="http://www.eclipse.org/uml2/2.0.0/UML"> + <references xmi:type="ecore:EPackage" href="myprofile.profile.uml#_7ruGMMA6EeONOZU5O_ye6g"/> + </eAnnotations> + <appliedProfile xmi:type="uml:Profile" href="myprofile.profile.uml#_GdQvQMAREeOtPYrql1dzPg"/> + </profileApplication> + </uml:Model> + <MyProfile:Stereo xmi:id="_mPac0MASEeOtPYrql1dzPg" base_Class="_eiqzkMASEeOtPYrql1dzPg" alertLevel="yellow" appliesTo="_gM4SoMASEeOtPYrql1dzPg _xMJ3MMASEeOtPYrql1dzPg"> + <tag>p2</tag> + <tag>silver</tag> + <name xmi:type="MyProfile:Name" xmi:id="_2vm4sMASEeOtPYrql1dzPg" lastName="Damus" firstName="Christian"> + <initials>W</initials> + </name> + </MyProfile:Stereo> +</xmi:XMI> diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/resources/model/model.di b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/resources/model/model.di new file mode 100644 index 00000000000..bf9abab340f --- /dev/null +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/resources/model/model.di @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/> diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/resources/model/model.notation b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/resources/model/model.notation new file mode 100644 index 00000000000..5370e3416c1 --- /dev/null +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/resources/model/model.notation @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8"?> +<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/viewpoints/policy/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_dvWgQMASEeOtPYrql1dzPg" type="PapyrusUMLClassDiagram" name="classes" measurementUnit="Pixel"> + <children xmi:type="notation:Shape" xmi:id="_eivFAMASEeOtPYrql1dzPg" type="2008"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_o6-EIMASEeOtPYrql1dzPg" source="Stereotype_Annotation"> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_96DGIMASEeOtPYrql1dzPg" key="StereotypeWithQualifiedNameList" value=""/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_96DGIcASEeOtPYrql1dzPg" key="StereotypeList" value="MyProfile::Stereo,MyProfile::Stereo,MyProfile::Stereo,MyProfile::Stereo"/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_96DtMMASEeOtPYrql1dzPg" key="Stereotype_Presentation_Kind" value="HorizontalStereo"/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_96DtMcASEeOtPYrql1dzPg" key="PropStereoDisplay" value="MyProfile::Stereo.alertLevel,MyProfile::Stereo.tag,MyProfile::Stereo.appliesTo"/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_96DtMsASEeOtPYrql1dzPg" key="StereotypePropertyLocation" value="With brace"/> + </eAnnotations> + <children xmi:type="notation:DecorationNode" xmi:id="_eivsEMASEeOtPYrql1dzPg" type="5029"/> + <children xmi:type="notation:BasicCompartment" xmi:id="_eivsEcASEeOtPYrql1dzPg" type="7017"> + <children xmi:type="notation:Node" xmi:id="_gM6u4MASEeOtPYrql1dzPg" type="3012"> + <element xmi:type="uml:Property" href="model.uml#_gM4SoMASEeOtPYrql1dzPg"/> + <layoutConstraint xmi:type="notation:Location" xmi:id="_gM6u4cASEeOtPYrql1dzPg"/> + </children> + <children xmi:type="notation:Node" xmi:id="_xMLFUMASEeOtPYrql1dzPg" type="3012"> + <element xmi:type="uml:Property" href="model.uml#_xMJ3MMASEeOtPYrql1dzPg"/> + <layoutConstraint xmi:type="notation:Location" xmi:id="_xMLFUcASEeOtPYrql1dzPg"/> + </children> + <styles xmi:type="notation:TitleStyle" xmi:id="_eivsEsASEeOtPYrql1dzPg"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_eivsE8ASEeOtPYrql1dzPg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_eivsFMASEeOtPYrql1dzPg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_eivsFcASEeOtPYrql1dzPg"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_eiwTIMASEeOtPYrql1dzPg" type="7018"> + <styles xmi:type="notation:TitleStyle" xmi:id="_eiwTIcASEeOtPYrql1dzPg"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_eiwTIsASEeOtPYrql1dzPg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_eiwTI8ASEeOtPYrql1dzPg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_eiwTJMASEeOtPYrql1dzPg"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_eiwTJcASEeOtPYrql1dzPg" type="7019"> + <styles xmi:type="notation:TitleStyle" xmi:id="_eiwTJsASEeOtPYrql1dzPg"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_eiwTJ8ASEeOtPYrql1dzPg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_eiwTKMASEeOtPYrql1dzPg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_eiwTKcASEeOtPYrql1dzPg"/> + </children> + <element xmi:type="uml:Class" href="model.uml#_eiqzkMASEeOtPYrql1dzPg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_eivFAcASEeOtPYrql1dzPg" x="75" y="107"/> + </children> + <styles xmi:type="notation:DiagramStyle" xmi:id="_dvWgQcASEeOtPYrql1dzPg"/> + <styles xmi:type="style:PapyrusViewStyle" xmi:id="_dvWgQsASEeOtPYrql1dzPg"> + <owner xmi:type="uml:Model" href="model.uml#_dvVSIMASEeOtPYrql1dzPg"/> + </styles> + <element xmi:type="uml:Model" href="model.uml#_dvVSIMASEeOtPYrql1dzPg"/> +</notation:Diagram> diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/resources/model/model.uml b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/resources/model/model.uml new file mode 100644 index 00000000000..eb68d1b187a --- /dev/null +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/resources/model/model.uml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xmi:XMI xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:MyProfile="http:///schemas/MyProfile/_V3GxoMASEeOtPYrql1dzPg/0" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xsi:schemaLocation="http:///schemas/MyProfile/_V3GxoMASEeOtPYrql1dzPg/0 platform:/plugin/org.eclipse.papyrus.uml.modelrepair.tests/resources/profile/myprofile.profile.uml#_7ruGMMA6EeONOZU5O_ye6g"> + <uml:Model xmi:id="_dvVSIMASEeOtPYrql1dzPg" name="Model"> + <packageImport xmi:type="uml:PackageImport" xmi:id="_dvVSIcASEeOtPYrql1dzPg"> + <importedPackage xmi:type="uml:Model" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/> + </packageImport> + <packagedElement xmi:type="uml:Class" xmi:id="_eiqzkMASEeOtPYrql1dzPg" name="Class1"> + <ownedAttribute xmi:type="uml:Property" xmi:id="_gM4SoMASEeOtPYrql1dzPg" name="Attribute1"/> + <ownedAttribute xmi:type="uml:Property" xmi:id="_xMJ3MMASEeOtPYrql1dzPg" name="Attribute2"/> + </packagedElement> + <profileApplication xmi:type="uml:ProfileApplication" xmi:id="_kovZ8MASEeOtPYrql1dzPg"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_ko_4oMASEeOtPYrql1dzPg" source="http://www.eclipse.org/uml2/2.0.0/UML"> + <references xmi:type="ecore:EPackage" href="platform:/plugin/org.eclipse.papyrus.uml.modelrepair.tests/resources/profile/myprofile.profile.uml#_7ruGMMA6EeONOZU5O_ye6g"/> + </eAnnotations> + <appliedProfile xmi:type="uml:Profile" href="platform:/plugin/org.eclipse.papyrus.uml.modelrepair.tests/resources/profile/myprofile.profile.uml#_GdQvQMAREeOtPYrql1dzPg"/> + </profileApplication> + </uml:Model> + <MyProfile:Stereo xmi:id="_mPac0MASEeOtPYrql1dzPg" base_Class="_eiqzkMASEeOtPYrql1dzPg" alertLevel="yellow" appliesTo="_gM4SoMASEeOtPYrql1dzPg _xMJ3MMASEeOtPYrql1dzPg"> + <tag>p2</tag> + <tag>silver</tag> + <name xmi:type="MyProfile:Name" xmi:id="_2vm4sMASEeOtPYrql1dzPg" lastName="Damus" firstName="Christian"> + <initials>W</initials> + </name> + </MyProfile:Stereo> +</xmi:XMI> diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/resources/profile/myprofile.profile.di b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/resources/profile/myprofile.profile.di new file mode 100644 index 00000000000..bf9abab340f --- /dev/null +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/resources/profile/myprofile.profile.di @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/> diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/resources/profile/myprofile.profile.notation b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/resources/profile/myprofile.profile.notation new file mode 100644 index 00000000000..2d4d1cb6dda --- /dev/null +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/resources/profile/myprofile.profile.notation @@ -0,0 +1,170 @@ +<?xml version="1.0" encoding="UTF-8"?> +<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/viewpoints/policy/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_GdnUkMAREeOtPYrql1dzPg" type="PapyrusUMLProfileDiagram" name="stereotypes" measurementUnit="Pixel"> + <children xmi:type="notation:Shape" xmi:id="_L7xmYMAREeOtPYrql1dzPg" type="1026"> + <children xmi:type="notation:DecorationNode" xmi:id="_L7zbkMAREeOtPYrql1dzPg" type="1034"/> + <children xmi:type="notation:BasicCompartment" xmi:id="_L7zbkcAREeOtPYrql1dzPg" type="1071"> + <children xmi:type="notation:Node" xmi:id="_dWGvQMAREeOtPYrql1dzPg" type="3002"> + <element xmi:type="uml:Property" href="myprofile.profile.uml#_dTmN0MAREeOtPYrql1dzPg"/> + <layoutConstraint xmi:type="notation:Location" xmi:id="_dWGvQcAREeOtPYrql1dzPg"/> + </children> + <children xmi:type="notation:Node" xmi:id="_kOTWIMAREeOtPYrql1dzPg" type="3002"> + <element xmi:type="uml:Property" href="myprofile.profile.uml#_kORg8MAREeOtPYrql1dzPg"/> + <layoutConstraint xmi:type="notation:Location" xmi:id="_kOTWIcAREeOtPYrql1dzPg"/> + </children> + <styles xmi:type="notation:TitleStyle" xmi:id="_L7zbksAREeOtPYrql1dzPg"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_L7zbk8AREeOtPYrql1dzPg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_L7zblMAREeOtPYrql1dzPg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_L7zblcAREeOtPYrql1dzPg"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_L7zblsAREeOtPYrql1dzPg" type="1019"> + <styles xmi:type="notation:TitleStyle" xmi:id="_L7zbl8AREeOtPYrql1dzPg"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_L7zbmMAREeOtPYrql1dzPg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_L7zbmcAREeOtPYrql1dzPg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_L7zbmsAREeOtPYrql1dzPg"/> + </children> + <element xmi:type="uml:Stereotype" href="myprofile.profile.uml#_L7n1YMAREeOtPYrql1dzPg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_L7xmYcAREeOtPYrql1dzPg" x="124" y="90"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_RUGV8MAREeOtPYrql1dzPg" type="1031"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_RUHkEMAREeOtPYrql1dzPg" source="Stereotype_Annotation"> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_RUILIMAREeOtPYrql1dzPg" key="StereotypeWithQualifiedNameList" value=""/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_RUILIcAREeOtPYrql1dzPg" key="StereotypeList" value="StandardProfile::Metaclass"/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_RUILIsAREeOtPYrql1dzPg" key="Stereotype_Presentation_Kind" value="HorizontalStereo"/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_RUILI8AREeOtPYrql1dzPg" key="PropStereoDisplay" value=""/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_RUILJMAREeOtPYrql1dzPg" key="StereotypePropertyLocation" value="Compartment"/> + </eAnnotations> + <children xmi:type="notation:DecorationNode" xmi:id="_RUG9AMAREeOtPYrql1dzPg" type="1084"/> + <element xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_RUG9AcAREeOtPYrql1dzPg" x="496" y="86"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_UY9OEMAREeOtPYrql1dzPg" type="2006"> + <children xmi:type="notation:DecorationNode" xmi:id="_UY91IMAREeOtPYrql1dzPg" type="5023"/> + <children xmi:type="notation:BasicCompartment" xmi:id="_UY91IcAREeOtPYrql1dzPg" type="1063"> + <children xmi:type="notation:Node" xmi:id="_XIFGwMAREeOtPYrql1dzPg" type="1037"> + <element xmi:type="uml:EnumerationLiteral" href="myprofile.profile.uml#_XIBcYMAREeOtPYrql1dzPg"/> + <layoutConstraint xmi:type="notation:Location" xmi:id="_XIFGwcAREeOtPYrql1dzPg"/> + </children> + <children xmi:type="notation:Node" xmi:id="_ZhktsMAREeOtPYrql1dzPg" type="1037"> + <element xmi:type="uml:EnumerationLiteral" href="myprofile.profile.uml#_ZhjfkMAREeOtPYrql1dzPg"/> + <layoutConstraint xmi:type="notation:Location" xmi:id="_ZhktscAREeOtPYrql1dzPg"/> + </children> + <children xmi:type="notation:Node" xmi:id="_ZyoogMAREeOtPYrql1dzPg" type="1037"> + <element xmi:type="uml:EnumerationLiteral" href="myprofile.profile.uml#_ZynaYMAREeOtPYrql1dzPg"/> + <layoutConstraint xmi:type="notation:Location" xmi:id="_ZyoogcAREeOtPYrql1dzPg"/> + </children> + <children xmi:type="notation:Node" xmi:id="_4YUbwMA6EeONOZU5O_ye6g" type="1037"> + <element xmi:type="uml:EnumerationLiteral" href="myprofile.profile.uml#_4XxCIMA6EeONOZU5O_ye6g"/> + <layoutConstraint xmi:type="notation:Location" xmi:id="_4YUbwcA6EeONOZU5O_ye6g"/> + </children> + <styles xmi:type="notation:TitleStyle" xmi:id="_UY91IsAREeOtPYrql1dzPg"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_UY91I8AREeOtPYrql1dzPg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_UY91JMAREeOtPYrql1dzPg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_UY91JcAREeOtPYrql1dzPg"/> + </children> + <element xmi:type="uml:Enumeration" href="myprofile.profile.uml#_UYLK8MAREeOtPYrql1dzPg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_UY9OEcAREeOtPYrql1dzPg" x="328" y="292"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_tBrQQMAREeOtPYrql1dzPg" type="2010"> + <children xmi:type="notation:DecorationNode" xmi:id="_tBrQQsAREeOtPYrql1dzPg" type="5035"/> + <children xmi:type="notation:BasicCompartment" xmi:id="_tBr3UMAREeOtPYrql1dzPg" type="1067"> + <children xmi:type="notation:Node" xmi:id="_uQWp4MAREeOtPYrql1dzPg" type="3018"> + <element xmi:type="uml:Property" href="myprofile.profile.uml#_uQTmkMAREeOtPYrql1dzPg"/> + <layoutConstraint xmi:type="notation:Location" xmi:id="_uQWp4cAREeOtPYrql1dzPg"/> + </children> + <children xmi:type="notation:Node" xmi:id="_vbxUIMAREeOtPYrql1dzPg" type="3018"> + <element xmi:type="uml:Property" href="myprofile.profile.uml#_vbuQ0MAREeOtPYrql1dzPg"/> + <layoutConstraint xmi:type="notation:Location" xmi:id="_vbxUIcAREeOtPYrql1dzPg"/> + </children> + <children xmi:type="notation:Node" xmi:id="_3dOpIMAREeOtPYrql1dzPg" type="3018"> + <element xmi:type="uml:Property" href="myprofile.profile.uml#_3dNbAMAREeOtPYrql1dzPg"/> + <layoutConstraint xmi:type="notation:Location" xmi:id="_3dOpIcAREeOtPYrql1dzPg"/> + </children> + <styles xmi:type="notation:TitleStyle" xmi:id="_tBr3UcAREeOtPYrql1dzPg"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_tBr3UsAREeOtPYrql1dzPg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_tBr3U8AREeOtPYrql1dzPg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_tBr3VMAREeOtPYrql1dzPg"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_tBr3VcAREeOtPYrql1dzPg" type="1068"> + <styles xmi:type="notation:TitleStyle" xmi:id="_tBr3VsAREeOtPYrql1dzPg"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_tBr3V8AREeOtPYrql1dzPg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_tBr3WMAREeOtPYrql1dzPg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_tBr3WcAREeOtPYrql1dzPg"/> + </children> + <element xmi:type="uml:DataType" href="myprofile.profile.uml#_tBqCIMAREeOtPYrql1dzPg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_tBrQQcAREeOtPYrql1dzPg" x="132" y="294"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_L3cqkMASEeOtPYrql1dzPg" type="1031"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_L3d4sMASEeOtPYrql1dzPg" source="Stereotype_Annotation"> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_L3d4scASEeOtPYrql1dzPg" key="StereotypeWithQualifiedNameList" value=""/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_L3d4ssASEeOtPYrql1dzPg" key="StereotypeList" value="StandardProfile::Metaclass"/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_L3d4s8ASEeOtPYrql1dzPg" key="Stereotype_Presentation_Kind" value="HorizontalStereo"/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_L3d4tMASEeOtPYrql1dzPg" key="PropStereoDisplay" value=""/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_L3d4tcASEeOtPYrql1dzPg" key="StereotypePropertyLocation" value="Compartment"/> + </eAnnotations> + <children xmi:type="notation:DecorationNode" xmi:id="_L3dRoMASEeOtPYrql1dzPg" type="1084"/> + <element xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Property"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_L3dRocASEeOtPYrql1dzPg" x="494" y="204"/> + </children> + <styles xmi:type="notation:DiagramStyle" xmi:id="_GdnUkcAREeOtPYrql1dzPg"/> + <styles xmi:type="style:PapyrusViewStyle" xmi:id="_GdnUksAREeOtPYrql1dzPg"> + <owner xmi:type="uml:Profile" href="myprofile.profile.uml#_GdQvQMAREeOtPYrql1dzPg"/> + </styles> + <element xmi:type="uml:Profile" href="myprofile.profile.uml#_GdQvQMAREeOtPYrql1dzPg"/> + <edges xmi:type="notation:Connector" xmi:id="_Sq8NEMAREeOtPYrql1dzPg" type="1013" source="_L7xmYMAREeOtPYrql1dzPg" target="_RUGV8MAREeOtPYrql1dzPg"> + <styles xmi:type="notation:FontStyle" xmi:id="_Sq8NEcAREeOtPYrql1dzPg"/> + <element xmi:type="uml:Extension" href="myprofile.profile.uml#_Sq3UkcAREeOtPYrql1dzPg"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Sq8NEsAREeOtPYrql1dzPg" points="[17, 9, -322, -22]$[289, -13, -50, -44]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_SrGlIMAREeOtPYrql1dzPg" id="(0.83,0.15)"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_TI4tUMAREeOtPYrql1dzPg" id="(0.06,0.24)"/> + </edges> + <edges xmi:type="notation:Connector" xmi:id="_8M8gkMAREeOtPYrql1dzPg" type="4001" source="_L7xmYMAREeOtPYrql1dzPg" target="_tBrQQMAREeOtPYrql1dzPg"> + <children xmi:type="notation:DecorationNode" xmi:id="_8M9HoMAREeOtPYrql1dzPg" type="6001"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_8M9HocAREeOtPYrql1dzPg" y="60"/> + </children> + <children xmi:type="notation:DecorationNode" xmi:id="_8M9HosAREeOtPYrql1dzPg" visible="false" type="6002"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_8M9Ho8AREeOtPYrql1dzPg" y="20"/> + </children> + <children xmi:type="notation:DecorationNode" xmi:id="_8M9usMAREeOtPYrql1dzPg" type="6003"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_8M9uscAREeOtPYrql1dzPg" y="20"/> + </children> + <children xmi:type="notation:DecorationNode" xmi:id="_8M9ussAREeOtPYrql1dzPg" type="6005"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_8M9us8AREeOtPYrql1dzPg" y="-20"/> + </children> + <children xmi:type="notation:DecorationNode" xmi:id="_8M9utMAREeOtPYrql1dzPg" type="6033"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_8M9utcAREeOtPYrql1dzPg" y="20"/> + </children> + <children xmi:type="notation:DecorationNode" xmi:id="_8M-VwMAREeOtPYrql1dzPg" type="6034"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_8M-VwcAREeOtPYrql1dzPg" y="-20"/> + </children> + <styles xmi:type="notation:FontStyle" xmi:id="_8M8gkcAREeOtPYrql1dzPg"/> + <element xmi:type="uml:Association" href="myprofile.profile.uml#_8M6EUMAREeOtPYrql1dzPg"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_8M8gksAREeOtPYrql1dzPg" points="[4, 26, -40, -138]$[0, 108, -44, -56]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_8NkysMAREeOtPYrql1dzPg" id="(0.6058394160583942,1.0)"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Bd1LYMASEeOtPYrql1dzPg" id="(0.5681818181818182,0.0)"/> + </edges> + <edges xmi:type="notation:Connector" xmi:id="_Mv7xwMASEeOtPYrql1dzPg" type="4001" source="_L7xmYMAREeOtPYrql1dzPg" target="_L3cqkMASEeOtPYrql1dzPg"> + <children xmi:type="notation:DecorationNode" xmi:id="_Mv7xw8ASEeOtPYrql1dzPg" type="6001"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_Mv7xxMASEeOtPYrql1dzPg" y="60"/> + </children> + <children xmi:type="notation:DecorationNode" xmi:id="_Mv8Y0MASEeOtPYrql1dzPg" visible="false" type="6002"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_Mv8Y0cASEeOtPYrql1dzPg" y="20"/> + </children> + <children xmi:type="notation:DecorationNode" xmi:id="_Mv8Y0sASEeOtPYrql1dzPg" type="6003"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_Mv8Y08ASEeOtPYrql1dzPg" y="20"/> + </children> + <children xmi:type="notation:DecorationNode" xmi:id="_Mv8Y1MASEeOtPYrql1dzPg" type="6005"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_Mv8_4MASEeOtPYrql1dzPg" y="-20"/> + </children> + <children xmi:type="notation:DecorationNode" xmi:id="_Mv8_4cASEeOtPYrql1dzPg" type="6033"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_Mv8_4sASEeOtPYrql1dzPg" y="20"/> + </children> + <children xmi:type="notation:DecorationNode" xmi:id="_Mv8_48ASEeOtPYrql1dzPg" type="6034"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_Mv8_5MASEeOtPYrql1dzPg" y="-20"/> + </children> + <styles xmi:type="notation:FontStyle" xmi:id="_Mv7xwcASEeOtPYrql1dzPg"/> + <element xmi:type="uml:Association" href="myprofile.profile.uml#_Mv58kMASEeOtPYrql1dzPg"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Mv7xwsASEeOtPYrql1dzPg" points="[31, 12, -151, -62]$[168, 55, -14, -19]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_MwbhAMASEeOtPYrql1dzPg" id="(1.0,0.5135135135135135)"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_MwbhAcASEeOtPYrql1dzPg" id="(0.0,0.1)"/> + </edges> +</notation:Diagram> diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/resources/profile/myprofile.profile.uml b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/resources/profile/myprofile.profile.uml new file mode 100644 index 00000000000..064f82e74ba --- /dev/null +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/resources/profile/myprofile.profile.uml @@ -0,0 +1,160 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xmi:XMI xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ActionLanguage="http://www.omg.org/spec/ALF/20120827/ActionLanguage-Profile" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xsi:schemaLocation="http://www.omg.org/spec/ALF/20120827/ActionLanguage-Profile pathmap://PAPYRUS_ACTIONLANGUAGE_PROFILE/ActionLanguage-Profile.profile.uml#_sYse0YZLEeKyw49uR6nx3g"> + <uml:Profile xmi:id="_GdQvQMAREeOtPYrql1dzPg" name="MyProfile" metaclassReference="_RUDSoMAREeOtPYrql1dzPg _L3bccMASEeOtPYrql1dzPg"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_V3LDEMASEeOtPYrql1dzPg" source="http://www.eclipse.org/uml2/2.0.0/UML"> + <contents xmi:type="ecore:EPackage" xmi:id="_7ruGMMA6EeONOZU5O_ye6g" name="MyProfile" nsURI="http:///schemas/MyProfile/_7rsRAMA6EeONOZU5O_ye6g/1" nsPrefix="MyProfile"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_7rwicMA6EeONOZU5O_ye6g" source="PapyrusVersion"> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_7rwiccA6EeONOZU5O_ye6g" key="Version" value="0.0.2"/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_7rwicsA6EeONOZU5O_ye6g" key="Comment" value=""/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_7rwic8A6EeONOZU5O_ye6g" key="Copyright" value=""/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_7rwidMA6EeONOZU5O_ye6g" key="Date" value="2014-04-09"/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_7rwidcA6EeONOZU5O_ye6g" key="Author" value=""/> + </eAnnotations> + <eClassifiers xmi:type="ecore:EClass" xmi:id="_7ruGMcA6EeONOZU5O_ye6g" name="Stereo"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_7ruGMsA6EeONOZU5O_ye6g" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_L7n1YMAREeOtPYrql1dzPg"/> + <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_7ruGM8A6EeONOZU5O_ye6g" name="base_Class" ordered="false" lowerBound="1"> + <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/> + </eStructuralFeatures> + <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_7ruGNcA6EeONOZU5O_ye6g" name="alertLevel" ordered="false" unique="false" lowerBound="1" eType="_7ruGPcA6EeONOZU5O_ye6g"/> + <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_7ruGN8A6EeONOZU5O_ye6g" name="tag" ordered="false" upperBound="-1"> + <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//String"/> + </eStructuralFeatures> + <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_7ruGOcA6EeONOZU5O_ye6g" name="name" ordered="false" upperBound="-1" eType="_7ruGQ8A6EeONOZU5O_ye6g" containment="true"/> + <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_7ruGO8A6EeONOZU5O_ye6g" name="appliesTo" ordered="false" upperBound="-1"> + <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Property"/> + </eStructuralFeatures> + </eClassifiers> + <eClassifiers xmi:type="ecore:EEnum" xmi:id="_7ruGPcA6EeONOZU5O_ye6g" name="Colour"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_7ruGPsA6EeONOZU5O_ye6g" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_UYLK8MAREeOtPYrql1dzPg"/> + <eLiterals xmi:type="ecore:EEnumLiteral" xmi:id="_7ruGP8A6EeONOZU5O_ye6g" name="red"/> + <eLiterals xmi:type="ecore:EEnumLiteral" xmi:id="_7ruGQMA6EeONOZU5O_ye6g" name="yellow" value="1"/> + <eLiterals xmi:type="ecore:EEnumLiteral" xmi:id="_7ruGQcA6EeONOZU5O_ye6g" name="green" value="2"/> + <eLiterals xmi:type="ecore:EEnumLiteral" xmi:id="_7ruGQsA6EeONOZU5O_ye6g" name="unknown" value="3"/> + </eClassifiers> + <eClassifiers xmi:type="ecore:EClass" xmi:id="_7ruGQ8A6EeONOZU5O_ye6g" name="Name"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_7ruGRMA6EeONOZU5O_ye6g" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_tBqCIMAREeOtPYrql1dzPg"/> + <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_7ruGRcA6EeONOZU5O_ye6g" name="lastName" ordered="false" lowerBound="1"> + <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//String"/> + </eStructuralFeatures> + <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_7ruGR8A6EeONOZU5O_ye6g" name="initials" ordered="false" upperBound="-1"> + <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//String"/> + </eStructuralFeatures> + <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_7ruGScA6EeONOZU5O_ye6g" name="firstName" ordered="false" lowerBound="1"> + <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//String"/> + </eStructuralFeatures> + </eClassifiers> + </contents> + <contents xmi:type="ecore:EPackage" xmi:id="_V3LqIMASEeOtPYrql1dzPg" name="MyProfile" nsURI="http:///schemas/MyProfile/_V3GxoMASEeOtPYrql1dzPg/0" nsPrefix="MyProfile"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_V3OGYcASEeOtPYrql1dzPg" source="PapyrusVersion"> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_V3OGYsASEeOtPYrql1dzPg" key="Version" value="0.0.1"/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_V3OGY8ASEeOtPYrql1dzPg" key="Comment" value=""/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_V3OGZMASEeOtPYrql1dzPg" key="Copyright" value=""/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_V3OGZcASEeOtPYrql1dzPg" key="Date" value="2014-04-09"/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_V3OGZsASEeOtPYrql1dzPg" key="Author" value=""/> + </eAnnotations> + <eClassifiers xmi:type="ecore:EClass" xmi:id="_V3LqIcASEeOtPYrql1dzPg" name="Stereo"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_V3LqIsASEeOtPYrql1dzPg" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_L7n1YMAREeOtPYrql1dzPg"/> + <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_V3LqI8ASEeOtPYrql1dzPg" name="base_Class" ordered="false" lowerBound="1"> + <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/> + </eStructuralFeatures> + <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_V3LqJcASEeOtPYrql1dzPg" name="alertLevel" ordered="false" unique="false" lowerBound="1" eType="_V3LqLcASEeOtPYrql1dzPg"/> + <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_V3LqJ8ASEeOtPYrql1dzPg" name="tag" ordered="false" upperBound="-1"> + <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//String"/> + </eStructuralFeatures> + <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_V3LqKcASEeOtPYrql1dzPg" name="name" ordered="false" upperBound="-1" eType="_V3LqMsASEeOtPYrql1dzPg" containment="true"/> + <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_V3LqK8ASEeOtPYrql1dzPg" name="appliesTo" ordered="false" upperBound="-1"> + <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Property"/> + </eStructuralFeatures> + </eClassifiers> + <eClassifiers xmi:type="ecore:EEnum" xmi:id="_V3LqLcASEeOtPYrql1dzPg" name="Colour"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_V3LqLsASEeOtPYrql1dzPg" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_UYLK8MAREeOtPYrql1dzPg"/> + <eLiterals xmi:type="ecore:EEnumLiteral" xmi:id="_V3LqL8ASEeOtPYrql1dzPg" name="red"/> + <eLiterals xmi:type="ecore:EEnumLiteral" xmi:id="_V3LqMMASEeOtPYrql1dzPg" name="yellow" value="1"/> + <eLiterals xmi:type="ecore:EEnumLiteral" xmi:id="_V3LqMcASEeOtPYrql1dzPg" name="green" value="2"/> + </eClassifiers> + <eClassifiers xmi:type="ecore:EClass" xmi:id="_V3LqMsASEeOtPYrql1dzPg" name="Name"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_V3LqM8ASEeOtPYrql1dzPg" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_tBqCIMAREeOtPYrql1dzPg"/> + <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_V3LqNMASEeOtPYrql1dzPg" name="lastName" ordered="false" lowerBound="1"> + <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//String"/> + </eStructuralFeatures> + <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_V3LqNsASEeOtPYrql1dzPg" name="initials" ordered="false" upperBound="-1"> + <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//String"/> + </eStructuralFeatures> + <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_V3LqOMASEeOtPYrql1dzPg" name="firstName" ordered="false" lowerBound="1"> + <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//String"/> + </eStructuralFeatures> + </eClassifiers> + </contents> + </eAnnotations> + <elementImport xmi:type="uml:ElementImport" xmi:id="_RUDSoMAREeOtPYrql1dzPg" alias="Class"> + <importedElement xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/> + </elementImport> + <elementImport xmi:type="uml:ElementImport" xmi:id="_L3bccMASEeOtPYrql1dzPg" alias="Property"> + <importedElement xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Property"/> + </elementImport> + <packagedElement xmi:type="uml:Stereotype" xmi:id="_L7n1YMAREeOtPYrql1dzPg" name="Stereo"> + <ownedAttribute xmi:type="uml:Property" xmi:id="_Sq3UkMAREeOtPYrql1dzPg" name="base_Class" association="_Sq3UkcAREeOtPYrql1dzPg"> + <type xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/> + </ownedAttribute> + <ownedAttribute xmi:type="uml:Property" xmi:id="_dTmN0MAREeOtPYrql1dzPg" name="alertLevel" visibility="public" type="_UYLK8MAREeOtPYrql1dzPg" isUnique="false"> + <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_ek1MMMAREeOtPYrql1dzPg" value="1"/> + <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_ek3ocMAREeOtPYrql1dzPg" value="1"/> + </ownedAttribute> + <ownedAttribute xmi:type="uml:Property" xmi:id="_kORg8MAREeOtPYrql1dzPg" name="tag"> + <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/> + <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_q99sEMAREeOtPYrql1dzPg"/> + <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_q99sEcAREeOtPYrql1dzPg" value="*"/> + </ownedAttribute> + <ownedAttribute xmi:type="uml:Property" xmi:id="_8M5dQMAREeOtPYrql1dzPg" name="name" type="_tBqCIMAREeOtPYrql1dzPg" association="_8M6EUMAREeOtPYrql1dzPg"> + <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_8M5dQcAREeOtPYrql1dzPg"/> + <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_8M5dQsAREeOtPYrql1dzPg" value="*"/> + </ownedAttribute> + <ownedAttribute xmi:type="uml:Property" xmi:id="_Mv5VgMASEeOtPYrql1dzPg" name="appliesTo" association="_Mv58kMASEeOtPYrql1dzPg"> + <type xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Property"/> + <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_Mv5VgcASEeOtPYrql1dzPg"/> + <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_Mv5VgsASEeOtPYrql1dzPg" value="*"/> + </ownedAttribute> + </packagedElement> + <packagedElement xmi:type="uml:Extension" xmi:id="_Sq3UkcAREeOtPYrql1dzPg" name="E_Stereo_Class1" memberEnd="_Sq3UksAREeOtPYrql1dzPg _Sq3UkMAREeOtPYrql1dzPg"> + <ownedEnd xmi:type="uml:ExtensionEnd" xmi:id="_Sq3UksAREeOtPYrql1dzPg" name="extension_Stereo" type="_L7n1YMAREeOtPYrql1dzPg" aggregation="composite" association="_Sq3UkcAREeOtPYrql1dzPg"/> + </packagedElement> + <packagedElement xmi:type="uml:Enumeration" xmi:id="_UYLK8MAREeOtPYrql1dzPg" name="Colour"> + <ownedLiteral xmi:type="uml:EnumerationLiteral" xmi:id="_XIBcYMAREeOtPYrql1dzPg" name="red"/> + <ownedLiteral xmi:type="uml:EnumerationLiteral" xmi:id="_ZhjfkMAREeOtPYrql1dzPg" name="yellow"/> + <ownedLiteral xmi:type="uml:EnumerationLiteral" xmi:id="_ZynaYMAREeOtPYrql1dzPg" name="green"/> + <ownedLiteral xmi:type="uml:EnumerationLiteral" xmi:id="_4XxCIMA6EeONOZU5O_ye6g" name="unknown"/> + </packagedElement> + <packagedElement xmi:type="uml:DataType" xmi:id="_tBqCIMAREeOtPYrql1dzPg" name="Name"> + <ownedAttribute xmi:type="uml:Property" xmi:id="_uQTmkMAREeOtPYrql1dzPg" name="lastName"> + <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/> + </ownedAttribute> + <ownedAttribute xmi:type="uml:Property" xmi:id="_vbuQ0MAREeOtPYrql1dzPg" name="initials"> + <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/> + <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_2NxMYMAREeOtPYrql1dzPg"/> + <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_2NxzcMAREeOtPYrql1dzPg" value="*"/> + </ownedAttribute> + <ownedAttribute xmi:type="uml:Property" xmi:id="_3dNbAMAREeOtPYrql1dzPg" name="firstName"> + <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/> + </ownedAttribute> + </packagedElement> + <packagedElement xmi:type="uml:Association" xmi:id="_8M6EUMAREeOtPYrql1dzPg" name="stereo_name_1" memberEnd="_8M6EUcAREeOtPYrql1dzPg _8M5dQMAREeOtPYrql1dzPg"> + <ownedEnd xmi:type="uml:Property" xmi:id="_8M6EUcAREeOtPYrql1dzPg" name="stereo" type="_L7n1YMAREeOtPYrql1dzPg" association="_8M6EUMAREeOtPYrql1dzPg"> + <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_8M6EUsAREeOtPYrql1dzPg" value="1"/> + <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_8M6EU8AREeOtPYrql1dzPg" value="1"/> + </ownedEnd> + </packagedElement> + <packagedElement xmi:type="uml:Association" xmi:id="_Mv58kMASEeOtPYrql1dzPg" name="stereo_property_1" memberEnd="_Mv58kcASEeOtPYrql1dzPg _Mv5VgMASEeOtPYrql1dzPg"> + <ownedEnd xmi:type="uml:Property" xmi:id="_Mv58kcASEeOtPYrql1dzPg" name="stereo" type="_L7n1YMAREeOtPYrql1dzPg" association="_Mv58kMASEeOtPYrql1dzPg"> + <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_Mv58ksASEeOtPYrql1dzPg" value="1"/> + <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_Mv58k8ASEeOtPYrql1dzPg" value="1"/> + </ownedEnd> + </packagedElement> + <profileApplication xmi:type="uml:ProfileApplication" xmi:id="_lxj4oMAREeOtPYrql1dzPg"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_lx1lcMAREeOtPYrql1dzPg" source="http://www.eclipse.org/uml2/2.0.0/UML"> + <references xmi:type="ecore:EPackage" href="pathmap://PAPYRUS_ACTIONLANGUAGE_PROFILE/ActionLanguage-Profile.profile.uml#_sYse0YZLEeKyw49uR6nx3g"/> + </eAnnotations> + <appliedProfile xmi:type="uml:Profile" href="pathmap://PAPYRUS_ACTIONLANGUAGE_PROFILE/ActionLanguage-Profile.profile.uml#ActionLanguage"/> + </profileApplication> + </uml:Profile> + <ActionLanguage:TextualRepresentation xmi:id="_lx4BsMAREeOtPYrql1dzPg" language="org.eclipse.papyrus.uml.textedit.property.xtext.UmlProperty"/> +</xmi:XMI> diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/resources/wrongProfileVersion/model.uml b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/resources/wrongProfileVersion/model.uml new file mode 100644 index 00000000000..4896a126aad --- /dev/null +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/resources/wrongProfileVersion/model.uml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xmi:XMI xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:MyProfile="http:///schemas/MyProfile/_V3GxoMASEeOtPYrql1dzPg/0" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xsi:schemaLocation="http:///schemas/MyProfile/_V3GxoMASEeOtPYrql1dzPg/0 platform:/plugin/org.eclipse.papyrus.uml.modelrepair.tests/resources/profile/myprofile.profile.uml#_V3LqIMASEeOtPYrql1dzPg"> + <uml:Model xmi:id="_dvVSIMASEeOtPYrql1dzPg" name="Model"> + <packageImport xmi:type="uml:PackageImport" xmi:id="_dvVSIcASEeOtPYrql1dzPg"> + <importedPackage xmi:type="uml:Model" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/> + </packageImport> + <packagedElement xmi:type="uml:Class" xmi:id="_eiqzkMASEeOtPYrql1dzPg" name="Class1"> + <ownedAttribute xmi:type="uml:Property" xmi:id="_gM4SoMASEeOtPYrql1dzPg" name="Attribute1"/> + <ownedAttribute xmi:type="uml:Property" xmi:id="_xMJ3MMASEeOtPYrql1dzPg" name="Attribute2"/> + </packagedElement> + <profileApplication xmi:type="uml:ProfileApplication" xmi:id="_kovZ8MASEeOtPYrql1dzPg"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_ko_4oMASEeOtPYrql1dzPg" source="http://www.eclipse.org/uml2/2.0.0/UML"> + <references xmi:type="ecore:EPackage" href="platform:/plugin/org.eclipse.papyrus.uml.modelrepair.tests/resources/profile/myprofile.profile.uml#_7ruGMMA6EeONOZU5O_ye6g"/> + </eAnnotations> + <appliedProfile xmi:type="uml:Profile" href="platform:/plugin/org.eclipse.papyrus.uml.modelrepair.tests/resources/profile/myprofile.profile.uml#_GdQvQMAREeOtPYrql1dzPg"/> + </profileApplication> + </uml:Model> + <MyProfile:Stereo xmi:id="_mPac0MASEeOtPYrql1dzPg" base_Class="_eiqzkMASEeOtPYrql1dzPg" alertLevel="yellow" appliesTo="_gM4SoMASEeOtPYrql1dzPg _xMJ3MMASEeOtPYrql1dzPg"> + <tag>p2</tag> + <tag>silver</tag> + <name xmi:type="MyProfile:Name" xmi:id="_2vm4sMASEeOtPYrql1dzPg" lastName="Damus" firstName="Christian"> + <initials>W</initials> + </name> + </MyProfile:Stereo> +</xmi:XMI> diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/src/org/eclipse/papyrus/uml/modelrepair/internal/stereotypes/StereotypeApplicationRepairSnippetTest.java b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/src/org/eclipse/papyrus/uml/modelrepair/internal/stereotypes/StereotypeApplicationRepairSnippetTest.java new file mode 100644 index 00000000000..93e35b5bc7a --- /dev/null +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/src/org/eclipse/papyrus/uml/modelrepair/internal/stereotypes/StereotypeApplicationRepairSnippetTest.java @@ -0,0 +1,255 @@ +/* + * Copyright (c) 2014 CEA 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: + * Christian W. Damus (CEA) - Initial API and implementation + * + */ +package org.eclipse.papyrus.uml.modelrepair.internal.stereotypes; + +import static org.hamcrest.CoreMatchers.hasItem; +import static org.hamcrest.CoreMatchers.instanceOf; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.CoreMatchers.notNullValue; +import static org.hamcrest.CoreMatchers.nullValue; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.fail; + +import java.util.Arrays; +import java.util.Collection; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.Enumerator; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.ecore.util.ExtendedMetaData; +import org.eclipse.emf.ecore.xmi.XMLResource; +import org.eclipse.papyrus.infra.core.utils.TransactionHelper; +import org.eclipse.papyrus.junit.utils.rules.ModelSetFixture; +import org.eclipse.papyrus.junit.utils.rules.PluginResource; +import org.eclipse.papyrus.junit.utils.tests.AbstractPapyrusTest; +import org.eclipse.uml2.common.util.UML2Util; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Profile; +import org.eclipse.uml2.uml.Stereotype; +import org.eclipse.uml2.uml.UMLPackage; +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; + +import com.google.common.base.Suppliers; + + +/** + * Automated tests for the {@link StereotypeApplicationRepairSnippet} class and its dependecies. + */ +public class StereotypeApplicationRepairSnippetTest extends AbstractPapyrusTest { + + @Rule + public ModelSetFixture modelSet = new ModelSetFixture(); + + private Profile profile; + + private Stereotype stereotype; + + private Class class1; + + private StereotypeApplicationRepairSnippet fixture; + + private ZombieStereotypesDescriptor zombies; + + public StereotypeApplicationRepairSnippetTest() { + super(); + } + + /** + * Test case in which all stereotype applications are recognized and there is no corruption (a control case). + */ + @Test + @PluginResource("/resources/model/model.uml") + public void noCorruptionControlCase() { + assertThat("Should not have found zombie stereotypes", zombies, nullValue()); + + assertStereotypeApplication(); + } + + /** + * Test case in which the profile application is not missing, and the EPackage schema is successfully resolved by EMF, but + * the stereotype applications are from a different version of the profile than is currently applied. + */ + @Test + @PluginResource("/resources/wrongProfileVersion/model.uml") + public void wrongProfileVersion() { + assertThat("Should have found zombie stereotypes", zombies, notNullValue()); + + EPackage schema = getOnlyZombieSchema(); + assertThat("Did not match schema to loaded profile", EcoreUtil.getRootContainer(schema), is((EObject)profile)); + assertThat("EPackage is an unknown schema", getExtendedMetadata().demandedPackages(), not(hasItem(schema))); + + IRepairAction action = zombies.getSuggestedRepairAction(schema); + assertThat("Wrong suggested repair action", action.kind(), is(IRepairAction.Kind.APPLY_LATEST_PROFILE_DEFINITION)); + + repair(schema, action); + assertStereotypeApplication(); + } + + /** + * Test case in which the profile application is missing, but the EPackage schema is successfully resolved by EMF, so + * we just have to link up with the profile definition and apply it (no need to parse unknown-schema AnyTypes). + */ + @Test + @PluginResource("/resources/missingProfileApplication/model.uml") + public void missingProfileApplication() { + assertThat("Should have found zombie stereotypes", zombies, notNullValue()); + + EPackage schema = getOnlyZombieSchema(); + assertThat("Did not match schema to loaded profile", EcoreUtil.getRootContainer(schema), is((EObject)profile)); + assertThat("EPackage is an unknown schema", getExtendedMetadata().demandedPackages(), not(hasItem(schema))); + + IRepairAction action = zombies.getSuggestedRepairAction(schema); + assertThat("Wrong suggested repair action", action.kind(), is(IRepairAction.Kind.APPLY_LATEST_PROFILE_DEFINITION)); + + repair(schema, action); + assertStereotypeApplication(); + } + + /** + * Test case in which the profile application and schema location are present but reference a non-existent resource. + * We just have to link up with the profile definition and apply it and parse unknown-schema AnyTypes to reconstruct stereotypes. + */ + @Test + @PluginResource("/resources/missingSchema/model.uml") + public void missingSchema() { + assertThat("Should have found zombie stereotypes", zombies, notNullValue()); + + EPackage schema = getOnlyZombieSchema(); + assertThat("EPackage is not an unknown schema", getExtendedMetadata().demandedPackages(), hasItem(schema)); + + IRepairAction action = zombies.getSuggestedRepairAction(schema); + assertThat("Wrong suggested repair action", action.kind(), is(IRepairAction.Kind.APPLY_LATEST_PROFILE_DEFINITION)); + + repair(schema, action); + assertStereotypeApplication(); + } + + /** + * Test case in which we choose to delete the stereotypes. + */ + @Test + @PluginResource("/resources/wrongProfileVersion/model.uml") + public void deleteStereotypes() { + assertThat("Should have found zombie stereotypes", zombies, notNullValue()); + + EPackage schema = getOnlyZombieSchema(); + + IRepairAction action = zombies.getRepairAction(schema, IRepairAction.Kind.DELETE); + assertThat("Wrong repair action", action.kind(), is(IRepairAction.Kind.DELETE)); + + repair(schema, action); + + assertThat("Stereotypes not deleted.", modelSet.getModelResource().getContents().size(), is(1)); + } + + // + // Test framework + // + + @Before + public void createFixture() throws Exception { + URI profileURI = URI.createPlatformPluginURI("org.eclipse.papyrus.uml.modelrepair.tests/resources/profile/myprofile.profile.uml", true); + profile = UML2Util.load(modelSet.getResourceSet(), profileURI, UMLPackage.Literals.PROFILE); + stereotype = profile.getOwnedStereotype("Stereo"); + class1 = (Class)modelSet.getModel().getOwnedType("Class1"); + + fixture = new StereotypeApplicationRepairSnippet(Suppliers.ofInstance(profile)); + fixture.start(modelSet.getResourceSet()); + zombies = fixture.getZombieStereotypes(modelSet.getModelResource(), modelSet.getModel()); + } + + @After + public void destroyFixture() { + class1 = null; + stereotype = null; + profile = null; + fixture.dispose(modelSet.getResourceSet()); + fixture = null; + } + + void repair(final EPackage schema, final IRepairAction action) { + try { + TransactionHelper.run(modelSet.getEditingDomain(), new Runnable() { + + @Override + public void run() { + zombies.repair(schema, action, null, null); + } + }); + } catch (Exception e) { + e.printStackTrace(); + fail("Failed to run repair action: " + e.getLocalizedMessage()); + } + } + + EPackage getOnlyZombieSchema() { + Collection<? extends EPackage> schemata = zombies.getZombiePackages(); + assertThat("Wrong number of zombie packages", schemata.size(), is(1)); + return schemata.iterator().next(); + } + + void assertStereotypeApplication() { + assertThat("Stereotype not applied to the class", class1.isStereotypeApplied(stereotype)); + EObject application = class1.getStereotypeApplication(stereotype); + EClass eclass = application.eClass(); + + // Verify an Enumeration value stored as an XML attribute + Object value = application.eGet(eclass.getEStructuralFeature("alertLevel")); + assertThat("Alert level is not yellow", (value instanceof Enumerator) && ((Enumerator)value).getLiteral().equals("yellow"), is(true)); + + // Verify a multi-valued attribute stored as XML elements + value = application.eGet(eclass.getEStructuralFeature("tag")); + assertThat("Wrong tags found", value, is((Object)Arrays.asList("p2", "silver"))); + + // Verify a reference value stored as an XML IDREFS attribute + value = application.eGet(eclass.getEStructuralFeature("appliesTo")); + assertThat("Wrong appliesTo found", value, is((Object)class1.getOwnedAttributes())); + + // Verify a contained EObject that is a complex DataType value + value = application.eGet(eclass.getEStructuralFeature("name")); + { + assertThat("Value is not an EList", value, instanceOf(EList.class)); + EList<?> list = (EList<?>)value; + + assertThat("List has wrong number of elements", list.size(), is(1)); + value = list.get(0); + + assertThat("Value is not an EObject", value, instanceOf(EObject.class)); + EObject name = (EObject)value; + EClass dataType = name.eClass(); + + assertThat("Wrong firstName", name.eGet(dataType.getEStructuralFeature("firstName")), is((Object)"Christian")); + assertThat("Wrong lastName", name.eGet(dataType.getEStructuralFeature("lastName")), is((Object)"Damus")); + assertThat("Wrong initials", name.eGet(dataType.getEStructuralFeature("initials")), is((Object)Arrays.asList("W"))); + } + } + + ExtendedMetaData getExtendedMetadata() { + ExtendedMetaData result = ExtendedMetaData.INSTANCE; + + Object option = ((XMLResource)modelSet.getModelResource()).getDefaultSaveOptions().get(XMLResource.OPTION_EXTENDED_META_DATA); + if(option instanceof ExtendedMetaData) { + result = (ExtendedMetaData)option; + } + + return result; + } +} diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/src/org/eclipse/papyrus/uml/modelrepair/tests/AllTests.java b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/src/org/eclipse/papyrus/uml/modelrepair/tests/AllTests.java new file mode 100644 index 00000000000..bdef8cd70be --- /dev/null +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/src/org/eclipse/papyrus/uml/modelrepair/tests/AllTests.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2014 CEA 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: + * Christian W. Damus (CEA) - Initial API and implementation + * + */ +package org.eclipse.papyrus.uml.modelrepair.tests; + +import org.eclipse.papyrus.uml.modelrepair.internal.stereotypes.StereotypeApplicationRepairSnippetTest; +import org.junit.runner.RunWith; +import org.junit.runners.Suite; +import org.junit.runners.Suite.SuiteClasses; + + +/** + * This is the AllTests type. Enjoy. + */ +@RunWith(Suite.class) +@SuiteClasses({ StereotypeApplicationRepairSnippetTest.class }) +public class AllTests { + + public AllTests() { + super(); + } + +} |