summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjcadavid2014-05-07 09:25:26 (EDT)
committerCamille Letavernier2014-05-13 13:24:43 (EDT)
commitbfb5e6c670e87cdf00d5448298b88b77e10991a1 (patch)
tree3e0eeba9bc5401500e22c4551338b293f3873f5e
parent353d778d43908f6a77d4a5e7943b880c71eb944e (diff)
downloadorg.eclipse.papyrus-bfb5e6c670e87cdf00d5448298b88b77e10991a1.zip
org.eclipse.papyrus-bfb5e6c670e87cdf00d5448298b88b77e10991a1.tar.gz
org.eclipse.papyrus-bfb5e6c670e87cdf00d5448298b88b77e10991a1.tar.bz2
Bug 399877: Papyrus control mode shall be tested refs/changes/42/25642/5
This plugin contains a test suite for the Papyrus control mode. Change-Id: Icbe07abe318f931b9a78d88d1f3d3d8fd876ecb2 Signed-off-by: jcadavid <juan.cadavid@cea.fr>
-rw-r--r--features/papyrus-tests-features/org.eclipse.papyrus.tests.infra.services.feature/feature.xml4
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/plugin.xml8
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/commands/ControlModeCommandParameterValues.java25
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/handlers/ControlCommandHandler.java63
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/ui/CreateModelFragmentDialog.java2
-rw-r--r--releng/org.eclipse.mdt.papyrus.releng.buckminster/papyrus-trunk-nightly-tests/build.rmap8
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF5
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java3
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/.classpath7
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/.gitignore1
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/.project28
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/ControlModeTests.launch43
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/META-INF/MANIFEST.MF23
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/OSGI-INF/l10n/bundle.properties3
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/about.html28
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/build.properties9
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModeWithProfileTest/ControlModeWithProfileTestModel.di2
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModeWithProfileTest/ControlModeWithProfileTestModel.notation31
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModeWithProfileTest/ControlModeWithProfileTestModel.uml16
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModeWithProfileTest/testProfile.profile.di2
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModeWithProfileTest/testProfile.profile.notation43
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModeWithProfileTest/testProfile.profile.uml31
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModelTest/ControlModeTestModel.di2
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModelTest/ControlModeTestModel.notation31
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModelTest/ControlModeTestModel.uml7
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/UncontrolModeWithProfileTestModel.di2
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/UncontrolModeWithProfileTestModel.notation31
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/UncontrolModeWithProfileTestModel.uml10
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/submodel.di8
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/submodel.notation2
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/submodel.uml14
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/testProfile.profile.di2
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/testProfile.profile.notation43
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/testProfile.profile.uml31
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModelTest/ReintegrateTestModel.di2
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModelTest/ReintegrateTestModel.notation40
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModelTest/ReintegrateTestModel.uml5
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModelTest/Subpackage.di8
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModelTest/Subpackage.notation2
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModelTest/Subpackage.uml4
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/AllTests.java28
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/Messages.java39
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/control/AbstractControlModeTest.java150
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/control/Activator.java66
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/control/ControlModelTest.java104
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/control/ControlModelWithProfileTest.java106
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/messages.properties7
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/uncontrol/AbstractUncontrolModelTest.java126
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/uncontrol/UncontrolModelTest.java61
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/uncontrol/UncontrolModelWithProfileTest.java69
52 files changed, 1384 insertions, 10 deletions
diff --git a/features/papyrus-tests-features/org.eclipse.papyrus.tests.infra.services.feature/feature.xml b/features/papyrus-tests-features/org.eclipse.papyrus.tests.infra.services.feature/feature.xml
index f008eb5..bf3aafe 100644
--- a/features/papyrus-tests-features/org.eclipse.papyrus.tests.infra.services.feature/feature.xml
+++ b/features/papyrus-tests-features/org.eclipse.papyrus.tests.infra.services.feature/feature.xml
@@ -19,4 +19,6 @@ http://www.eclipse.org/legal/epl-v10.html
<plugin download-size="0" fragment="true" id="org.eclipse.papyrus.infra.services.edit.tests" install-size="0" unpack="false" version="0.0.0"/>
-</feature> \ No newline at end of file
+ <plugin download-size="0" id="org.eclipse.papyrus.infra.services.controlmode.tests" install-size="0" version="0.0.0" unpack="false"/>
+
+</feature>
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/plugin.xml b/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/plugin.xml
index 3ba0cc7..9983162 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/plugin.xml
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/plugin.xml
@@ -9,6 +9,14 @@
description="Move this submodel into its own resource (file)"
id="org.eclipse.papyrus.infra.services.controlmode.createsubmodel"
name="Create submodel unit">
+ <commandParameter
+ id="org.eclipse.papyrus.infra.services.controlmode.useDialogParameter"
+ name="Show control mode dialog"
+ optional="true">
+ <values
+ class="org.eclipse.papyrus.infra.services.controlmode.commands.ControlModeCommandParameterValues">
+ </values>
+ </commandParameter>
</command>
<command
defaultHandler="org.eclipse.papyrus.infra.services.controlmode.handlers.UncontrolCommandHandler"
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/commands/ControlModeCommandParameterValues.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/commands/ControlModeCommandParameterValues.java
new file mode 100644
index 0000000..e2f22ef
--- /dev/null
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/commands/ControlModeCommandParameterValues.java
@@ -0,0 +1,25 @@
+package org.eclipse.papyrus.infra.services.controlmode.commands;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.commands.IParameterValues;
+
+
+
+public class ControlModeCommandParameterValues implements IParameterValues {
+
+ private HashMap<String, Boolean> parameterValues = new HashMap<String, Boolean>();
+
+ public Map<String, Boolean> getParameterValues() {
+ return parameterValues;
+ }
+
+ public Boolean get(Object key) {
+ return parameterValues.get(key);
+ }
+
+ public Boolean put(String key, Boolean value) {
+ return parameterValues.put(key, value);
+ }
+
+}
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/handlers/ControlCommandHandler.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/handlers/ControlCommandHandler.java
index 59e96bb..d0c3b71 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/handlers/ControlCommandHandler.java
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/handlers/ControlCommandHandler.java
@@ -11,6 +11,7 @@
* Arthur Daussy (Atos) arthur.daussy@atos.net - Initial API and implementation
* Christian W. Damus (CEA LIST) - pluggable providers of fragment-resource selection dialogs
* Christian W. Damus (CEA) - bug 410346
+ * Juan Cadavid <juan.cadavid@cea.fr> - bug 399877
*
*****************************************************************************/
package org.eclipse.papyrus.infra.services.controlmode.handlers;
@@ -18,10 +19,17 @@ package org.eclipse.papyrus.infra.services.controlmode.handlers;
import java.util.List;
import java.util.regex.Pattern;
+import org.eclipse.core.commands.AbstractParameterValueConverter;
+import org.eclipse.core.commands.Command;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.ParameterValueConversionException;
+import org.eclipse.core.commands.ParameterValuesException;
+import org.eclipse.core.commands.common.NotDefinedException;
+import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
@@ -33,6 +41,7 @@ import org.eclipse.papyrus.infra.services.controlmode.ControlModeManager;
import org.eclipse.papyrus.infra.services.controlmode.ControlModePlugin;
import org.eclipse.papyrus.infra.services.controlmode.ControlModeRequest;
import org.eclipse.papyrus.infra.services.controlmode.IControlModeManager;
+import org.eclipse.papyrus.infra.services.controlmode.commands.ControlModeCommandParameterValues;
import org.eclipse.papyrus.infra.services.controlmode.ui.IControlModeFragmentDialogProvider;
import org.eclipse.papyrus.infra.services.controlmode.util.LabelHelper;
import org.eclipse.papyrus.infra.widgets.toolbox.notification.builders.NotificationBuilder;
@@ -43,10 +52,11 @@ import org.eclipse.swt.widgets.Display;
* Handler used to control an element
*
* @author adaussy
- *
*/
public class ControlCommandHandler extends AbstractModelExplorerHandler {
+ public static final String CONTROLMODE_USE_DIALOG_PARAMETER = "org.eclipse.papyrus.infra.services.controlmode.useDialogParameter";
+
public Object execute(ExecutionEvent event) throws ExecutionException {
List<EObject> selection = getCurrentSelectionAdaptedToType(event, EObject.class);
if(selection == null || selection.isEmpty() || selection.size() > 1) {
@@ -54,17 +64,57 @@ public class ControlCommandHandler extends AbstractModelExplorerHandler {
return null;
}
EObject eObjectToControl = selection.get(0);
- IControlModeFragmentDialogProvider provider = getDialogProvider(eObjectToControl);
- Dialog dialog = provider.createDialog(Display.getCurrent().getActiveShell(), eObjectToControl.eResource(), getDefaultLabelResource(eObjectToControl));
- if(dialog.open() == Dialog.OK) {
- ControlModeRequest controlRequest = ControlModeRequest.createUIControlModelRequest(getEditingDomain(), eObjectToControl, provider.getSelectedURI(dialog));
+
+ if(getShowDialogParameterValue(event)) {
+ IControlModeFragmentDialogProvider provider = getDialogProvider(eObjectToControl);
+ Dialog dialog = provider.createDialog(Display.getCurrent().getActiveShell(), eObjectToControl.eResource(), getDefaultLabelResource(eObjectToControl));
+ if(dialog.open() == Dialog.OK) {
+ ControlModeRequest controlRequest = ControlModeRequest.createUIControlModelRequest(getEditingDomain(), eObjectToControl, provider.getSelectedURI(dialog));
+ IControlModeManager controlMng = ControlModeManager.getInstance();
+ ICommand controlCommand = controlMng.getControlCommand(controlRequest);
+ getEditingDomain().getCommandStack().execute(new GMFtoEMFCommandWrapper(controlCommand));
+ }
+ } else {
+ URI defaultURI = computeDefaultURI(eObjectToControl.eResource(), getDefaultLabelResource(eObjectToControl));
+ ControlModeRequest controlRequest = ControlModeRequest.createUIControlModelRequest(getEditingDomain(), eObjectToControl, defaultURI);
IControlModeManager controlMng = ControlModeManager.getInstance();
ICommand controlCommand = controlMng.getControlCommand(controlRequest);
getEditingDomain().getCommandStack().execute(new GMFtoEMFCommandWrapper(controlCommand));
}
return null;
}
-
+
+ public URI computeDefaultURI(Resource currentResource, String defaultName) {
+ String ext = currentResource.getURI().fileExtension();
+ URI uri = currentResource.getURI().trimSegments(1);
+ uri = uri.appendSegment(defaultName).appendFileExtension(ext);
+ return uri;
+ }
+
+ /**
+ *
+ * @param event
+ * @return true if the dialog will be displayed to the user, false if it will be bypassed and the default values will be used
+ */
+ protected Boolean getShowDialogParameterValue(ExecutionEvent event) {
+ Boolean showDialogValue = null;
+
+ ControlModeCommandParameterValues parameterValues = null;
+ try {
+ Command command = event.getCommand();
+ parameterValues = (ControlModeCommandParameterValues)command.getParameter(CONTROLMODE_USE_DIALOG_PARAMETER).getValues();
+ showDialogValue = parameterValues.get("showDialog");
+ if(showDialogValue == null) {
+ showDialogValue = true; //By default, the dialog is always displayed to the user
+ }
+ } catch (ParameterValuesException e) {
+ ControlModePlugin.log.error("Parameter values exception in control mode command.", e);
+ } catch (NotDefinedException e) {
+ ControlModePlugin.log.error("Parameter not defined for control mode command.", e);
+ }
+ return showDialogValue;
+ }
+
IControlModeFragmentDialogProvider getDialogProvider(EObject context) {
try {
ModelSet modelSet = ServiceUtilsForEObject.getInstance().getModelSet(context);
@@ -107,4 +157,5 @@ public class ControlCommandHandler extends AbstractModelExplorerHandler {
}
return b.toString();
}
+
}
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/ui/CreateModelFragmentDialog.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/ui/CreateModelFragmentDialog.java
index d620e3b..fe63d83 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/ui/CreateModelFragmentDialog.java
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/ui/CreateModelFragmentDialog.java
@@ -46,7 +46,7 @@ public class CreateModelFragmentDialog extends ResourceDialog {
this.defaultName = defaultName;
}
- private String computeDefaultURI() {
+ public String computeDefaultURI() {
String ext = currentResource.getURI().fileExtension();
URI uri = currentResource.getURI().trimSegments(1);
uri = uri.appendSegment(defaultName).appendFileExtension(ext);
diff --git a/releng/org.eclipse.mdt.papyrus.releng.buckminster/papyrus-trunk-nightly-tests/build.rmap b/releng/org.eclipse.mdt.papyrus.releng.buckminster/papyrus-trunk-nightly-tests/build.rmap
index 2a7f8cf..5d56e89 100644
--- a/releng/org.eclipse.mdt.papyrus.releng.buckminster/papyrus-trunk-nightly-tests/build.rmap
+++ b/releng/org.eclipse.mdt.papyrus.releng.buckminster/papyrus-trunk-nightly-tests/build.rmap
@@ -374,6 +374,14 @@
<bc:propertyRef key="eclipse.downloads"/>
</rm:uri>
</rm:provider>
+
+ <!-- SWTBot -->
+ <rm:provider componentTypes="eclipse.feature,osgi.bundle" mutable="false" readerType="p2" source="false">
+ <!-- updateFrom("Eclipse",0) -->
+ <rm:uri format="{0}/technology/swtbot/snapshots">
+ <bc:propertyRef key="eclipse.downloads"/>
+ </rm:uri>
+ </rm:provider>
<!-- FIXME !!!!! for EMF workspace which is not currently in Juno !!!!! -->
<rm:provider componentTypes="eclipse.feature,osgi.bundle" mutable="false" readerType="p2" source="false">
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 a4ae515..2758bab 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
@@ -47,8 +47,9 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="1.0.0",
org.eclipse.papyrus.infra.tools.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",
- org.eclipse.papyrus.diagram.profile.tests;bundle-version="1.0.0"
+ org.eclipse.papyrus.uml.modelrepair;bundle-version="1.0.0",
+ org.eclipse.papyrus.diagram.profile.tests;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.services.controlmode.tests;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 d6ac5ca..06d9da1 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
@@ -70,6 +70,9 @@ public class AllTests {
/* css */
suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.gmfdiag.css.tests.tests.AllTests.class));
+ /* control mode */
+ suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.services.controlmode.tests.AllTests.class));
+
//
/* sysml moved to a separate launcher */
//
diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/.classpath b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/.classpath
new file mode 100644
index 0000000..8a8f166
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.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/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/.gitignore b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/.gitignore
new file mode 100644
index 0000000..24405ef
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/.gitignore
@@ -0,0 +1 @@
+/screenshots
diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/.project b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/.project
new file mode 100644
index 0000000..5aa3666
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.infra.services.controlmode.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/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/.settings/org.eclipse.core.resources.prefs b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..c5bb773
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding//src/org/eclipse/papyrus/infra/services/controlmode/tests/messages.properties=ISO-8859-1
diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..f287d53
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.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/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/ControlModeTests.launch b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/ControlModeTests.launch
new file mode 100644
index 0000000..dfb43cb
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/ControlModeTests.launch
@@ -0,0 +1,43 @@
+<?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-controlmode-workspace"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/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.6"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.papyrus.infra.services.controlmode.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.infra.services.controlmode.tests"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dosgi.requiredJavaVersion=1.6 -Xms60m -Xmx1024m -DsuppressRawWhenUnchecked=true -XX:MaxPermSize=372M"/>
+<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"/>
+<stringAttribute key="templateConfig" value="${target_home}\configuration\config.ini"/>
+<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/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..b31fd07
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,23 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.eclipse.papyrus.infra.services.controlmode.tests
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.papyrus.infra.services.controlmode.tests.control.Activator
+Bundle-Vendor: %Bundle-Vendor
+Require-Bundle: org.eclipse.ui;bundle-version="3.106.0",
+ org.junit;bundle-version="4.11.0",
+ org.eclipse.papyrus.junit.utils;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.core.log;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.services.controlmode;bundle-version="1.0.0",
+ org.eclipse.emf.transaction;bundle-version="1.8.0",
+ org.eclipse.papyrus.infra.core;bundle-version="1.0.0",
+ org.eclipse.papyrus.views.modelexplorer;bundle-version="1.0.0",
+ org.eclipse.uml2.uml;bundle-version="5.0.0",
+ org.eclipse.swtbot.eclipse.finder;bundle-version="2.2.1",
+ org.eclipse.swtbot.junit4_x;bundle-version="2.2.1"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
+Export-Package: org.eclipse.papyrus.infra.services.controlmode.tests,
+ org.eclipse.papyrus.infra.services.controlmode.tests.control,
+ org.eclipse.papyrus.infra.services.controlmode.tests.uncontrol
diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/OSGI-INF/l10n/bundle.properties b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/OSGI-INF/l10n/bundle.properties
new file mode 100644
index 0000000..cbe3914
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,3 @@
+#Properties file for org.eclipse.papyrus.infra.services.controlmode.tests
+Bundle-Vendor = Eclipse Modeling Project
+Bundle-Name = Tests \ No newline at end of file
diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/about.html b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/about.html
new file mode 100644
index 0000000..82d49bf
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.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 (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). 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, &quot;Program&quot; 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 (&quot;Redistributor&quot;) 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/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/build.properties b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/build.properties
new file mode 100644
index 0000000..b154c91
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/build.properties
@@ -0,0 +1,9 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ model/,\
+ build.properties,\
+ about.html,\
+ OSGI-INF/
+src.includes = about.html
diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModeWithProfileTest/ControlModeWithProfileTestModel.di b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModeWithProfileTest/ControlModeWithProfileTestModel.di
new file mode 100644
index 0000000..8634d4c
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModeWithProfileTest/ControlModeWithProfileTestModel.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/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModeWithProfileTest/ControlModeWithProfileTestModel.notation b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModeWithProfileTest/ControlModeWithProfileTestModel.notation
new file mode 100644
index 0000000..029ca20
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModeWithProfileTest/ControlModeWithProfileTestModel.notation
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" 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="_VTrFwLpyEeOiIqA0Y8pjRA" type="PapyrusUMLClassDiagram" name="ClassDiagram" measurementUnit="Pixel">
+ <children xmi:type="notation:Shape" xmi:id="_zQoBsLpyEeOiIqA0Y8pjRA" type="2008">
+ <children xmi:type="notation:DecorationNode" xmi:id="_zQoowLpyEeOiIqA0Y8pjRA" type="5029"/>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_zQoowbpyEeOiIqA0Y8pjRA" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_zQoowrpyEeOiIqA0Y8pjRA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_zQoow7pyEeOiIqA0Y8pjRA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_zQooxLpyEeOiIqA0Y8pjRA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_zQooxbpyEeOiIqA0Y8pjRA"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_zQooxrpyEeOiIqA0Y8pjRA" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_zQoox7pyEeOiIqA0Y8pjRA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_zQooyLpyEeOiIqA0Y8pjRA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_zQooybpyEeOiIqA0Y8pjRA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_zQooyrpyEeOiIqA0Y8pjRA"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_zQooy7pyEeOiIqA0Y8pjRA" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_zQoozLpyEeOiIqA0Y8pjRA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_zQoozbpyEeOiIqA0Y8pjRA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_zQpP0LpyEeOiIqA0Y8pjRA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_zQpP0bpyEeOiIqA0Y8pjRA"/>
+ </children>
+ <element xmi:type="uml:Class" href="ControlModeWithProfileTestModel.uml#_zQQOQLpyEeOiIqA0Y8pjRA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_zQoBsbpyEeOiIqA0Y8pjRA" x="292" y="260"/>
+ </children>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_VTrFwbpyEeOiIqA0Y8pjRA"/>
+ <styles xmi:type="style:PapyrusViewStyle" xmi:id="_VTrFwrpyEeOiIqA0Y8pjRA">
+ <owner xmi:type="uml:Model" href="ControlModeWithProfileTestModel.uml#_zf8FgLpxEeOiIqA0Y8pjRA"/>
+ </styles>
+ <element xmi:type="uml:Model" href="ControlModeWithProfileTestModel.uml#_zf8FgLpxEeOiIqA0Y8pjRA"/>
+</notation:Diagram>
diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModeWithProfileTest/ControlModeWithProfileTestModel.uml b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModeWithProfileTest/ControlModeWithProfileTestModel.uml
new file mode 100644
index 0000000..19ece3b
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModeWithProfileTest/ControlModeWithProfileTestModel.uml
@@ -0,0 +1,16 @@
+<?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:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:profile="http:///schemas/profile/_Rtcl8LpyEeOiIqA0Y8pjRA/0" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xsi:schemaLocation="http:///schemas/profile/_Rtcl8LpyEeOiIqA0Y8pjRA/0 ../UncontrolModeWithProfileTest/testProfile.profile.uml#_RtfCMLpyEeOiIqA0Y8pjRA">
+ <uml:Model xmi:id="_zf8FgLpxEeOiIqA0Y8pjRA" name="model">
+ <packagedElement xmi:type="uml:Class" xmi:id="_W3JDoLpyEeOiIqA0Y8pjRA" name="Class"/>
+ <packagedElement xmi:type="uml:Package" xmi:id="_BRaDULsMEeO75-I_oucZEA" name="submodel">
+ <packagedElement xmi:type="uml:Class" xmi:id="_zQQOQLpyEeOiIqA0Y8pjRA" name="Class1"/>
+ </packagedElement>
+ <profileApplication xmi:type="uml:ProfileApplication" xmi:id="_uf2E8LsPEeOBNLJQ9YB1Vw">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_uf8yoLsPEeOBNLJQ9YB1Vw" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <references xmi:type="ecore:EPackage" href="testProfile.profile.uml#_RtfCMLpyEeOiIqA0Y8pjRA"/>
+ </eAnnotations>
+ <appliedProfile xmi:type="uml:Profile" href="testProfile.profile.uml#_JOBikLpyEeOiIqA0Y8pjRA"/>
+ </profileApplication>
+ </uml:Model>
+ <profile:Stereotype1 xmi:id="_wD21YLsPEeOBNLJQ9YB1Vw" base_Class="_zQQOQLpyEeOiIqA0Y8pjRA"/>
+</xmi:XMI>
diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModeWithProfileTest/testProfile.profile.di b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModeWithProfileTest/testProfile.profile.di
new file mode 100644
index 0000000..8634d4c
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModeWithProfileTest/testProfile.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/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModeWithProfileTest/testProfile.profile.notation b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModeWithProfileTest/testProfile.profile.notation
new file mode 100644
index 0000000..94dd5e3
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModeWithProfileTest/testProfile.profile.notation
@@ -0,0 +1,43 @@
+<?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="_JOdAYLpyEeOiIqA0Y8pjRA" type="PapyrusUMLProfileDiagram" name="NewDiagram" measurementUnit="Pixel">
+ <children xmi:type="notation:Shape" xmi:id="_MTfesLpyEeOiIqA0Y8pjRA" type="1026">
+ <children xmi:type="notation:DecorationNode" xmi:id="_MTgFwLpyEeOiIqA0Y8pjRA" type="1034"/>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_MTgs0LpyEeOiIqA0Y8pjRA" type="1071">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_MTgs0bpyEeOiIqA0Y8pjRA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_MTgs0rpyEeOiIqA0Y8pjRA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_MTgs07pyEeOiIqA0Y8pjRA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_MTgs1LpyEeOiIqA0Y8pjRA"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_MTgs1bpyEeOiIqA0Y8pjRA" type="1019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_MTgs1rpyEeOiIqA0Y8pjRA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_MTgs17pyEeOiIqA0Y8pjRA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_MTgs2LpyEeOiIqA0Y8pjRA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_MTgs2bpyEeOiIqA0Y8pjRA"/>
+ </children>
+ <element xmi:type="uml:Stereotype" href="testProfile.profile.uml#_MTPnELpyEeOiIqA0Y8pjRA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_MTfesbpyEeOiIqA0Y8pjRA" x="327" y="185"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_P1ovwLpyEeOiIqA0Y8pjRA" type="1031">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_P1qk8LpyEeOiIqA0Y8pjRA" source="Stereotype_Annotation">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_P1rMALpyEeOiIqA0Y8pjRA" key="StereotypeWithQualifiedNameList" value=""/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_P1rMAbpyEeOiIqA0Y8pjRA" key="StereotypeList" value="StandardProfile::Metaclass"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_P1rMArpyEeOiIqA0Y8pjRA" key="Stereotype_Presentation_Kind" value="HorizontalStereo"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_P1rzELpyEeOiIqA0Y8pjRA" key="PropStereoDisplay" value=""/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_P1rzEbpyEeOiIqA0Y8pjRA" key="StereotypePropertyLocation" value="Compartment"/>
+ </eAnnotations>
+ <children xmi:type="notation:DecorationNode" xmi:id="_P1pW0LpyEeOiIqA0Y8pjRA" type="1084"/>
+ <element xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_P1pW0bpyEeOiIqA0Y8pjRA" x="703" y="240"/>
+ </children>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_JOdAYbpyEeOiIqA0Y8pjRA"/>
+ <styles xmi:type="style:PapyrusViewStyle" xmi:id="_JOdAYrpyEeOiIqA0Y8pjRA">
+ <owner xmi:type="uml:Profile" href="testProfile.profile.uml#_JOBikLpyEeOiIqA0Y8pjRA"/>
+ </styles>
+ <element xmi:type="uml:Profile" href="testProfile.profile.uml#_JOBikLpyEeOiIqA0Y8pjRA"/>
+ <edges xmi:type="notation:Connector" xmi:id="_Qo5_wLpyEeOiIqA0Y8pjRA" type="1013" source="_MTfesLpyEeOiIqA0Y8pjRA" target="_P1ovwLpyEeOiIqA0Y8pjRA">
+ <styles xmi:type="notation:FontStyle" xmi:id="_Qo5_wbpyEeOiIqA0Y8pjRA"/>
+ <element xmi:type="uml:Extension" href="testProfile.profile.uml#_QoqIILpyEeOiIqA0Y8pjRA"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Qo5_wrpyEeOiIqA0Y8pjRA" points="[50, 4, -295, -24]$[326, 26, -19, -2]"/>
+ <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Qpa9ILpyEeOiIqA0Y8pjRA" id="(0.19,0.46)"/>
+ </edges>
+</notation:Diagram>
diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModeWithProfileTest/testProfile.profile.uml b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModeWithProfileTest/testProfile.profile.uml
new file mode 100644
index 0000000..6a1d15da
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModeWithProfileTest/testProfile.profile.uml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Profile xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_JOBikLpyEeOiIqA0Y8pjRA" name="profile" metaclassReference="_P1j3QLpyEeOiIqA0Y8pjRA">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_RtebILpyEeOiIqA0Y8pjRA" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <contents xmi:type="ecore:EPackage" xmi:id="_RtfCMLpyEeOiIqA0Y8pjRA" name="profile" nsURI="http:///schemas/profile/_Rtcl8LpyEeOiIqA0Y8pjRA/0" nsPrefix="profile">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_RtiFgLpyEeOiIqA0Y8pjRA" source="PapyrusVersion">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_RtiFgbpyEeOiIqA0Y8pjRA" key="Version" value="0.0.1"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_RtiFgrpyEeOiIqA0Y8pjRA" key="Comment" value=""/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_RtiFg7pyEeOiIqA0Y8pjRA" key="Copyright" value=""/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_RtiFhLpyEeOiIqA0Y8pjRA" key="Date" value="2014-04-02"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_RtiFhbpyEeOiIqA0Y8pjRA" key="Author" value=""/>
+ </eAnnotations>
+ <eClassifiers xmi:type="ecore:EClass" xmi:id="_RtfCMbpyEeOiIqA0Y8pjRA" name="Stereotype1">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_RtfCMrpyEeOiIqA0Y8pjRA" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_MTPnELpyEeOiIqA0Y8pjRA"/>
+ <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_RtfCM7pyEeOiIqA0Y8pjRA" name="base_Class" ordered="false" lowerBound="1">
+ <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/>
+ </eStructuralFeatures>
+ </eClassifiers>
+ </contents>
+ </eAnnotations>
+ <elementImport xmi:type="uml:ElementImport" xmi:id="_P1j3QLpyEeOiIqA0Y8pjRA" alias="Class">
+ <importedElement xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/>
+ </elementImport>
+ <packagedElement xmi:type="uml:Stereotype" xmi:id="_MTPnELpyEeOiIqA0Y8pjRA" name="Stereotype1">
+ <ownedAttribute xmi:type="uml:Property" xmi:id="_Qoo6ALpyEeOiIqA0Y8pjRA" name="base_Class" association="_QoqIILpyEeOiIqA0Y8pjRA">
+ <type xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/>
+ </ownedAttribute>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Extension" xmi:id="_QoqIILpyEeOiIqA0Y8pjRA" name="E_Stereotype1_Class1" memberEnd="_QoqIIbpyEeOiIqA0Y8pjRA _Qoo6ALpyEeOiIqA0Y8pjRA">
+ <ownedEnd xmi:type="uml:ExtensionEnd" xmi:id="_QoqIIbpyEeOiIqA0Y8pjRA" name="extension_Stereotype1" type="_MTPnELpyEeOiIqA0Y8pjRA" aggregation="composite" association="_QoqIILpyEeOiIqA0Y8pjRA"/>
+ </packagedElement>
+</uml:Profile>
diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModelTest/ControlModeTestModel.di b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModelTest/ControlModeTestModel.di
new file mode 100644
index 0000000..8634d4c
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModelTest/ControlModeTestModel.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/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModelTest/ControlModeTestModel.notation b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModelTest/ControlModeTestModel.notation
new file mode 100644
index 0000000..adb7e73
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModelTest/ControlModeTestModel.notation
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" 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="_TQU0cLaBEeOpyp3GKGu8Hw" type="PapyrusUMLClassDiagram" name="ClassDiagram" measurementUnit="Pixel">
+ <children xmi:type="notation:Shape" xmi:id="_UVYYALaBEeOpyp3GKGu8Hw" type="2008">
+ <children xmi:type="notation:DecorationNode" xmi:id="_UVfFsLaBEeOpyp3GKGu8Hw" type="5029"/>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_UVlzYLaBEeOpyp3GKGu8Hw" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_UVlzYbaBEeOpyp3GKGu8Hw"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_UVlzYraBEeOpyp3GKGu8Hw"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_UVlzY7aBEeOpyp3GKGu8Hw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_UVlzZLaBEeOpyp3GKGu8Hw"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_UVlzZbaBEeOpyp3GKGu8Hw" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_UVlzZraBEeOpyp3GKGu8Hw"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_UVlzZ7aBEeOpyp3GKGu8Hw"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_UVlzaLaBEeOpyp3GKGu8Hw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_UVlzabaBEeOpyp3GKGu8Hw"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_UVlzaraBEeOpyp3GKGu8Hw" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_UVlza7aBEeOpyp3GKGu8Hw"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_UVlzbLaBEeOpyp3GKGu8Hw"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_UVlzbbaBEeOpyp3GKGu8Hw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_UVlzbraBEeOpyp3GKGu8Hw"/>
+ </children>
+ <element xmi:type="uml:Class" href="ControlModeTestModel.uml#_iORqgLUNEeOpyp3GKGu8Hw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_UVYYAbaBEeOpyp3GKGu8Hw" x="420" y="179"/>
+ </children>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_TQU0cbaBEeOpyp3GKGu8Hw"/>
+ <styles xmi:type="style:PapyrusViewStyle" xmi:id="_TQU0craBEeOpyp3GKGu8Hw">
+ <owner xmi:type="uml:Model" href="ControlModeTestModel.uml#_LOdvgLNPEeOZR-JQ361_AA"/>
+ </styles>
+ <element xmi:type="uml:Model" href="ControlModeTestModel.uml#_LOdvgLNPEeOZR-JQ361_AA"/>
+</notation:Diagram>
diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModelTest/ControlModeTestModel.uml b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModelTest/ControlModeTestModel.uml
new file mode 100644
index 0000000..f37825c
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/ControlModelTest/ControlModeTestModel.uml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Model xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_LOdvgLNPEeOZR-JQ361_AA" name="model">
+ <packagedElement xmi:type="uml:Package" xmi:id="_OE-poLNPEeOZR-JQ361_AA" name="Package">
+ <packagedElement xmi:type="uml:Class" xmi:id="_hZTxYLUNEeOpyp3GKGu8Hw" name="Class"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Class" xmi:id="_iORqgLUNEeOpyp3GKGu8Hw" name="Class"/>
+</uml:Model>
diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/UncontrolModeWithProfileTestModel.di b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/UncontrolModeWithProfileTestModel.di
new file mode 100644
index 0000000..8634d4c
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/UncontrolModeWithProfileTestModel.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/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/UncontrolModeWithProfileTestModel.notation b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/UncontrolModeWithProfileTestModel.notation
new file mode 100644
index 0000000..9670f0f
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/UncontrolModeWithProfileTestModel.notation
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" 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="_VTrFwLpyEeOiIqA0Y8pjRA" type="PapyrusUMLClassDiagram" name="ClassDiagram" measurementUnit="Pixel">
+ <children xmi:type="notation:Shape" xmi:id="_zQoBsLpyEeOiIqA0Y8pjRA" type="2008">
+ <children xmi:type="notation:DecorationNode" xmi:id="_zQoowLpyEeOiIqA0Y8pjRA" type="5029"/>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_zQoowbpyEeOiIqA0Y8pjRA" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_zQoowrpyEeOiIqA0Y8pjRA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_zQoow7pyEeOiIqA0Y8pjRA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_zQooxLpyEeOiIqA0Y8pjRA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_zQooxbpyEeOiIqA0Y8pjRA"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_zQooxrpyEeOiIqA0Y8pjRA" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_zQoox7pyEeOiIqA0Y8pjRA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_zQooyLpyEeOiIqA0Y8pjRA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_zQooybpyEeOiIqA0Y8pjRA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_zQooyrpyEeOiIqA0Y8pjRA"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_zQooy7pyEeOiIqA0Y8pjRA" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_zQoozLpyEeOiIqA0Y8pjRA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_zQoozbpyEeOiIqA0Y8pjRA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_zQpP0LpyEeOiIqA0Y8pjRA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_zQpP0bpyEeOiIqA0Y8pjRA"/>
+ </children>
+ <element xmi:type="uml:Class" href="submodel.uml#_zQQOQLpyEeOiIqA0Y8pjRA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_zQoBsbpyEeOiIqA0Y8pjRA" x="292" y="260"/>
+ </children>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_VTrFwbpyEeOiIqA0Y8pjRA"/>
+ <styles xmi:type="style:PapyrusViewStyle" xmi:id="_VTrFwrpyEeOiIqA0Y8pjRA">
+ <owner xmi:type="uml:Model" href="UncontrolModeWithProfileTestModel.uml#_zf8FgLpxEeOiIqA0Y8pjRA"/>
+ </styles>
+ <element xmi:type="uml:Model" href="UncontrolModeWithProfileTestModel.uml#_zf8FgLpxEeOiIqA0Y8pjRA"/>
+</notation:Diagram>
diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/UncontrolModeWithProfileTestModel.uml b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/UncontrolModeWithProfileTestModel.uml
new file mode 100644
index 0000000..f4032dc
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/UncontrolModeWithProfileTestModel.uml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Model xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_zf8FgLpxEeOiIqA0Y8pjRA" name="model">
+ <packagedElement xmi:type="uml:Package" href="submodel.uml#_BRaDULsMEeO75-I_oucZEA"/>
+ <profileApplication xmi:type="uml:ProfileApplication" xmi:id="_uf2E8LsPEeOBNLJQ9YB1Vw">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_uf8yoLsPEeOBNLJQ9YB1Vw" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <references xmi:type="ecore:EPackage" href="testProfile.profile.uml#_RtfCMLpyEeOiIqA0Y8pjRA"/>
+ </eAnnotations>
+ <appliedProfile xmi:type="uml:Profile" href="testProfile.profile.uml#_JOBikLpyEeOiIqA0Y8pjRA"/>
+ </profileApplication>
+</uml:Model>
diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/submodel.di b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/submodel.di
new file mode 100644
index 0000000..9c61b75
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/submodel.di
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<di:SashWindowsMngr xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.eclipse.org/papyrus/0.7.0/sashdi">
+ <sashModel currentSelection="//@sashModel/@windows.0/@children.0">
+ <windows>
+ <children xsi:type="di:TabFolder"/>
+ </windows>
+ </sashModel>
+</di:SashWindowsMngr>
diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/submodel.notation b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/submodel.notation
new file mode 100644
index 0000000..8634d4c
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/submodel.notation
@@ -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/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/submodel.uml b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/submodel.uml
new file mode 100644
index 0000000..dee5169
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/submodel.uml
@@ -0,0 +1,14 @@
+<?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:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:profile="http:///schemas/profile/_Rtcl8LpyEeOiIqA0Y8pjRA/0" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xsi:schemaLocation="http:///schemas/profile/_Rtcl8LpyEeOiIqA0Y8pjRA/0 testProfile.profile.uml#_RtfCMLpyEeOiIqA0Y8pjRA">
+ <uml:Package xmi:id="_BRaDULsMEeO75-I_oucZEA" name="submodel">
+ <packagedElement xmi:type="uml:Class" xmi:id="_zQQOQLpyEeOiIqA0Y8pjRA" name="Class1"/>
+ <profileApplication xmi:type="uml:ProfileApplication" xmi:id="_wnZkULswEeOBNLJQ9YB1Vw">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_wnZkUbswEeOBNLJQ9YB1Vw" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <references xmi:type="ecore:EPackage" href="testProfile.profile.uml#_RtfCMLpyEeOiIqA0Y8pjRA"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_wnhgILswEeOBNLJQ9YB1Vw" source="duplicatedProfile"/>
+ <appliedProfile xmi:type="uml:Profile" href="testProfile.profile.uml#_JOBikLpyEeOiIqA0Y8pjRA"/>
+ </profileApplication>
+ </uml:Package>
+ <profile:Stereotype1 xmi:id="_wD21YLsPEeOBNLJQ9YB1Vw" base_Class="_zQQOQLpyEeOiIqA0Y8pjRA"/>
+</xmi:XMI>
diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/testProfile.profile.di b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/testProfile.profile.di
new file mode 100644
index 0000000..8634d4c
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/testProfile.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/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/testProfile.profile.notation b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/testProfile.profile.notation
new file mode 100644
index 0000000..94dd5e3
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/testProfile.profile.notation
@@ -0,0 +1,43 @@
+<?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="_JOdAYLpyEeOiIqA0Y8pjRA" type="PapyrusUMLProfileDiagram" name="NewDiagram" measurementUnit="Pixel">
+ <children xmi:type="notation:Shape" xmi:id="_MTfesLpyEeOiIqA0Y8pjRA" type="1026">
+ <children xmi:type="notation:DecorationNode" xmi:id="_MTgFwLpyEeOiIqA0Y8pjRA" type="1034"/>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_MTgs0LpyEeOiIqA0Y8pjRA" type="1071">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_MTgs0bpyEeOiIqA0Y8pjRA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_MTgs0rpyEeOiIqA0Y8pjRA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_MTgs07pyEeOiIqA0Y8pjRA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_MTgs1LpyEeOiIqA0Y8pjRA"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_MTgs1bpyEeOiIqA0Y8pjRA" type="1019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_MTgs1rpyEeOiIqA0Y8pjRA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_MTgs17pyEeOiIqA0Y8pjRA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_MTgs2LpyEeOiIqA0Y8pjRA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_MTgs2bpyEeOiIqA0Y8pjRA"/>
+ </children>
+ <element xmi:type="uml:Stereotype" href="testProfile.profile.uml#_MTPnELpyEeOiIqA0Y8pjRA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_MTfesbpyEeOiIqA0Y8pjRA" x="327" y="185"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_P1ovwLpyEeOiIqA0Y8pjRA" type="1031">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_P1qk8LpyEeOiIqA0Y8pjRA" source="Stereotype_Annotation">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_P1rMALpyEeOiIqA0Y8pjRA" key="StereotypeWithQualifiedNameList" value=""/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_P1rMAbpyEeOiIqA0Y8pjRA" key="StereotypeList" value="StandardProfile::Metaclass"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_P1rMArpyEeOiIqA0Y8pjRA" key="Stereotype_Presentation_Kind" value="HorizontalStereo"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_P1rzELpyEeOiIqA0Y8pjRA" key="PropStereoDisplay" value=""/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_P1rzEbpyEeOiIqA0Y8pjRA" key="StereotypePropertyLocation" value="Compartment"/>
+ </eAnnotations>
+ <children xmi:type="notation:DecorationNode" xmi:id="_P1pW0LpyEeOiIqA0Y8pjRA" type="1084"/>
+ <element xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_P1pW0bpyEeOiIqA0Y8pjRA" x="703" y="240"/>
+ </children>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_JOdAYbpyEeOiIqA0Y8pjRA"/>
+ <styles xmi:type="style:PapyrusViewStyle" xmi:id="_JOdAYrpyEeOiIqA0Y8pjRA">
+ <owner xmi:type="uml:Profile" href="testProfile.profile.uml#_JOBikLpyEeOiIqA0Y8pjRA"/>
+ </styles>
+ <element xmi:type="uml:Profile" href="testProfile.profile.uml#_JOBikLpyEeOiIqA0Y8pjRA"/>
+ <edges xmi:type="notation:Connector" xmi:id="_Qo5_wLpyEeOiIqA0Y8pjRA" type="1013" source="_MTfesLpyEeOiIqA0Y8pjRA" target="_P1ovwLpyEeOiIqA0Y8pjRA">
+ <styles xmi:type="notation:FontStyle" xmi:id="_Qo5_wbpyEeOiIqA0Y8pjRA"/>
+ <element xmi:type="uml:Extension" href="testProfile.profile.uml#_QoqIILpyEeOiIqA0Y8pjRA"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Qo5_wrpyEeOiIqA0Y8pjRA" points="[50, 4, -295, -24]$[326, 26, -19, -2]"/>
+ <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Qpa9ILpyEeOiIqA0Y8pjRA" id="(0.19,0.46)"/>
+ </edges>
+</notation:Diagram>
diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/testProfile.profile.uml b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/testProfile.profile.uml
new file mode 100644
index 0000000..6a1d15da
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModeWithProfileTest/testProfile.profile.uml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Profile xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_JOBikLpyEeOiIqA0Y8pjRA" name="profile" metaclassReference="_P1j3QLpyEeOiIqA0Y8pjRA">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_RtebILpyEeOiIqA0Y8pjRA" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <contents xmi:type="ecore:EPackage" xmi:id="_RtfCMLpyEeOiIqA0Y8pjRA" name="profile" nsURI="http:///schemas/profile/_Rtcl8LpyEeOiIqA0Y8pjRA/0" nsPrefix="profile">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_RtiFgLpyEeOiIqA0Y8pjRA" source="PapyrusVersion">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_RtiFgbpyEeOiIqA0Y8pjRA" key="Version" value="0.0.1"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_RtiFgrpyEeOiIqA0Y8pjRA" key="Comment" value=""/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_RtiFg7pyEeOiIqA0Y8pjRA" key="Copyright" value=""/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_RtiFhLpyEeOiIqA0Y8pjRA" key="Date" value="2014-04-02"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_RtiFhbpyEeOiIqA0Y8pjRA" key="Author" value=""/>
+ </eAnnotations>
+ <eClassifiers xmi:type="ecore:EClass" xmi:id="_RtfCMbpyEeOiIqA0Y8pjRA" name="Stereotype1">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_RtfCMrpyEeOiIqA0Y8pjRA" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_MTPnELpyEeOiIqA0Y8pjRA"/>
+ <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_RtfCM7pyEeOiIqA0Y8pjRA" name="base_Class" ordered="false" lowerBound="1">
+ <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/>
+ </eStructuralFeatures>
+ </eClassifiers>
+ </contents>
+ </eAnnotations>
+ <elementImport xmi:type="uml:ElementImport" xmi:id="_P1j3QLpyEeOiIqA0Y8pjRA" alias="Class">
+ <importedElement xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/>
+ </elementImport>
+ <packagedElement xmi:type="uml:Stereotype" xmi:id="_MTPnELpyEeOiIqA0Y8pjRA" name="Stereotype1">
+ <ownedAttribute xmi:type="uml:Property" xmi:id="_Qoo6ALpyEeOiIqA0Y8pjRA" name="base_Class" association="_QoqIILpyEeOiIqA0Y8pjRA">
+ <type xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/>
+ </ownedAttribute>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Extension" xmi:id="_QoqIILpyEeOiIqA0Y8pjRA" name="E_Stereotype1_Class1" memberEnd="_QoqIIbpyEeOiIqA0Y8pjRA _Qoo6ALpyEeOiIqA0Y8pjRA">
+ <ownedEnd xmi:type="uml:ExtensionEnd" xmi:id="_QoqIIbpyEeOiIqA0Y8pjRA" name="extension_Stereotype1" type="_MTPnELpyEeOiIqA0Y8pjRA" aggregation="composite" association="_QoqIILpyEeOiIqA0Y8pjRA"/>
+ </packagedElement>
+</uml:Profile>
diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModelTest/ReintegrateTestModel.di b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModelTest/ReintegrateTestModel.di
new file mode 100644
index 0000000..8634d4c
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModelTest/ReintegrateTestModel.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/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModelTest/ReintegrateTestModel.notation b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModelTest/ReintegrateTestModel.notation
new file mode 100644
index 0000000..f1aea4b
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModelTest/ReintegrateTestModel.notation
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" 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">
+ <notation:Diagram xmi:id="_dbCnALT3EeOlI9v8xMQjlA" type="PapyrusUMLClassDiagram" name="NewDiagram" measurementUnit="Pixel">
+ <children xmi:type="notation:Shape" xmi:id="_JjMfcLaPEeOoHZCEMkR4pQ" type="2008">
+ <children xmi:type="notation:DecorationNode" xmi:id="_JjR_ALaPEeOoHZCEMkR4pQ" type="5029"/>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_JjVpYLaPEeOoHZCEMkR4pQ" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_JjVpYbaPEeOoHZCEMkR4pQ"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_JjVpYraPEeOoHZCEMkR4pQ"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_JjVpY7aPEeOoHZCEMkR4pQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_JjVpZLaPEeOoHZCEMkR4pQ"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_JjWQcLaPEeOoHZCEMkR4pQ" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_JjWQcbaPEeOoHZCEMkR4pQ"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_JjWQcraPEeOoHZCEMkR4pQ"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_JjWQc7aPEeOoHZCEMkR4pQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_JjWQdLaPEeOoHZCEMkR4pQ"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_JjWQdbaPEeOoHZCEMkR4pQ" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_JjWQdraPEeOoHZCEMkR4pQ"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_JjWQd7aPEeOoHZCEMkR4pQ"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_JjWQeLaPEeOoHZCEMkR4pQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_JjWQebaPEeOoHZCEMkR4pQ"/>
+ </children>
+ <element xmi:type="uml:Class" href="ReintegrateTestModel.uml#_JhXTcLaPEeOoHZCEMkR4pQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_JjNGgLaPEeOoHZCEMkR4pQ" x="984" y="206"/>
+ </children>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_dbCnAbT3EeOlI9v8xMQjlA"/>
+ <styles xmi:type="style:PapyrusViewStyle" xmi:id="_dbCnArT3EeOlI9v8xMQjlA">
+ <owner xmi:type="uml:Model" href="ReintegrateTestModel.uml#_dZLl0LT3EeOlI9v8xMQjlA"/>
+ </styles>
+ <element xmi:type="uml:Model" href="ReintegrateTestModel.uml#_dZLl0LT3EeOlI9v8xMQjlA"/>
+ </notation:Diagram>
+ <notation:Diagram xmi:id="_Lnst0LaPEeOoHZCEMkR4pQ" type="PapyrusUMLClassDiagram" name="ClassDiagram" measurementUnit="Pixel">
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_Lnst0baPEeOoHZCEMkR4pQ"/>
+ <styles xmi:type="style:PapyrusViewStyle" xmi:id="_Lnst0raPEeOoHZCEMkR4pQ">
+ <owner xmi:type="uml:Package" href="Subpackage.uml#_sMwu4LT3EeOlI9v8xMQjlA"/>
+ </styles>
+ <element xmi:type="uml:Package" href="Subpackage.uml#_sMwu4LT3EeOlI9v8xMQjlA"/>
+ </notation:Diagram>
+</xmi:XMI>
diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModelTest/ReintegrateTestModel.uml b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModelTest/ReintegrateTestModel.uml
new file mode 100644
index 0000000..70df566
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModelTest/ReintegrateTestModel.uml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Model xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_dZLl0LT3EeOlI9v8xMQjlA" name="model">
+ <packagedElement xmi:type="uml:Package" href="Subpackage.uml#_sMwu4LT3EeOlI9v8xMQjlA"/>
+ <packagedElement xmi:type="uml:Class" xmi:id="_JhXTcLaPEeOoHZCEMkR4pQ" name="Class1"/>
+</uml:Model>
diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModelTest/Subpackage.di b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModelTest/Subpackage.di
new file mode 100644
index 0000000..9c61b75
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModelTest/Subpackage.di
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<di:SashWindowsMngr xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.eclipse.org/papyrus/0.7.0/sashdi">
+ <sashModel currentSelection="//@sashModel/@windows.0/@children.0">
+ <windows>
+ <children xsi:type="di:TabFolder"/>
+ </windows>
+ </sashModel>
+</di:SashWindowsMngr>
diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModelTest/Subpackage.notation b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModelTest/Subpackage.notation
new file mode 100644
index 0000000..8634d4c
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModelTest/Subpackage.notation
@@ -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/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModelTest/Subpackage.uml b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModelTest/Subpackage.uml
new file mode 100644
index 0000000..62a9b96
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/model/UncontrolModelTest/Subpackage.uml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Package xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_sMwu4LT3EeOlI9v8xMQjlA" name="Subpackage">
+ <packagedElement xmi:type="uml:Class" xmi:id="_upzZELT3EeOlI9v8xMQjlA" name="Class"/>
+</uml:Package>
diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/AllTests.java b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/AllTests.java
new file mode 100644
index 0000000..0d0cf4c
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/AllTests.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ * 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:
+ * Juan Cadavid <juan.cadavid@cea.fr> implementation
+ ******************************************************************************/
+package org.eclipse.papyrus.infra.services.controlmode.tests;
+
+import org.eclipse.papyrus.infra.services.controlmode.tests.control.ControlModelTest;
+import org.eclipse.papyrus.infra.services.controlmode.tests.control.ControlModelWithProfileTest;
+import org.eclipse.papyrus.infra.services.controlmode.tests.uncontrol.UncontrolModelTest;
+import org.eclipse.papyrus.infra.services.controlmode.tests.uncontrol.UncontrolModelWithProfileTest;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+@RunWith(Suite.class)
+@SuiteClasses({ ControlModelWithProfileTest.class,
+ UncontrolModelTest.class,
+ ControlModelTest.class,
+ UncontrolModelWithProfileTest.class })
+public class AllTests {
+
+}
diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/Messages.java b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/Messages.java
new file mode 100644
index 0000000..f4c7f6d
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/Messages.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ * 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:
+ * Juan Cadavid <juan.cadavid@cea.fr> implementation
+ ******************************************************************************/
+package org.eclipse.papyrus.infra.services.controlmode.tests;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+
+ private static final String BUNDLE_NAME = "org.eclipse.papyrus.infra.services.controlmode.tests.messages"; //$NON-NLS-1$
+
+ public static String AbstractControlModeTest_1;
+
+ public static String AbstractUncontrolModelTest_1;
+
+ public static String ControlModelTest_4;
+
+ public static String ControlModelWithProfileTest_4;
+
+ public static String ExistingResourceControlModeTest_5;
+
+ public static String UncontrolModelTest_4;
+
+ public static String UncontrolModelWithProfileTest_5;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/control/AbstractControlModeTest.java b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/control/AbstractControlModeTest.java
new file mode 100644
index 0000000..ff6d1de
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/control/AbstractControlModeTest.java
@@ -0,0 +1,150 @@
+/*******************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ * 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:
+ * Juan Cadavid <juan.cadavid@cea.fr> implementation
+ ******************************************************************************/
+package org.eclipse.papyrus.infra.services.controlmode.tests.control;
+
+import static org.junit.Assert.fail;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.commands.Command;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
+import org.eclipse.papyrus.infra.core.lifecycleevents.ISaveAndDirtyService;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.services.controlmode.tests.Messages;
+import org.eclipse.papyrus.infra.services.controlmode.util.ControlHelper;
+import org.eclipse.papyrus.junit.utils.EditorUtils;
+import org.eclipse.papyrus.junit.utils.GenericUtils;
+import org.eclipse.papyrus.junit.utils.HandlerUtils;
+import org.eclipse.papyrus.junit.utils.ModelExplorerUtils;
+import org.eclipse.papyrus.junit.utils.ProjectUtils;
+import org.eclipse.papyrus.junit.utils.tests.AbstractPapyrusTest;
+import org.eclipse.papyrus.views.modelexplorer.ModelExplorerView;
+import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.uml2.uml.Model;
+import org.eclipse.uml2.uml.PackageableElement;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.osgi.framework.Bundle;
+
+public abstract class AbstractControlModeTest extends AbstractPapyrusTest {
+
+ protected static final String COMMAND_ID = "org.eclipse.papyrus.infra.services.controlmode.createsubmodel"; //$NON-NLS-1$
+
+ protected static IMultiDiagramEditor papyrusEditor;
+
+ protected IMultiDiagramEditor editor = null;
+
+ protected Model model;
+
+ @Before
+ public void setUp() {
+ try {
+ initTests(Activator.getDefault().getBundle());
+ } catch (CoreException e) {
+ Activator.log.error(e);
+ } catch (IOException e) {
+ Activator.log.error(e);
+ }
+ }
+
+ protected static ModelExplorerView view;
+
+ protected static IFile modelFile;
+
+ protected static Bundle bundle;
+
+ protected static SWTWorkbenchBot bot;
+
+ public AbstractControlModeTest() {
+ super();
+ }
+
+ @After
+ public void after() throws CoreException {
+ GenericUtils.closeAllEditors();
+ GenericUtils.cleanWorkspace();
+ ProjectUtils.removeAllProjectFromTheWorkspace();
+ }
+
+ protected abstract void initTests(final Bundle bundle) throws CoreException, IOException;
+
+ protected void controlAndSave(IMultiDiagramEditor editor, Model model, List<PackageableElement> elements, Command cmd) {
+ try {
+ HandlerUtils.executeCommand(cmd);
+
+ } catch (Throwable e) {
+ String s = "*********************************************\n";
+ do {
+ StackTraceElement[] stackTrace = e.getStackTrace();
+ s += e.getLocalizedMessage() + "\n";
+ for(StackTraceElement stackTraceElement : stackTrace) {
+ s += stackTraceElement.toString() + "\n";
+ }
+ s += "-------------------------------------------------\n";
+ } while((e = e.getCause()) != null);
+ fail(s);
+
+ }
+ ISaveAndDirtyService saveService;
+ try {
+ saveService = editor.getServicesRegistry().getService(ISaveAndDirtyService.class);
+ saveService.doSave(new NullProgressMonitor());
+ } catch (ServiceException e) {
+ fail(e.getMessage());
+
+ }
+
+ // Execute save
+ // Assert that the parent package is controlled
+ PackageableElement submodel = elements.get(0);
+ Assert.assertTrue(ControlHelper.isRootControlledObject(submodel));
+
+ // Assert that the model and submodel belong to different
+ // resources
+ Assert.assertNotEquals(Messages.AbstractControlModeTest_1, model, submodel);
+ }
+
+ /**
+ * Select the first subpackage of the root package in the model explorer
+ *
+ * @return
+ */
+ protected List<PackageableElement> selectElementToControl() {
+ try {
+ editor = EditorUtils.openPapyrusEditor(modelFile);
+ } catch (PartInitException e1) {
+ fail(e1.getMessage());
+ }
+ try {
+ AbstractControlModeTest.view = ModelExplorerUtils.openModelExplorerView();
+ } catch (Exception e) {
+
+ fail(e.getMessage());
+ }
+ model = (Model)ModelExplorerUtils.getRootInModelExplorer(view);
+ List<PackageableElement> elements = new ArrayList<PackageableElement>();
+ for(PackageableElement packageableElement : model.getPackagedElements()) {
+ if(packageableElement instanceof org.eclipse.uml2.uml.Package) {
+ elements.add(packageableElement);
+ }
+ }
+ ModelExplorerUtils.setSelectionInTheModelexplorer(view, elements);
+ return elements;
+ }
+
+}
diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/control/Activator.java b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/control/Activator.java
new file mode 100644
index 0000000..e3ea14f
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/control/Activator.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ * 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:
+ * Juan Cadavid <juan.cadavid@cea.fr> implementation
+ ******************************************************************************/
+package org.eclipse.papyrus.infra.services.controlmode.tests.control;
+
+import org.eclipse.papyrus.infra.core.log.LogHelper;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.infra.services.controlmode.tests"; //$NON-NLS-1$
+
+ public static LogHelper log;
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ log = new LogHelper(this);
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#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 Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/control/ControlModelTest.java b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/control/ControlModelTest.java
new file mode 100644
index 0000000..ce839fa
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/control/ControlModelTest.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ * 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:
+ * Juan Cadavid <juan.cadavid@cea.fr> implementation
+ ******************************************************************************/
+package org.eclipse.papyrus.infra.services.controlmode.tests.control;
+
+import static org.junit.Assert.fail;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.eclipse.core.commands.IParameter;
+import org.eclipse.core.commands.ParameterValuesException;
+import org.eclipse.core.commands.common.NotDefinedException;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.papyrus.infra.services.controlmode.commands.ControlModeCommandParameterValues;
+import org.eclipse.papyrus.infra.services.controlmode.handlers.ControlCommandHandler;
+import org.eclipse.papyrus.infra.services.controlmode.tests.Messages;
+import org.eclipse.papyrus.junit.utils.HandlerUtils;
+import org.eclipse.papyrus.junit.utils.PapyrusProjectUtils;
+import org.eclipse.papyrus.junit.utils.ProjectUtils;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
+import org.eclipse.uml2.uml.PackageableElement;
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+
+public class ControlModelTest extends AbstractControlModeTest {
+
+ private static final String PROJECT_NAME = "ControlModeTestProject"; //$NON-NLS-1$
+
+ private static final String SOURCE_PATH = "/model/ControlModelTest/"; //$NON-NLS-1$
+
+ private static final String FILE_ROOT_NAME = "ControlModeTestModel"; //$NON-NLS-1$
+
+ protected void initTests(final Bundle bundle) throws CoreException, IOException {
+ bot = new SWTWorkbenchBot();
+ ProjectUtils.removeAllProjectFromTheWorkspace();
+ IProject testProject = ProjectUtils.createProject(PROJECT_NAME);
+ modelFile = PapyrusProjectUtils.copyPapyrusModel(testProject, bundle, SOURCE_PATH, FILE_ROOT_NAME);
+ AbstractControlModeTest.bundle = bundle;
+ }
+
+ @Ignore @Test
+ public void controlModelTest() {
+ RunnableWithResult<?> runnableWithResult = new RunnableWithResult.Impl<Object>() {
+
+ @Override
+ public void run() {
+ List<PackageableElement> elements = selectElementToControl();
+ Assert.assertTrue(Messages.ControlModelTest_4, HandlerUtils.getActiveHandlerFor(COMMAND_ID).isEnabled());
+ // Click "ok" with SWTBot
+ Display.getDefault().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ fail(e.getLocalizedMessage());
+ }
+
+
+ bot.button("OK").click(); //$NON-NLS-1$
+
+ }
+ });
+ controlAndSave(editor, model, elements, HandlerUtils.getCommand(COMMAND_ID));
+ }
+
+ };
+ Display.getDefault().syncExec(runnableWithResult);
+ }
+
+ @Test
+ public void controlModelTestWithoutDialog() throws NotDefinedException, ParameterValuesException {
+ IParameter dialogParameter = HandlerUtils.getCommand(this.COMMAND_ID).getParameter(ControlCommandHandler.CONTROLMODE_USE_DIALOG_PARAMETER);
+ ControlModeCommandParameterValues controlModePlatformValues = (ControlModeCommandParameterValues)dialogParameter.getValues();
+ controlModePlatformValues.put("showDialog", false);
+ RunnableWithResult<?> runnableWithResult = new RunnableWithResult.Impl<Object>() {
+
+ @Override
+ public void run() {
+ List<PackageableElement> elements = selectElementToControl();
+ Assert.assertTrue(Messages.ControlModelTest_4, HandlerUtils.getActiveHandlerFor(COMMAND_ID).isEnabled());
+
+ controlAndSave(editor, model, elements, HandlerUtils.getCommand(COMMAND_ID));
+ }
+
+ };
+ Display.getDefault().syncExec(runnableWithResult);
+ }
+
+}
diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/control/ControlModelWithProfileTest.java b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/control/ControlModelWithProfileTest.java
new file mode 100644
index 0000000..4dd1ebc
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/control/ControlModelWithProfileTest.java
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ * 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:
+ * Juan Cadavid <juan.cadavid@cea.fr> implementation
+ ******************************************************************************/
+package org.eclipse.papyrus.infra.services.controlmode.tests.control;
+
+import static org.junit.Assert.fail;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.eclipse.core.commands.IParameter;
+import org.eclipse.core.commands.ParameterValuesException;
+import org.eclipse.core.commands.common.NotDefinedException;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.papyrus.infra.services.controlmode.commands.ControlModeCommandParameterValues;
+import org.eclipse.papyrus.infra.services.controlmode.handlers.ControlCommandHandler;
+import org.eclipse.papyrus.infra.services.controlmode.tests.Messages;
+import org.eclipse.papyrus.junit.utils.HandlerUtils;
+import org.eclipse.papyrus.junit.utils.PapyrusProjectUtils;
+import org.eclipse.papyrus.junit.utils.ProjectUtils;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
+import org.eclipse.uml2.uml.PackageableElement;
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+
+public class ControlModelWithProfileTest extends AbstractControlModeTest {
+
+ static final String PROJECT_NAME = "ControlModeWithProfileTestProject"; //$NON-NLS-1$
+
+ static final String SOURCE_PATH = "/model/ControlModeWithProfileTest/"; //$NON-NLS-1$
+
+ static final String MODEL_FILE_NAME = "ControlModeWithProfileTestModel"; //$NON-NLS-1$
+
+ static final String PROFILE_FILE_NAME = "testProfile.profile"; //$NON-NLS-1$
+
+ @Override
+ protected void initTests(final Bundle bundle) throws CoreException, IOException {
+ bot = new SWTWorkbenchBot();
+ ProjectUtils.removeAllProjectFromTheWorkspace();
+ IProject testProject = ProjectUtils.createProject(PROJECT_NAME);
+ modelFile = PapyrusProjectUtils.copyPapyrusModel(testProject, bundle, SOURCE_PATH, MODEL_FILE_NAME);
+ PapyrusProjectUtils.copyPapyrusModel(testProject, bundle, SOURCE_PATH, PROFILE_FILE_NAME);
+ AbstractControlModeTest.bundle = bundle;
+ }
+
+ @Ignore @Test
+ public void controlModelWithProfileTest() {
+ RunnableWithResult<?> runnableWithResult = new RunnableWithResult.Impl<Object>() {
+
+ @Override
+ public void run() {
+ List<PackageableElement> elements = selectElementToControl();
+ Assert.assertTrue(Messages.ControlModelWithProfileTest_4, HandlerUtils.getActiveHandlerFor(COMMAND_ID).isEnabled());
+ // Click "ok" with SWTBot
+ Display.getDefault().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ fail(e.getLocalizedMessage());
+ }
+ bot.button("OK").click(); //$NON-NLS-1$
+
+ }
+ });
+ controlAndSave(editor, model, elements, HandlerUtils.getCommand(COMMAND_ID));
+ }
+
+ };
+ Display.getDefault().syncExec(runnableWithResult);
+ }
+
+ @Test
+ public void controlModelTestWithProfileTestWithoutDialog() throws NotDefinedException, ParameterValuesException {
+ IParameter dialogParameter = HandlerUtils.getCommand(this.COMMAND_ID).getParameter(ControlCommandHandler.CONTROLMODE_USE_DIALOG_PARAMETER);
+ ControlModeCommandParameterValues controlModePlatformValues = (ControlModeCommandParameterValues)dialogParameter.getValues();
+ controlModePlatformValues.put("showDialog", false);
+ RunnableWithResult<?> runnableWithResult = new RunnableWithResult.Impl<Object>() {
+
+ @Override
+ public void run() {
+ List<PackageableElement> elements = selectElementToControl();
+ Assert.assertTrue(Messages.ControlModelTest_4, HandlerUtils.getActiveHandlerFor(COMMAND_ID).isEnabled());
+
+ controlAndSave(editor, model, elements, HandlerUtils.getCommand(COMMAND_ID));
+ }
+
+ };
+ Display.getDefault().syncExec(runnableWithResult);
+ }
+
+}
diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/messages.properties b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/messages.properties
new file mode 100644
index 0000000..3f3ee75
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/messages.properties
@@ -0,0 +1,7 @@
+AbstractControlModeTest_1=The model and submodel are not in different resources
+AbstractUncontrolModelTest_1=The model and submodel do not belong to the same resource after reintegration
+ControlModelTest_4=The handler for control mode is not enabled\!
+ControlModelWithProfileTest_4=The handler for control mode is not enabled\!
+ExistingResourceControlModeTest_5=The handler for control mode is not enabled\!
+UncontrolModelTest_4=The handler for reintegrate model is not enabled\!
+UncontrolModelWithProfileTest_5=The handler for reintegrate model is not enabled\!
diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/uncontrol/AbstractUncontrolModelTest.java b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/uncontrol/AbstractUncontrolModelTest.java
new file mode 100644
index 0000000..b7ffd6d
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/uncontrol/AbstractUncontrolModelTest.java
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ * 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:
+ * Juan Cadavid <juan.cadavid@cea.fr> implementation
+ ******************************************************************************/
+package org.eclipse.papyrus.infra.services.controlmode.tests.uncontrol;
+
+import static org.junit.Assert.fail;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.commands.Command;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
+import org.eclipse.papyrus.infra.core.lifecycleevents.ISaveAndDirtyService;
+import org.eclipse.papyrus.infra.services.controlmode.tests.Messages;
+import org.eclipse.papyrus.infra.services.controlmode.tests.control.Activator;
+import org.eclipse.papyrus.infra.services.controlmode.util.ControlHelper;
+import org.eclipse.papyrus.junit.utils.EditorUtils;
+import org.eclipse.papyrus.junit.utils.GenericUtils;
+import org.eclipse.papyrus.junit.utils.HandlerUtils;
+import org.eclipse.papyrus.junit.utils.ModelExplorerUtils;
+import org.eclipse.papyrus.junit.utils.ProjectUtils;
+import org.eclipse.papyrus.junit.utils.tests.AbstractPapyrusTest;
+import org.eclipse.papyrus.views.modelexplorer.ModelExplorerView;
+import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
+import org.eclipse.uml2.uml.Model;
+import org.eclipse.uml2.uml.PackageableElement;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.osgi.framework.Bundle;
+
+public abstract class AbstractUncontrolModelTest extends AbstractPapyrusTest {
+
+ protected static final String COMMAND_ID = "org.eclipse.papyrus.infra.services.controlmode.reintegratesubmodel"; //$NON-NLS-1$
+
+ protected static IMultiDiagramEditor papyrusEditor;
+
+ protected static ModelExplorerView view;
+
+ protected static IFile modelFile;
+
+ protected static Bundle bundle;
+
+ protected static SWTWorkbenchBot bot;
+
+ protected static IFile subModelfile;
+ protected IMultiDiagramEditor editor = null;
+ protected Model model;
+
+ public AbstractUncontrolModelTest() {
+ super();
+ }
+
+ @Before
+ public void setUp() {
+ try {
+ initTests(Activator.getDefault().getBundle());
+ } catch (CoreException e) {
+ Activator.log.error(e);
+ } catch (IOException e) {
+ Activator.log.error(e);
+ }
+ }
+
+ @After
+ public void after() throws CoreException {
+ GenericUtils.closeAllEditors();
+ GenericUtils.cleanWorkspace();
+ ProjectUtils.removeAllProjectFromTheWorkspace();
+ }
+
+ public abstract void initTests(final Bundle bundle) throws CoreException, IOException;
+
+ protected PackageableElement selectElementToUncontrol() {
+ try {
+ editor = EditorUtils.openPapyrusEditor(modelFile);
+ UncontrolModelTest.view = ModelExplorerUtils.openModelExplorerView();
+
+ } catch (Exception e) {
+ fail(e.getMessage());
+ }
+
+ model = (Model)ModelExplorerUtils.getRootInModelExplorer(view);
+ List<PackageableElement> elements = new ArrayList<PackageableElement>();
+ for(PackageableElement packageableElement : model.getPackagedElements()) {
+ if(packageableElement instanceof org.eclipse.uml2.uml.Package) {
+ elements.add(packageableElement);
+ }
+ }
+ // Assert that this element is controlled
+ PackageableElement submodel = elements.get(0);
+ Assert.assertNotNull(submodel);
+ boolean isControlled = ControlHelper.isRootControlledObject(submodel);
+ Assert.assertTrue(isControlled);
+ ModelExplorerUtils.setSelectionInTheModelexplorer(view, elements);
+ return submodel;
+ }
+
+ public void uncontrolAndSave(PackageableElement submodel, Command cmd) {
+ try {
+ HandlerUtils.executeCommand(cmd);
+
+ // Execute save
+ ISaveAndDirtyService saveService = editor.getServicesRegistry().getService(ISaveAndDirtyService.class);
+ saveService.doSave(new NullProgressMonitor());
+ } catch (Exception e) {
+ fail(e.getMessage());
+ }
+
+ // Assert that the resource for the model and the submodel
+ // are the same
+ Assert.assertEquals(Messages.AbstractUncontrolModelTest_1, model.eResource(), submodel.eResource());
+ }
+
+}
diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/uncontrol/UncontrolModelTest.java b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/uncontrol/UncontrolModelTest.java
new file mode 100644
index 0000000..8ae296d
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/uncontrol/UncontrolModelTest.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ * 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:
+ * Juan Cadavid <juan.cadavid@cea.fr> implementation
+ ******************************************************************************/
+package org.eclipse.papyrus.infra.services.controlmode.tests.uncontrol;
+
+import java.io.IOException;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.papyrus.infra.services.controlmode.tests.Messages;
+import org.eclipse.papyrus.junit.utils.HandlerUtils;
+import org.eclipse.papyrus.junit.utils.PapyrusProjectUtils;
+import org.eclipse.papyrus.junit.utils.ProjectUtils;
+import org.eclipse.swt.widgets.Display;
+import org.junit.Assert;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+
+public class UncontrolModelTest extends AbstractUncontrolModelTest {
+
+ static final String PROJECT_NAME = "ReintegrateTestProject"; //$NON-NLS-1$
+
+ private static final String SOURCE_PATH = "/model/UncontrolModelTest/"; //$NON-NLS-1$
+
+ private static final String MODEL_FILE_ROOT_NAME = "ReintegrateTestModel"; //$NON-NLS-1$
+
+ private static final String SUBMODEL_FILE_ROOT_NAME = "Subpackage"; //$NON-NLS-1$
+
+ @Override
+ public void initTests(final Bundle bundle) throws CoreException, IOException {
+ ProjectUtils.removeAllProjectFromTheWorkspace();
+ IProject testProject = ProjectUtils.createProject(PROJECT_NAME);
+ modelFile = PapyrusProjectUtils.copyPapyrusModel(testProject, bundle, SOURCE_PATH, MODEL_FILE_ROOT_NAME);
+ subModelfile = PapyrusProjectUtils.copyPapyrusModel(testProject, bundle, SOURCE_PATH, SUBMODEL_FILE_ROOT_NAME);
+ AbstractUncontrolModelTest.bundle = bundle;
+ }
+
+ @Test
+ public void uncontrolModelTest() {
+ RunnableWithResult<?> runnableWithResult = new RunnableWithResult.Impl<Object>() {
+
+ @Override
+ public void run() {
+
+ Assert.assertTrue(Messages.UncontrolModelTest_4, HandlerUtils.getActiveHandlerFor(COMMAND_ID).isEnabled());
+ uncontrolAndSave(selectElementToUncontrol(), HandlerUtils.getCommand(COMMAND_ID));
+
+ }
+
+ };
+ Display.getDefault().syncExec(runnableWithResult);
+ }
+}
diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/uncontrol/UncontrolModelWithProfileTest.java b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/uncontrol/UncontrolModelWithProfileTest.java
new file mode 100644
index 0000000..4776bb9
--- /dev/null
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/uncontrol/UncontrolModelWithProfileTest.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ * 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:
+ * Juan Cadavid <juan.cadavid@cea.fr> implementation
+ ******************************************************************************/
+package org.eclipse.papyrus.infra.services.controlmode.tests.uncontrol;
+
+import java.io.IOException;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.papyrus.infra.services.controlmode.tests.Messages;
+import org.eclipse.papyrus.junit.utils.HandlerUtils;
+import org.eclipse.papyrus.junit.utils.PapyrusProjectUtils;
+import org.eclipse.papyrus.junit.utils.ProjectUtils;
+import org.eclipse.swt.widgets.Display;
+import org.junit.Assert;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+
+public class UncontrolModelWithProfileTest extends AbstractUncontrolModelTest {
+
+ private static final String PROJECT_NAME = "UncontrolModelWithProfileTestProject"; //$NON-NLS-1$
+
+ private static final String SOURCE_PATH = "/model/UncontrolModeWithProfileTest/"; //$NON-NLS-1$
+
+ private static final String MODEL_FILE_ROOT_NAME = "UncontrolModeWithProfileTestModel"; //$NON-NLS-1$
+
+ private static final String SUBMODEL_FILE_ROOT_NAME = "submodel"; //$NON-NLS-1$
+
+ private static final String PROFILE_FILE_NAME = "testProfile.profile"; //$NON-NLS-1$
+
+ public void initTests(final Bundle bundle) throws CoreException, IOException {
+ ProjectUtils.removeAllProjectFromTheWorkspace();
+ IProject testProject = ProjectUtils.createProject(PROJECT_NAME);
+
+ //Copy the profile
+ PapyrusProjectUtils.copyPapyrusModel(testProject, bundle, SOURCE_PATH, PROFILE_FILE_NAME);
+
+ //Copy the controlled model
+ modelFile = PapyrusProjectUtils.copyPapyrusModel(testProject, bundle, SOURCE_PATH, MODEL_FILE_ROOT_NAME);
+
+ //Copy the submodel
+ subModelfile = PapyrusProjectUtils.copyPapyrusModel(testProject, bundle, SOURCE_PATH, SUBMODEL_FILE_ROOT_NAME);
+ UncontrolModelWithProfileTest.bundle = bundle;
+ }
+
+ @Test
+ public void uncontrolModelWithProfileTest() {
+ RunnableWithResult<?> runnableWithResult = new RunnableWithResult.Impl<Object>() {
+
+ @Override
+ public void run() {
+ Assert.assertTrue(Messages.UncontrolModelWithProfileTest_5, HandlerUtils.getActiveHandlerFor(COMMAND_ID).isEnabled());
+ uncontrolAndSave(selectElementToUncontrol(), HandlerUtils.getCommand(COMMAND_ID));
+ }
+
+ };
+ Display.getDefault().syncExec(runnableWithResult);
+ }
+
+
+}