Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrschnekenbu2012-04-11 16:18:44 +0000
committerrschnekenbu2012-04-11 16:18:44 +0000
commit5fac630da306b570f675572fbc49aed116ee13c8 (patch)
tree1185c16c1f5f81b76e4f6894dca3d9a9e3567519
parentf758b4490c7f2f02a289a735528ab670971700cd (diff)
downloadorg.eclipse.papyrus-5fac630da306b570f675572fbc49aed116ee13c8.tar.gz
org.eclipse.papyrus-5fac630da306b570f675572fbc49aed116ee13c8.tar.xz
org.eclipse.papyrus-5fac630da306b570f675572fbc49aed116ee13c8.zip
Initial import.
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/.classpath8
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/.project28
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/META-INF/MANIFEST.MF11
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/about.html28
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteBlockTest$1.classbin0 -> 1130 bytes
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteBlockTest.classbin0 -> 4036 bytes
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPastePartTest.classbin0 -> 1944 bytes
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteTest.classbin0 -> 12460 bytes
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteTest.java_bak358
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPastePartTest.java_bak129
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimpleBlock2Test.classbin0 -> 4277 bytes
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimpleBlockTest.classbin0 -> 4269 bytes
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimplePartTest.classbin0 -> 4522 bytes
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/suites/AllCopyPasteTests.classbin0 -> 806 bytes
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/suites/AllCopyPasteTests.java_bak28
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/suites/AllTests.classbin0 -> 593 bytes
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/utils/EditorUtils.classbin0 -> 2481 bytes
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/build.properties8
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/model/ModelWithBDD.di17
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/model/ModelWithBDD.notation291
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/model/ModelWithBDD.uml123
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/model/SysMLModelExplorerCopyPasteTestModel.di29
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/model/SysMLModelExplorerCopyPasteTestModel.notation200
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/model/SysMLModelExplorerCopyPasteTestModel.uml74
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/org.eclipse.papyrus.sysml.modelexplorer.tests.launch43
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/plugin.properties14
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteBlockTest.java85
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPastePartTest.java70
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteTest.java390
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimpleBlock2Test.java117
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimpleBlockTest.java117
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimplePartTest.java137
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/suites/AllCopyPasteTests.java36
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteTest.java_bak358
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPastePartTest.java_bak129
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/suites/AllCopyPasteTests.java_bak28
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/suites/AllTests.java29
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/utils/EditorUtils.java63
39 files changed, 2956 insertions, 0 deletions
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/.classpath b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/.classpath
new file mode 100644
index 00000000000..23f23cf2994
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/.classpath
@@ -0,0 +1,8 @@
+<?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/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="test"/>
+ <classpathentry kind="src" path="test-gen"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/.project b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/.project
new file mode 100644
index 00000000000..a8bb94c6054
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.sysml.modelexplorer.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/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..6483dbabb88
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Thu Mar 22 15:37:05 CET 2012
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..5dd6328b443
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,11 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.papyrus.sysml.modelexplorer.tests
+Bundle-Version: 0.8.2.qualifier
+Bundle-Vendor: %providerName
+Fragment-Host: org.eclipse.papyrus.sysml.modelexplorer;bundle-version="0.8.2"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Localization: plugin
+Require-Bundle: org.junit;bundle-version="4.8.2",
+ org.eclipse.core.expressions;bundle-version="3.4.300"
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/about.html b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/about.html
new file mode 100644
index 00000000000..82d49bf5f81
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.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/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteBlockTest$1.class b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteBlockTest$1.class
new file mode 100644
index 00000000000..2a6a9fe1f12
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteBlockTest$1.class
Binary files differ
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteBlockTest.class b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteBlockTest.class
new file mode 100644
index 00000000000..7a142734657
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteBlockTest.class
Binary files differ
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPastePartTest.class b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPastePartTest.class
new file mode 100644
index 00000000000..fd53dae4099
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPastePartTest.class
Binary files differ
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteTest.class b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteTest.class
new file mode 100644
index 00000000000..a3ffa20e00d
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteTest.class
Binary files differ
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteTest.java_bak b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteTest.java_bak
new file mode 100644
index 00000000000..115dc02fe67
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteTest.java_bak
@@ -0,0 +1,358 @@
+/*****************************************************************************
+ * Copyright (c) 2011 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:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.modelexplorer.tests.copypaste;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import junit.framework.Assert;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
+import org.eclipse.papyrus.modelexplorer.ModelExplorerPageBookView;
+import org.eclipse.papyrus.modelexplorer.ModelExplorerView;
+import org.eclipse.papyrus.modelexplorer.NavigatorUtils;
+import org.eclipse.papyrus.sysml.modelexplorer.Activator;
+import org.eclipse.papyrus.sysml.modelexplorer.tests.utils.EditorUtils;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchCommandConstants;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.commands.ICommandService;
+import org.eclipse.ui.intro.IIntroPart;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.Model;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.Property;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+
+
+/**
+ * Abstract class for Copy/paste
+ */
+public class AbstractCopyPasteTest {
+
+ /** boolean to indicate if the test is initialized or not */
+ private static boolean isInitialized;
+
+ /** main papyrus editor */
+ public static IEditorPart editor = null;
+
+ /** id of the papyrus editor */
+ public static String editorID = "org.eclipse.papyrus.core.papyrusEditor";
+
+ /** view part: the model explorer */
+ protected static IViewPart modelExplorerPart;
+
+ // EObjects selectable
+ protected static Model modelEObject;
+
+ protected static org.eclipse.uml2.uml.Class b1EObject;
+
+ protected static Property b1_pB2EObject;
+
+ protected static Property b1_pB1P2EObject;
+
+ protected static org.eclipse.uml2.uml.Class b2EObject;
+
+ protected static Package p1EObject;
+
+ protected static org.eclipse.uml2.uml.Class p1_b1p1EObject;
+
+ protected static Property p1_b1p1_pB1EObject;
+
+ protected static Property p1_b1p1_pB2P1EObject;
+
+ protected static org.eclipse.uml2.uml.Class p1_b2p1EObject;
+
+ // end of selectable EObjects
+ /**
+ * Prepare the diagram before testing
+ *
+ * @throws Exception
+ * exception thrown in case of problem
+ */
+ @BeforeClass
+ public static void prepareTest() throws Exception {
+ DiagramEditPart diagramEditPart = EditorUtils.getDiagramEditPart();
+ EObject root = diagramEditPart.getDiagramView().getElement();
+
+ Assert.assertTrue("Impossible to find main model", root instanceof Model);
+ modelEObject = (Model)root;
+ b1EObject = (Class)modelEObject.getPackagedElement("B1");
+ Assert.assertNotNull(b1EObject);
+ b1_pB2EObject = b1EObject.getPart("pB2", null);
+ Assert.assertNotNull(b1_pB2EObject);
+ b1_pB1P2EObject = b1EObject.getPart("pB1P1", null);
+ Assert.assertNotNull(b1_pB1P2EObject);
+ b2EObject = (Class)modelEObject.getPackagedElement("B2");
+ Assert.assertNotNull(b2EObject);
+ p1EObject = (Package)modelEObject.getPackagedElement("P1");
+ Assert.assertNotNull(p1EObject);
+ p1_b1p1EObject = (Class)p1EObject.getPackagedElement("B1P1");
+ Assert.assertNotNull(p1_b1p1EObject);
+ p1_b1p1_pB1EObject = p1_b1p1EObject.getPart("pB1", null);
+ Assert.assertNotNull(p1_b1p1_pB1EObject);
+ p1_b1p1_pB2P1EObject = p1_b1p1EObject.getPart("pB2P1", null);
+ Assert.assertNotNull(p1_b1p1_pB2P1EObject);
+ p1_b2p1EObject = (Class)p1EObject.getPackagedElement("B2P1");
+ Assert.assertNotNull(p1_b2p1EObject);
+ }
+
+ /**
+ * Initialization of the test
+ *
+ * @throws Exception
+ * thrown when initialization has problem
+ */
+ @BeforeClass
+ public static void openPapyrusWithAnEmptyProject() throws Exception {
+ IIntroPart introPart = PlatformUI.getWorkbench().getIntroManager().getIntro();
+ PlatformUI.getWorkbench().getIntroManager().closeIntro(introPart);
+ // Prepare new project for tests
+ IProject testProject = ResourcesPlugin.getWorkspace().getRoot().getProject("TestProject");
+ if(!testProject.exists()) {
+ testProject.create(new NullProgressMonitor());
+ }
+
+ if(!testProject.isOpen()) {
+ testProject.open(new NullProgressMonitor());
+ }
+
+ // Copy EmptyModel from bundle to the test project
+ IFile emptyModel_di = testProject.getFile("ModelWithBDD.di");
+ IFile emptyModel_no = testProject.getFile("ModelWithBDD.notation");
+ IFile emptyModel_uml = testProject.getFile("ModelWithBDD.uml");
+
+ // isInitialized = isInitialized || emptyModel_di.exists();
+
+ if(!isInitialized) {
+ isInitialized = true;
+ emptyModel_di.create(Activator.getDefault().getBundle().getResource("/model/ModelWithBDD.di").openStream(), true, new NullProgressMonitor());
+ emptyModel_no.create(Activator.getDefault().getBundle().getResource("/model/ModelWithBDD.notation").openStream(), true, new NullProgressMonitor());
+ emptyModel_uml.create(Activator.getDefault().getBundle().getResource("/model/ModelWithBDD.uml").openStream(), true, new NullProgressMonitor());
+ }
+
+ // Open the EmptyModel.di file with Papyrus (assumed to be the default editor for "di" files here).
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ editor = page.openEditor(new FileEditorInput(emptyModel_di), editorID);
+
+ modelExplorerPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(ModelExplorerPageBookView.VIEW_ID);
+ Assert.assertNotNull("Model explorer is null", modelExplorerPart);
+ }
+
+ /**
+ * Close editor
+ *
+ * @throws Exception
+ * exception thrown in case of problem
+ */
+ @AfterClass
+ public static void closePapyrusAndCleanProject() throws Exception {
+ // Close the editor without saving content created during tests
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ page.closeEditor(editor, false);
+ }
+
+
+ /**
+ * Selects and reveal the specified element
+ *
+ * @param object
+ * the object to select
+ * @throws Exception
+ * exception thrown in case element could not be selected
+ */
+ public static void selectAndReveal(EObject object) throws Exception {
+ selectAndReveal(Arrays.asList(object));
+ }
+
+ /**
+ * Selects and reveal the specified list of elements
+ *
+ * @param newElements
+ * the list of objects to select
+ * @throws Exception
+ * exception thrown in case element could not be selected
+ */
+ public static void selectAndReveal(List<EObject> newElements) throws Exception {
+ // Retrieve model explorer
+ ModelExplorerView modelExplorerView = null;
+
+ ModelExplorerPageBookView bookViewPart = (ModelExplorerPageBookView)NavigatorUtils.findViewPart(ModelExplorerPageBookView.VIEW_ID); //$NON-NLS-0$
+ if(bookViewPart != null) {
+ modelExplorerView = (ModelExplorerView)((ModelExplorerPageBookView)bookViewPart).getActiveView();
+ }
+
+ // Set selection on new element in the model explorer
+ if((modelExplorerView != null) && (newElements != null)) {
+ List<EObject> semanticElementList = new ArrayList<EObject>();
+ semanticElementList.addAll(newElements);
+ modelExplorerView.revealSemanticElement(semanticElementList);
+ } else {
+ throw new Exception("Impossible to find the model explorer required to select: " + newElements);
+ }
+ }
+
+ /**
+ * Generic implementation of the test
+ *
+ * @throws Exception
+ * exception thrown when the test has problems
+ */
+ protected void testExecutableCopyPaste(EObject targetContainer, EObject copiedEObject, EStructuralFeature feature) throws Exception {
+ // retrieve elements in the model explorer
+ selectAndReveal(targetContainer);
+
+ List<EObject> originalValues = new ArrayList<EObject>((List<EObject>)targetContainer.eGet(feature));
+
+ Map<Object, Object> originalModel = new HashMap<Object, Object>();
+ initializeTest(originalModel, targetContainer, copiedEObject);
+
+ // try to paste in several places
+ // copy Paste b1EObject
+ ICommandService commandService = (ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class);
+ commandService.refreshElements(IWorkbenchCommandConstants.EDIT_PASTE, null);
+ org.eclipse.core.commands.Command pasteCommand = commandService.getCommand(IWorkbenchCommandConstants.EDIT_PASTE);
+ Assert.assertNotNull("Impossible to find paste command", pasteCommand);
+ Assert.assertTrue("command in not enabled", pasteCommand.isEnabled());
+ Assert.assertTrue("command in not defined", pasteCommand.isDefined());
+
+ pasteCommand.executeWithChecks(new ExecutionEvent());
+
+ // check editor state (should be non dirty)
+ Assert.assertTrue("Editor should be dirty after paste command execution", isEditorDirty());
+
+
+ // should retrieve a new Part AND a new association
+ List<EObject> newValues = (List<EObject>)targetContainer.eGet(feature);
+ // size = original size +1
+ Assert.assertEquals("Wrong number of attributes after paste", originalValues.size() + 1, newValues.size());
+
+ // check the new one has a property
+ Iterator<EObject> it = newValues.iterator();
+ EObject newValue = null;
+ while(it.hasNext()) {
+ EObject value = it.next();
+ if(!originalValues.contains(value)) {
+ newValue = value;
+ }
+ }
+
+ Assert.assertNotNull("Impossible to find the new Part", newValue);
+
+ // part should be linked to an association
+ postCopyAdditionalChecks(originalModel, newValue);
+
+ // undo
+ if(getEditingDomain().getCommandStack().canUndo()) {
+ getEditingDomain().getCommandStack().undo();
+ } else {
+ throw new Exception("Impossible to undo the paste command: " + pasteCommand);
+ }
+ // check editor state (should be non dirty)
+ Assert.assertTrue("Editor should not be dirty after undo", isEditorDirty());
+ // check old values equals the actual values
+ newValues = (List<EObject>)targetContainer.eGet(feature);
+ Assert.assertEquals("Initial and current list feature list should be equivalent", newValues, originalValues);
+
+ // redo
+ if(getEditingDomain().getCommandStack().canRedo()) {
+ getEditingDomain().getCommandStack().redo();
+ } else {
+ throw new Exception("Impossible to redo the paste command: " + pasteCommand);
+ }
+ // check editor state (should be non dirty)
+ Assert.assertFalse("Editor should not dirty after redo", isEditorDirty());
+
+ // check as it was the result of the paste command
+ newValues = (List<EObject>)targetContainer.eGet(feature);
+ // size = 3
+ Assert.assertEquals("Wrong number of attributes after paste", originalValues.size() + 1, newValues.size());
+
+ // check the new one has a property
+ it = newValues.iterator();
+ newValue = null;
+ while(it.hasNext()) {
+ EObject value = it.next();
+ if(!originalValues.contains(value)) {
+ newValue = value;
+ }
+ }
+ Assert.assertNotNull("Impossible to find the new Part", newValue);
+
+ // part should be linked to an association
+ postCopyAdditionalChecks(originalModel, newValue);
+
+ // undo again, to restore state
+ if(getEditingDomain().getCommandStack().canUndo()) {
+ getEditingDomain().getCommandStack().undo();
+ } else {
+ throw new Exception("Impossible to re-undo the paste command: " + pasteCommand);
+ }
+ // check editor state (should be non dirty)
+ Assert.assertTrue("Editor should not be dirty after undo", isEditorDirty());
+
+ }
+
+ /**
+ * executes additional checks on the new value
+ *
+ * @param originalModel
+ * the map containing all values stored before launching the test
+ * @param newValue
+ * the new value, result of the copy
+ */
+ protected void postCopyAdditionalChecks(Map<?, ?> originalModel, EObject newValue) throws Exception {
+ // use the values contained in the map to do additional checks
+ }
+
+ protected void initializeTest(Map<Object, Object> additionalChecks, EObject targetContainer, EObject copiedEObject) {
+ // nothing to do here
+ }
+
+ /**
+ * Returns the current editing domain
+ *
+ * @return
+ * the current editing domain
+ */
+ protected TransactionalEditingDomain getEditingDomain() throws Exception {
+ return org.eclipse.papyrus.core.utils.ServiceUtilsForActionHandlers.getInstance().getTransactionalEditingDomain();
+ }
+
+ /**
+ * Returns <code>true</code> if the current Active editor is dirty.
+ *
+ * @return <code>true</code> if the current Active editor is dirty
+ * @throws Exception
+ * exception thrown in case of problem (NPE, etc.)
+ */
+ protected boolean isEditorDirty() throws Exception {
+ return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().isDirty();
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPastePartTest.java_bak b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPastePartTest.java_bak
new file mode 100644
index 00000000000..c32b1b55815
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPastePartTest.java_bak
@@ -0,0 +1,129 @@
+/*****************************************************************************
+ * Copyright (c) 2011 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:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.modelexplorer.tests.copypaste;
+
+import java.util.Map;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.ui.IWorkbenchCommandConstants;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.commands.ICommandService;
+import org.eclipse.uml2.uml.Association;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+
+/**
+ * Test for Copy / Paste of a Part
+ */
+public class CopyPastePartTest extends AbstractCopyPasteTest {
+
+ /**
+ * prepare the copy
+ *
+ * @throws Exception
+ * exception thrown in case of problems
+ */
+ @Before
+ public void testPrepare() throws Exception {
+ // check editor state (should be non dirty)
+ Assert.assertFalse("Editor should not be dirty at initialization", isEditorDirty());
+ // retrieve elements in the model explorer
+ selectAndReveal(pB2_B1_EObject);
+
+ // copy Paste b1EObject
+ ICommandService commandService = (ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class);
+ commandService.refreshElements(IWorkbenchCommandConstants.EDIT_COPY, null);
+ org.eclipse.core.commands.Command copyCommand = commandService.getCommand(IWorkbenchCommandConstants.EDIT_COPY);
+ Assert.assertNotNull("Impossible to find copy command", copyCommand);
+ Assert.assertTrue("command in not enabled", copyCommand.isEnabled());
+ Assert.assertTrue("command in not defined", copyCommand.isDefined());
+ copyCommand.executeWithChecks(new ExecutionEvent());
+
+ // check editor state (should be non dirty)
+ // Assert.assertFalse("Editor should not be dirty after copy", isEditorDirty());
+
+ // NOTE: save editor. The copy command should not dirty the model, the implementation of the copy command or the editor should be modified
+ Assert.assertTrue("Copy command is dirtying the model, whereas it should not. This assert is here to remember that the test code should be modified: Isdirty = false after copy...", isEditorDirty());
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().doSave(new NullProgressMonitor());
+ Assert.assertFalse("Save command is non-dirtying the model, whereas it should. ", isEditorDirty());
+ // END NOTE
+ }
+
+ @Override
+ protected void initializeTest(Map<Object, Object> additionalChecks, EObject targetContainer, EObject copiedEObject) {
+ super.initializeTest(additionalChecks, targetContainer, copiedEObject);
+ // nothing here
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void postCopyAdditionalChecks(Map<?, ?> originalModel, EObject newValue) throws Exception {
+ super.postCopyAdditionalChecks(originalModel, newValue);
+
+ Association newAssociation = ((Property)newValue).getAssociation();
+ Assert.assertNotNull("New Part should have an association", newAssociation);
+
+ }
+
+ /**
+ * Test the copy /paste of a part
+ *
+ * @throws Exception
+ * exception thrown in case of problems
+ */
+ @Test
+ public void testPastePartInBlockB1() throws Exception {
+ testExecutableCopyPaste(b1_EObject, pB2_B1_EObject, UMLPackage.eINSTANCE.getClassifier_Attribute());
+ }
+
+ /**
+ * Test the copy /paste of a part
+ *
+ * @throws Exception
+ * exception thrown in case of problems
+ */
+ @Test
+ public void testPastePartInBlockB2() throws Exception {
+ testExecutableCopyPaste(b2_EObject, pB2_B1_EObject, UMLPackage.eINSTANCE.getClassifier_Attribute());
+ }
+
+ /**
+ * Test the copy /paste of a part
+ *
+ * @throws Exception
+ * exception thrown in case of problems
+ */
+ @Test
+ public void testPastePartInBlockB1P1() throws Exception {
+ testExecutableCopyPaste(b1P1_P1_EObject, pB2_B1_EObject, UMLPackage.eINSTANCE.getClassifier_Attribute());
+ }
+
+ /**
+ * Test the copy /paste of a part
+ *
+ * @throws Exception
+ * exception thrown in case of problems
+ */
+ @Test
+ public void testPastePartInBlockB2P1() throws Exception {
+ testExecutableCopyPaste(b2P1_P1_EObject, pB2_B1_EObject, UMLPackage.eINSTANCE.getClassifier_Attribute());
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimpleBlock2Test.class b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimpleBlock2Test.class
new file mode 100644
index 00000000000..baf0ffb72d2
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimpleBlock2Test.class
Binary files differ
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimpleBlockTest.class b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimpleBlockTest.class
new file mode 100644
index 00000000000..dd8c26256d6
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimpleBlockTest.class
Binary files differ
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimplePartTest.class b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimplePartTest.class
new file mode 100644
index 00000000000..5e038998a32
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimplePartTest.class
Binary files differ
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/suites/AllCopyPasteTests.class b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/suites/AllCopyPasteTests.class
new file mode 100644
index 00000000000..173d8f5989d
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/suites/AllCopyPasteTests.class
Binary files differ
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/suites/AllCopyPasteTests.java_bak b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/suites/AllCopyPasteTests.java_bak
new file mode 100644
index 00000000000..285238bbc47
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/suites/AllCopyPasteTests.java_bak
@@ -0,0 +1,28 @@
+/*****************************************************************************
+ * Copyright (c) 2011 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:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.modelexplorer.tests.suites;
+
+import org.eclipse.papyrus.sysml.modelexplorer.tests.copypaste.CopyPasteSimplePartTest;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+
+/**
+ *
+ */
+@RunWith(Suite.class)
+@SuiteClasses({ CopyPasteSimplePartTest.class, })
+public class AllCopyPasteTests {
+
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/suites/AllTests.class b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/suites/AllTests.class
new file mode 100644
index 00000000000..ec05ba82ec8
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/suites/AllTests.class
Binary files differ
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/utils/EditorUtils.class b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/utils/EditorUtils.class
new file mode 100644
index 00000000000..67cd249507d
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/bin/org/eclipse/papyrus/sysml/modelexplorer/tests/utils/EditorUtils.class
Binary files differ
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/build.properties b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/build.properties
new file mode 100644
index 00000000000..1b155673cf5
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/build.properties
@@ -0,0 +1,8 @@
+source.. = test/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.properties,\
+ about.html,\
+ model/
+src.includes = about.html
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/model/ModelWithBDD.di b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/model/ModelWithBDD.di
new file mode 100644
index 00000000000..3b41d552d1e
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/model/ModelWithBDD.di
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="ASCII"?>
+<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">
+ <pageList>
+ <availablePage>
+ <emfPageIdentifier href="ModelWithBDD.notation#_LXISYJdgEeCIWccnqNjPug"/>
+ </availablePage>
+ </pageList>
+ <sashModel currentSelection="//@sashModel/@windows.0/@children.0">
+ <windows>
+ <children xsi:type="di:TabFolder">
+ <children>
+ <emfPageIdentifier href="ModelWithBDD.notation#_LXISYJdgEeCIWccnqNjPug"/>
+ </children>
+ </children>
+ </windows>
+ </sashModel>
+</di:SashWindowsMngr>
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/model/ModelWithBDD.notation b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/model/ModelWithBDD.notation
new file mode 100644
index 00000000000..7a409986aa4
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/model/ModelWithBDD.notation
@@ -0,0 +1,291 @@
+<?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:uml="http://www.eclipse.org/uml2/3.0.0/UML" xmi:id="_LXISYJdgEeCIWccnqNjPug" type="BlockDefinition" name="NewDiagram" measurementUnit="Pixel">
+ <children xmi:type="notation:Shape" xmi:id="_EAXk4HRGEeGbA9TcuN7qCA" type="shape_sysml_block_as_classifier" fontName="Segoe UI" lineColor="0">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_EAdEcHRGEeGbA9TcuN7qCA" source="ShadowFigure">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_EAdEcXRGEeGbA9TcuN7qCA" key="ShadowFigure_Value" value="false"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_EAdEcnRGEeGbA9TcuN7qCA" source="displayNameLabelIcon">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_EAdrgHRGEeGbA9TcuN7qCA" key="displayNameLabelIcon_value" value="false"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_EAdrgXRGEeGbA9TcuN7qCA" source="QualifiedName">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_EAdrgnRGEeGbA9TcuN7qCA" key="QualifiedNameDepth" value="1000"/>
+ </eAnnotations>
+ <children xmi:type="notation:DecorationNode" xmi:id="_EAYzAHRGEeGbA9TcuN7qCA" type="label_sysml_block_name"/>
+ <children xmi:type="notation:ListCompartment" xmi:id="_EAZaEHRGEeGbA9TcuN7qCA" type="compartment_sysml_property_as_list" showTitle="true">
+ <children xmi:type="notation:Node" xmi:id="_Qr9GsHRGEeGbA9TcuN7qCA" type="shape_sysml_part_as_label">
+ <styles xmi:type="notation:ShapeStyle" xmi:id="_Qr9GsXRGEeGbA9TcuN7qCA" fontName="Segoe UI" fillColor="0" lineColor="0"/>
+ <element xmi:type="uml:Property" href="ModelWithBDD.uml#_OsGu0HRGEeGbA9TcuN7qCA"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_Qr9GsnRGEeGbA9TcuN7qCA"/>
+ </children>
+ <children xmi:type="notation:Node" xmi:id="_VwR8MHRGEeGbA9TcuN7qCA" type="shape_sysml_part_as_label">
+ <styles xmi:type="notation:ShapeStyle" xmi:id="_VwR8MXRGEeGbA9TcuN7qCA" fontName="Segoe UI" fillColor="0" lineColor="0"/>
+ <element xmi:type="uml:Property" href="ModelWithBDD.uml#_UirgoHRGEeGbA9TcuN7qCA"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_VwR8MnRGEeGbA9TcuN7qCA"/>
+ </children>
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_EAZaEXRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_EAZaEnRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_EAZaE3RGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_EAZaFHRGEeGbA9TcuN7qCA"/>
+ </children>
+ <children xmi:type="notation:ListCompartment" xmi:id="_EAZaFXRGEeGbA9TcuN7qCA" visible="false" type="compartment_sysml_part_as_list" showTitle="true">
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_EAZaFnRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_EAZaF3RGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_EAZaGHRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_EAZaGXRGEeGbA9TcuN7qCA"/>
+ </children>
+ <children xmi:type="notation:ListCompartment" xmi:id="_EAaBIHRGEeGbA9TcuN7qCA" visible="false" type="compartment_sysml_reference_as_list" showTitle="true">
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_EAaBIXRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_EAaBInRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_EAaBI3RGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_EAaBJHRGEeGbA9TcuN7qCA"/>
+ </children>
+ <children xmi:type="notation:ListCompartment" xmi:id="_EAaBJXRGEeGbA9TcuN7qCA" visible="false" type="compartment_uml_port_as_list" showTitle="true">
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_EAaBJnRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_EAaBJ3RGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_EAaBKHRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_EAaBKXRGEeGbA9TcuN7qCA"/>
+ </children>
+ <children xmi:type="notation:ListCompartment" xmi:id="_EAaBKnRGEeGbA9TcuN7qCA" visible="false" type="compartment_sysml_flowport_as_list" showTitle="true">
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_EAaBK3RGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_EAaBLHRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_EAaBLXRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_EAaBLnRGEeGbA9TcuN7qCA"/>
+ </children>
+ <children xmi:type="notation:ListCompartment" xmi:id="_EAaoMHRGEeGbA9TcuN7qCA" type="compartment_uml_operation_as_list" showTitle="true">
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_EAaoMXRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_EAaoMnRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_EAaoM3RGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_EAaoNHRGEeGbA9TcuN7qCA"/>
+ </children>
+ <children xmi:type="notation:ListCompartment" xmi:id="_EAaoNXRGEeGbA9TcuN7qCA" type="compartment_sysml_constraint_as_list" showTitle="true">
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_EAaoNnRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_EAaoN3RGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_EAaoOHRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_EAaoOXRGEeGbA9TcuN7qCA"/>
+ </children>
+ <children xmi:type="notation:ListCompartment" xmi:id="_EAaoOnRGEeGbA9TcuN7qCA" visible="false" type="compartment_sysml_value_as_list" showTitle="true">
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_EAaoO3RGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_EAaoPHRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_EAaoPXRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_EAaoPnRGEeGbA9TcuN7qCA"/>
+ </children>
+ <element xmi:type="uml:Class" href="ModelWithBDD.uml#__OVZQHRFEeGbA9TcuN7qCA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_EAXk4XRGEeGbA9TcuN7qCA" x="160" y="90" width="100" height="150"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_EApRsHRGEeGbA9TcuN7qCA" type="shape_sysml_block_as_classifier" fontName="Segoe UI" lineColor="0">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_EAsVAHRGEeGbA9TcuN7qCA" source="ShadowFigure">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_EAsVAXRGEeGbA9TcuN7qCA" key="ShadowFigure_Value" value="false"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_EAsVAnRGEeGbA9TcuN7qCA" source="displayNameLabelIcon">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_EAsVA3RGEeGbA9TcuN7qCA" key="displayNameLabelIcon_value" value="false"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_EAsVBHRGEeGbA9TcuN7qCA" source="QualifiedName">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_EAsVBXRGEeGbA9TcuN7qCA" key="QualifiedNameDepth" value="1000"/>
+ </eAnnotations>
+ <children xmi:type="notation:DecorationNode" xmi:id="_EApRsnRGEeGbA9TcuN7qCA" type="label_sysml_block_name"/>
+ <children xmi:type="notation:ListCompartment" xmi:id="_EApRs3RGEeGbA9TcuN7qCA" type="compartment_sysml_property_as_list" showTitle="true">
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_EApRtHRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_EApRtXRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_EApRtnRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_EApRt3RGEeGbA9TcuN7qCA"/>
+ </children>
+ <children xmi:type="notation:ListCompartment" xmi:id="_EApRuHRGEeGbA9TcuN7qCA" visible="false" type="compartment_sysml_part_as_list" showTitle="true">
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_EApRuXRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_EApRunRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_EApRu3RGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_EApRvHRGEeGbA9TcuN7qCA"/>
+ </children>
+ <children xmi:type="notation:ListCompartment" xmi:id="_EAp4wHRGEeGbA9TcuN7qCA" visible="false" type="compartment_sysml_reference_as_list" showTitle="true">
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_EAp4wXRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_EAp4wnRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_EAp4w3RGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_EAp4xHRGEeGbA9TcuN7qCA"/>
+ </children>
+ <children xmi:type="notation:ListCompartment" xmi:id="_EAqf0HRGEeGbA9TcuN7qCA" visible="false" type="compartment_uml_port_as_list" showTitle="true">
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_EAqf0XRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_EAqf0nRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_EAqf03RGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_EAqf1HRGEeGbA9TcuN7qCA"/>
+ </children>
+ <children xmi:type="notation:ListCompartment" xmi:id="_EArG4HRGEeGbA9TcuN7qCA" visible="false" type="compartment_sysml_flowport_as_list" showTitle="true">
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_EArG4XRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_EArG4nRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_EArG43RGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_EArG5HRGEeGbA9TcuN7qCA"/>
+ </children>
+ <children xmi:type="notation:ListCompartment" xmi:id="_EArG5XRGEeGbA9TcuN7qCA" type="compartment_uml_operation_as_list" showTitle="true">
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_EArG5nRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_EArG53RGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_EArG6HRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_EArG6XRGEeGbA9TcuN7qCA"/>
+ </children>
+ <children xmi:type="notation:ListCompartment" xmi:id="_EArG6nRGEeGbA9TcuN7qCA" type="compartment_sysml_constraint_as_list" showTitle="true">
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_EArG63RGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_EArG7HRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_EArG7XRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_EArG7nRGEeGbA9TcuN7qCA"/>
+ </children>
+ <children xmi:type="notation:ListCompartment" xmi:id="_EArt8HRGEeGbA9TcuN7qCA" visible="false" type="compartment_sysml_value_as_list" showTitle="true">
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_EArt8XRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_EArt8nRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_EArt83RGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_EArt9HRGEeGbA9TcuN7qCA"/>
+ </children>
+ <element xmi:type="uml:Class" href="ModelWithBDD.uml#_CqW0MHRGEeGbA9TcuN7qCA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_EApRsXRGEeGbA9TcuN7qCA" x="320" y="90" width="100" height="150"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_E9mCIHRGEeGbA9TcuN7qCA" type="2007" fontName="Segoe UI" lineColor="0">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_E9mpMHRGEeGbA9TcuN7qCA" source="ShadowFigure">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_E9mpMXRGEeGbA9TcuN7qCA" key="ShadowFigure_Value" value="false"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_E9mpMnRGEeGbA9TcuN7qCA" source="displayNameLabelIcon">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_E9mpM3RGEeGbA9TcuN7qCA" key="displayNameLabelIcon_value" value="false"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_E9mpNHRGEeGbA9TcuN7qCA" source="QualifiedName">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_E9nQQHRGEeGbA9TcuN7qCA" key="QualifiedNameDepth" value="1000"/>
+ </eAnnotations>
+ <children xmi:type="notation:DecorationNode" xmi:id="_E9nQQXRGEeGbA9TcuN7qCA" type="5026"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_E9nQQnRGEeGbA9TcuN7qCA" type="7016">
+ <children xmi:type="notation:Shape" xmi:id="_Id45EHRGEeGbA9TcuN7qCA" type="shape_sysml_block_as_classifier" fontName="Segoe UI" lineColor="0">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_Id7VUHRGEeGbA9TcuN7qCA" source="ShadowFigure">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_Id7VUXRGEeGbA9TcuN7qCA" key="ShadowFigure_Value" value="false"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_Id78YHRGEeGbA9TcuN7qCA" source="displayNameLabelIcon">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_Id78YXRGEeGbA9TcuN7qCA" key="displayNameLabelIcon_value" value="false"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_Id78YnRGEeGbA9TcuN7qCA" source="QualifiedName">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_Id78Y3RGEeGbA9TcuN7qCA" key="QualifiedNameDepth" value="1000"/>
+ </eAnnotations>
+ <children xmi:type="notation:DecorationNode" xmi:id="_Id5gIHRGEeGbA9TcuN7qCA" type="label_sysml_block_name"/>
+ <children xmi:type="notation:ListCompartment" xmi:id="_Id5gIXRGEeGbA9TcuN7qCA" type="compartment_sysml_property_as_list" showTitle="true">
+ <children xmi:type="notation:Node" xmi:id="_bSg1sHRGEeGbA9TcuN7qCA" type="shape_sysml_part_as_label">
+ <styles xmi:type="notation:ShapeStyle" xmi:id="_bSg1sXRGEeGbA9TcuN7qCA" fontName="Segoe UI" fillColor="0" lineColor="0"/>
+ <element xmi:type="uml:Property" href="ModelWithBDD.uml#_aSF6gHRGEeGbA9TcuN7qCA"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_bSg1snRGEeGbA9TcuN7qCA"/>
+ </children>
+ <children xmi:type="notation:Node" xmi:id="_dcrnMHRGEeGbA9TcuN7qCA" type="shape_sysml_part_as_label">
+ <styles xmi:type="notation:ShapeStyle" xmi:id="_dcrnMXRGEeGbA9TcuN7qCA" fontName="Segoe UI" fillColor="0" lineColor="0"/>
+ <element xmi:type="uml:Property" href="ModelWithBDD.uml#_b7tjsHRGEeGbA9TcuN7qCA"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_dcrnMnRGEeGbA9TcuN7qCA"/>
+ </children>
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_Id5gInRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_Id5gI3RGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_Id5gJHRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_Id5gJXRGEeGbA9TcuN7qCA"/>
+ </children>
+ <children xmi:type="notation:ListCompartment" xmi:id="_Id5gJnRGEeGbA9TcuN7qCA" visible="false" type="compartment_sysml_part_as_list" showTitle="true">
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_Id5gJ3RGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_Id5gKHRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_Id5gKXRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_Id5gKnRGEeGbA9TcuN7qCA"/>
+ </children>
+ <children xmi:type="notation:ListCompartment" xmi:id="_Id6HMHRGEeGbA9TcuN7qCA" visible="false" type="compartment_sysml_reference_as_list" showTitle="true">
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_Id6HMXRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_Id6HMnRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_Id6HM3RGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_Id6HNHRGEeGbA9TcuN7qCA"/>
+ </children>
+ <children xmi:type="notation:ListCompartment" xmi:id="_Id6HNXRGEeGbA9TcuN7qCA" visible="false" type="compartment_uml_port_as_list" showTitle="true">
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_Id6HNnRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_Id6HN3RGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_Id6HOHRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_Id6HOXRGEeGbA9TcuN7qCA"/>
+ </children>
+ <children xmi:type="notation:ListCompartment" xmi:id="_Id6HOnRGEeGbA9TcuN7qCA" visible="false" type="compartment_sysml_flowport_as_list" showTitle="true">
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_Id6HO3RGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_Id6HPHRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_Id6HPXRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_Id6HPnRGEeGbA9TcuN7qCA"/>
+ </children>
+ <children xmi:type="notation:ListCompartment" xmi:id="_Id6uQHRGEeGbA9TcuN7qCA" type="compartment_uml_operation_as_list" showTitle="true">
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_Id6uQXRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_Id6uQnRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_Id6uQ3RGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_Id6uRHRGEeGbA9TcuN7qCA"/>
+ </children>
+ <children xmi:type="notation:ListCompartment" xmi:id="_Id6uRXRGEeGbA9TcuN7qCA" type="compartment_sysml_constraint_as_list" showTitle="true">
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_Id6uRnRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_Id6uR3RGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_Id6uSHRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_Id6uSXRGEeGbA9TcuN7qCA"/>
+ </children>
+ <children xmi:type="notation:ListCompartment" xmi:id="_Id6uSnRGEeGbA9TcuN7qCA" visible="false" type="compartment_sysml_value_as_list" showTitle="true">
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_Id6uS3RGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_Id6uTHRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_Id6uTXRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_Id6uTnRGEeGbA9TcuN7qCA"/>
+ </children>
+ <element xmi:type="uml:Class" href="ModelWithBDD.uml#_Idw9QHRGEeGbA9TcuN7qCA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Id45EXRGEeGbA9TcuN7qCA" x="80" y="28" width="161" height="171"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_K5agUHRGEeGbA9TcuN7qCA" type="shape_sysml_block_as_classifier" fontName="Segoe UI" lineColor="0">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_K5djoHRGEeGbA9TcuN7qCA" source="ShadowFigure">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_K5djoXRGEeGbA9TcuN7qCA" key="ShadowFigure_Value" value="false"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_K5djonRGEeGbA9TcuN7qCA" source="displayNameLabelIcon">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_K5djo3RGEeGbA9TcuN7qCA" key="displayNameLabelIcon_value" value="false"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_K5djpHRGEeGbA9TcuN7qCA" source="QualifiedName">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_K5djpXRGEeGbA9TcuN7qCA" key="QualifiedNameDepth" value="1000"/>
+ </eAnnotations>
+ <children xmi:type="notation:DecorationNode" xmi:id="_K5agUnRGEeGbA9TcuN7qCA" type="label_sysml_block_name"/>
+ <children xmi:type="notation:ListCompartment" xmi:id="_K5agU3RGEeGbA9TcuN7qCA" type="compartment_sysml_property_as_list" showTitle="true">
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_K5agVHRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_K5agVXRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_K5agVnRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_K5agV3RGEeGbA9TcuN7qCA"/>
+ </children>
+ <children xmi:type="notation:ListCompartment" xmi:id="_K5agWHRGEeGbA9TcuN7qCA" visible="false" type="compartment_sysml_part_as_list" showTitle="true">
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_K5agWXRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_K5agWnRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_K5agW3RGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_K5agXHRGEeGbA9TcuN7qCA"/>
+ </children>
+ <children xmi:type="notation:ListCompartment" xmi:id="_K5agXXRGEeGbA9TcuN7qCA" visible="false" type="compartment_sysml_reference_as_list" showTitle="true">
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_K5agXnRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_K5agX3RGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_K5agYHRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_K5agYXRGEeGbA9TcuN7qCA"/>
+ </children>
+ <children xmi:type="notation:ListCompartment" xmi:id="_K5agYnRGEeGbA9TcuN7qCA" visible="false" type="compartment_uml_port_as_list" showTitle="true">
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_K5agY3RGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_K5agZHRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_K5agZXRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_K5agZnRGEeGbA9TcuN7qCA"/>
+ </children>
+ <children xmi:type="notation:ListCompartment" xmi:id="_K5agZ3RGEeGbA9TcuN7qCA" visible="false" type="compartment_sysml_flowport_as_list" showTitle="true">
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_K5agaHRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_K5agaXRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_K5aganRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_K5aga3RGEeGbA9TcuN7qCA"/>
+ </children>
+ <children xmi:type="notation:ListCompartment" xmi:id="_K5agbHRGEeGbA9TcuN7qCA" type="compartment_uml_operation_as_list" showTitle="true">
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_K5agbXRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_K5agbnRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_K5agb3RGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_K5agcHRGEeGbA9TcuN7qCA"/>
+ </children>
+ <children xmi:type="notation:ListCompartment" xmi:id="_K5agcXRGEeGbA9TcuN7qCA" type="compartment_sysml_constraint_as_list" showTitle="true">
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_K5agcnRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_K5agc3RGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_K5agdHRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_K5agdXRGEeGbA9TcuN7qCA"/>
+ </children>
+ <children xmi:type="notation:ListCompartment" xmi:id="_K5agdnRGEeGbA9TcuN7qCA" visible="false" type="compartment_sysml_value_as_list" showTitle="true">
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_K5agd3RGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_K5ageHRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_K5ageXRGEeGbA9TcuN7qCA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_K5agenRGEeGbA9TcuN7qCA"/>
+ </children>
+ <element xmi:type="uml:Class" href="ModelWithBDD.uml#_K5RWYHRGEeGbA9TcuN7qCA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_K5agUXRGEeGbA9TcuN7qCA" x="335" y="34" width="100" height="150"/>
+ </children>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_E9nQQ3RGEeGbA9TcuN7qCA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_E9nQRHRGEeGbA9TcuN7qCA"/>
+ </children>
+ <element xmi:type="uml:Package" href="ModelWithBDD.uml#_E8hEEHRGEeGbA9TcuN7qCA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_E9mCIXRGEeGbA9TcuN7qCA" x="470" y="45" width="606" height="251"/>
+ </children>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_LXISYZdgEeCIWccnqNjPug"/>
+ <element xmi:type="uml:Model" href="ModelWithBDD.uml#_UV0P8EAREeCMpNWxgNcrog"/>
+</notation:Diagram>
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/model/ModelWithBDD.uml b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/model/ModelWithBDD.uml
new file mode 100644
index 00000000000..66c3b3cfd98
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/model/ModelWithBDD.uml
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:Blocks="http://www.eclipse.org/papyrus/0.7.0/SysML/Blocks" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/3.0.0/UML" xsi:schemaLocation="http://www.eclipse.org/papyrus/0.7.0/SysML/Blocks http://www.eclipse.org/papyrus/0.7.0/SysML#//blocks">
+ <uml:Model xmi:id="_UV0P8EAREeCMpNWxgNcrog" name="model">
+ <packagedElement xmi:type="uml:Class" xmi:id="__OVZQHRFEeGbA9TcuN7qCA" name="B1">
+ <ownedAttribute xmi:id="_OsGu0HRGEeGbA9TcuN7qCA" name="pB2" type="_CqW0MHRGEeGbA9TcuN7qCA" aggregation="composite" association="_QqfHEHRGEeGbA9TcuN7qCA">
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_Qqcq0HRGEeGbA9TcuN7qCA" value="1"/>
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_QqcDwHRGEeGbA9TcuN7qCA" value="1"/>
+ </ownedAttribute>
+ <ownedAttribute xmi:id="_UirgoHRGEeGbA9TcuN7qCA" name="pB1P1" type="_Idw9QHRGEeGbA9TcuN7qCA" aggregation="composite" association="_VwHkIXRGEeGbA9TcuN7qCA">
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_VwHkIHRGEeGbA9TcuN7qCA" value="1"/>
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_VwG9EHRGEeGbA9TcuN7qCA" value="1"/>
+ </ownedAttribute>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Class" xmi:id="_CqW0MHRGEeGbA9TcuN7qCA" name="B2"/>
+ <packagedElement xmi:type="uml:Package" xmi:id="_E8hEEHRGEeGbA9TcuN7qCA" name="P1">
+ <packagedElement xmi:type="uml:Class" xmi:id="_Idw9QHRGEeGbA9TcuN7qCA" name="B1P1">
+ <ownedAttribute xmi:id="_aSF6gHRGEeGbA9TcuN7qCA" name="pB1" type="__OVZQHRFEeGbA9TcuN7qCA" aggregation="composite" association="_bSZg8HRGEeGbA9TcuN7qCA">
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_bSY54HRGEeGbA9TcuN7qCA" value="1"/>
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_bSYS0HRGEeGbA9TcuN7qCA" value="1"/>
+ </ownedAttribute>
+ <ownedAttribute xmi:id="_b7tjsHRGEeGbA9TcuN7qCA" name="pB2P1" type="_K5RWYHRGEeGbA9TcuN7qCA" aggregation="composite" association="_dclgkHRGEeGbA9TcuN7qCA">
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_dck5gHRGEeGbA9TcuN7qCA" value="1"/>
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_dckScHRGEeGbA9TcuN7qCA" value="1"/>
+ </ownedAttribute>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Class" xmi:id="_K5RWYHRGEeGbA9TcuN7qCA" name="B2P1"/>
+ <packagedElement xmi:type="uml:Association" xmi:id="_bSZg8HRGEeGbA9TcuN7qCA" name="Association1" memberEnd="_aSF6gHRGEeGbA9TcuN7qCA _bSZg83RGEeGbA9TcuN7qCA">
+ <eAnnotations xmi:id="_bSZg8XRGEeGbA9TcuN7qCA" source="org.eclipse.papyrus">
+ <details xmi:id="_bSZg8nRGEeGbA9TcuN7qCA" key="nature" value="SysML_Nature"/>
+ </eAnnotations>
+ <ownedEnd xmi:id="_bSZg83RGEeGbA9TcuN7qCA" name="" type="_Idw9QHRGEeGbA9TcuN7qCA" association="_bSZg8HRGEeGbA9TcuN7qCA"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Association" xmi:id="_dclgkHRGEeGbA9TcuN7qCA" name="Association2" memberEnd="_b7tjsHRGEeGbA9TcuN7qCA _dclgk3RGEeGbA9TcuN7qCA">
+ <eAnnotations xmi:id="_dclgkXRGEeGbA9TcuN7qCA" source="org.eclipse.papyrus">
+ <details xmi:id="_dclgknRGEeGbA9TcuN7qCA" key="nature" value="SysML_Nature"/>
+ </eAnnotations>
+ <ownedEnd xmi:id="_dclgk3RGEeGbA9TcuN7qCA" name="" type="_Idw9QHRGEeGbA9TcuN7qCA" association="_dclgkHRGEeGbA9TcuN7qCA"/>
+ </packagedElement>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Association" xmi:id="_QqfHEHRGEeGbA9TcuN7qCA" name="Association1" memberEnd="_OsGu0HRGEeGbA9TcuN7qCA _QqfHE3RGEeGbA9TcuN7qCA">
+ <eAnnotations xmi:id="_QqfHEXRGEeGbA9TcuN7qCA" source="org.eclipse.papyrus">
+ <details xmi:id="_QqfHEnRGEeGbA9TcuN7qCA" key="nature" value="SysML_Nature"/>
+ </eAnnotations>
+ <ownedEnd xmi:id="_QqfHE3RGEeGbA9TcuN7qCA" name="" type="__OVZQHRFEeGbA9TcuN7qCA" association="_QqfHEHRGEeGbA9TcuN7qCA"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Association" xmi:id="_VwHkIXRGEeGbA9TcuN7qCA" name="Association2" memberEnd="_UirgoHRGEeGbA9TcuN7qCA _VwILMnRGEeGbA9TcuN7qCA">
+ <eAnnotations xmi:id="_VwILMHRGEeGbA9TcuN7qCA" source="org.eclipse.papyrus">
+ <details xmi:id="_VwILMXRGEeGbA9TcuN7qCA" key="nature" value="SysML_Nature"/>
+ </eAnnotations>
+ <ownedEnd xmi:id="_VwILMnRGEeGbA9TcuN7qCA" name="" type="__OVZQHRFEeGbA9TcuN7qCA" association="_VwHkIXRGEeGbA9TcuN7qCA"/>
+ </packagedElement>
+ <profileApplication xmi:id="_sT65AJdfEeCIWccnqNjPug">
+ <eAnnotations xmi:id="_sUNz8JdfEeCIWccnqNjPug" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/papyrus/0.7.0/SysML#/"/>
+ </eAnnotations>
+ <appliedProfile href="pathmap://SysML_PROFILES/SysML.profile.uml#_TZ_nULU5EduiKqCzJMWbGw"/>
+ </profileApplication>
+ <profileApplication xmi:id="_sUNz8ZdfEeCIWccnqNjPug">
+ <eAnnotations xmi:id="_sUNz8pdfEeCIWccnqNjPug" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/papyrus/0.7.0/SysML#//modelelements"/>
+ </eAnnotations>
+ <appliedProfile href="pathmap://SysML_PROFILES/SysML.profile.uml#_Gx8MgLX7EduFmqQsrNB9lw"/>
+ </profileApplication>
+ <profileApplication xmi:id="_sUNz85dfEeCIWccnqNjPug">
+ <eAnnotations xmi:id="_sUNz9JdfEeCIWccnqNjPug" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/papyrus/0.7.0/SysML#//blocks"/>
+ </eAnnotations>
+ <appliedProfile href="pathmap://SysML_PROFILES/SysML.profile.uml#_fSw28LX7EduFmqQsrNB9lw"/>
+ </profileApplication>
+ <profileApplication xmi:id="_sUNz9ZdfEeCIWccnqNjPug">
+ <eAnnotations xmi:id="_sUNz9pdfEeCIWccnqNjPug" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/papyrus/0.7.0/SysML#//portandflows"/>
+ </eAnnotations>
+ <appliedProfile href="pathmap://SysML_PROFILES/SysML.profile.uml#_rpx28LX7EduFmqQsrNB9lw"/>
+ </profileApplication>
+ <profileApplication xmi:id="_sUNz95dfEeCIWccnqNjPug">
+ <eAnnotations xmi:id="_sUNz-JdfEeCIWccnqNjPug" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/papyrus/0.7.0/SysML#//constraints"/>
+ </eAnnotations>
+ <appliedProfile href="pathmap://SysML_PROFILES/SysML.profile.uml#_5WYJ0LX7EduFmqQsrNB9lw"/>
+ </profileApplication>
+ <profileApplication xmi:id="_sUNz-ZdfEeCIWccnqNjPug">
+ <eAnnotations xmi:id="_sUNz-pdfEeCIWccnqNjPug" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/papyrus/0.7.0/SysML#//activities"/>
+ </eAnnotations>
+ <appliedProfile href="pathmap://SysML_PROFILES/SysML.profile.uml#_C2zXMLX8EduFmqQsrNB9lw"/>
+ </profileApplication>
+ <profileApplication xmi:id="_sUNz-5dfEeCIWccnqNjPug">
+ <eAnnotations xmi:id="_sUNz_JdfEeCIWccnqNjPug" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/papyrus/0.7.0/SysML#//allocations"/>
+ </eAnnotations>
+ <appliedProfile href="pathmap://SysML_PROFILES/SysML.profile.uml#_NxdG4LX8EduFmqQsrNB9lw"/>
+ </profileApplication>
+ <profileApplication xmi:id="_sUNz_ZdfEeCIWccnqNjPug">
+ <eAnnotations xmi:id="_sUNz_pdfEeCIWccnqNjPug" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/papyrus/0.7.0/SysML#//requirements"/>
+ </eAnnotations>
+ <appliedProfile href="pathmap://SysML_PROFILES/SysML.profile.uml#_OOJC4LX8EduFmqQsrNB9lw"/>
+ </profileApplication>
+ <profileApplication xmi:id="_sUNz_5dfEeCIWccnqNjPug">
+ <eAnnotations xmi:id="_sUN0AJdfEeCIWccnqNjPug" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/papyrus/0.7.0/SysML#//interactions"/>
+ </eAnnotations>
+ <appliedProfile href="pathmap://SysML_PROFILES/SysML.profile.uml#_meOioLX8EduFmqQsrNB9lw"/>
+ </profileApplication>
+ <profileApplication xmi:id="_sUN0AZdfEeCIWccnqNjPug">
+ <eAnnotations xmi:id="_sUN0ApdfEeCIWccnqNjPug" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/papyrus/0.7.0/SysML#//statemachines"/>
+ </eAnnotations>
+ <appliedProfile href="pathmap://SysML_PROFILES/SysML.profile.uml#_nAF5kLX8EduFmqQsrNB9lw"/>
+ </profileApplication>
+ <profileApplication xmi:id="_sUN0A5dfEeCIWccnqNjPug">
+ <eAnnotations xmi:id="_sUN0BJdfEeCIWccnqNjPug" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/papyrus/0.7.0/SysML#//usecases"/>
+ </eAnnotations>
+ <appliedProfile href="pathmap://SysML_PROFILES/SysML.profile.uml#_neZmMLX8EduFmqQsrNB9lw"/>
+ </profileApplication>
+ </uml:Model>
+ <Blocks:Block xmi:id="__SrtwHRFEeGbA9TcuN7qCA" base_Class="__OVZQHRFEeGbA9TcuN7qCA"/>
+ <Blocks:Block xmi:id="_CqaekHRGEeGbA9TcuN7qCA" base_Class="_CqW0MHRGEeGbA9TcuN7qCA"/>
+ <Blocks:Block xmi:id="_IdzZgHRGEeGbA9TcuN7qCA" base_Class="_Idw9QHRGEeGbA9TcuN7qCA"/>
+ <Blocks:Block xmi:id="_K5UZsHRGEeGbA9TcuN7qCA" base_Class="_K5RWYHRGEeGbA9TcuN7qCA"/>
+</xmi:XMI>
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/model/SysMLModelExplorerCopyPasteTestModel.di b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/model/SysMLModelExplorerCopyPasteTestModel.di
new file mode 100644
index 00000000000..4dad1416737
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/model/SysMLModelExplorerCopyPasteTestModel.di
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="ASCII"?>
+<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">
+ <pageList>
+ <availablePage>
+ <emfPageIdentifier href="SysMLModelExplorerCopyPasteTestModel.notation#_TmNkwHpOEeGpML05YPbTgg"/>
+ </availablePage>
+ <availablePage>
+ <emfPageIdentifier href="SysMLModelExplorerCopyPasteTestModel.notation#_skVUkHphEeGr6LTFg6LEhg"/>
+ </availablePage>
+ <availablePage>
+ <emfPageIdentifier href="SysMLModelExplorerCopyPasteTestModel.notation#_ByR8IH2bEeGYcfVa7z8CyQ"/>
+ </availablePage>
+ </pageList>
+ <sashModel currentSelection="//@sashModel/@windows.0/@children.0">
+ <windows>
+ <children xsi:type="di:TabFolder">
+ <children>
+ <emfPageIdentifier href="SysMLModelExplorerCopyPasteTestModel.notation#_TmNkwHpOEeGpML05YPbTgg"/>
+ </children>
+ <children>
+ <emfPageIdentifier href="SysMLModelExplorerCopyPasteTestModel.notation#_skVUkHphEeGr6LTFg6LEhg"/>
+ </children>
+ <children>
+ <emfPageIdentifier href="SysMLModelExplorerCopyPasteTestModel.notation#_ByR8IH2bEeGYcfVa7z8CyQ"/>
+ </children>
+ </children>
+ </windows>
+ </sashModel>
+</di:SashWindowsMngr>
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/model/SysMLModelExplorerCopyPasteTestModel.notation b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/model/SysMLModelExplorerCopyPasteTestModel.notation
new file mode 100644
index 00000000000..b15584e1a7e
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/model/SysMLModelExplorerCopyPasteTestModel.notation
@@ -0,0 +1,200 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI 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:uml="http://www.eclipse.org/uml2/3.0.0/UML">
+ <notation:Diagram xmi:id="_TmNkwHpOEeGpML05YPbTgg" type="PapyrusUMLClassDiagram" name="Main" measurementUnit="Pixel">
+ <children xmi:type="notation:Shape" xmi:id="_xYbnoHpfEeGr6LTFg6LEhg" type="2005" fontName="Segoe UI" fillColor="15053796" gradient="16777215, 16777215, 0" lineColor="0">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_xYeq8HpfEeGr6LTFg6LEhg" source="ShadowFigure">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_xYeq8XpfEeGr6LTFg6LEhg" key="ShadowFigure_Value" value="false"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_xYhuQHpfEeGr6LTFg6LEhg" source="displayNameLabelIcon">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_xYhuQXpfEeGr6LTFg6LEhg" key="displayNameLabelIcon_value" value="false"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_xYhuQnpfEeGr6LTFg6LEhg" source="QualifiedName">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_xYhuQ3pfEeGr6LTFg6LEhg" key="QualifiedNameDepth" value="1000"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_zuW9MHpfEeGr6LTFg6LEhg" source="Stereotype_Annotation">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_hCGc8HpgEeGr6LTFg6LEhg" key="StereotypeWithQualifiedNameList" value=""/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_hCGc8XpgEeGr6LTFg6LEhg" key="StereotypeList" value=""/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_hCGc8npgEeGr6LTFg6LEhg" key="Stereotype_Presentation_Kind" value="HorizontalStereo"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_hCGc83pgEeGr6LTFg6LEhg" key="PropStereoDisplay" value="ModelExplorerTest::TestModel.sourceModel"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_hCGc9HpgEeGr6LTFg6LEhg" key="StereotypePropertyLocation" value="Compartment"/>
+ </eAnnotations>
+ <children xmi:type="notation:DecorationNode" xmi:id="_xYhuRHpfEeGr6LTFg6LEhg" type="5020"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_xYhuRXpfEeGr6LTFg6LEhg" type="7009">
+ <children xmi:type="notation:Shape" xmi:id="_lM1_EHpgEeGr6LTFg6LEhg" type="3009" fontName="Segoe UI" fillColor="12621752" gradient="16777215, 16777215, 0" lineColor="0">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_lM1_EnpgEeGr6LTFg6LEhg" source="ShadowFigure">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_lM1_E3pgEeGr6LTFg6LEhg" key="ShadowFigure_Value" value="false"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_lM5CYHpgEeGr6LTFg6LEhg" source="displayNameLabelIcon">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_lM5CYXpgEeGr6LTFg6LEhg" key="displayNameLabelIcon_value" value="false"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_lM5CYnpgEeGr6LTFg6LEhg" source="QualifiedName">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_lM5CY3pgEeGr6LTFg6LEhg" key="QualifiedNameDepth" value="1000"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_pig-0HpgEeGr6LTFg6LEhg" source="Stereotype_Annotation">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_VJbwYHphEeGr6LTFg6LEhg" key="StereotypeWithQualifiedNameList" value=""/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_VJbwYXphEeGr6LTFg6LEhg" key="StereotypeList" value="ModelExplorerTest::ElementTypeRulesCopyPasteTest"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_VJbwYnphEeGr6LTFg6LEhg" key="Stereotype_Presentation_Kind" value="HorizontalStereo"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_VJbwY3phEeGr6LTFg6LEhg" key="PropStereoDisplay" value="ModelExplorerTest::ElementTypeRulesCopyPasteTest.elementType,ModelExplorerTest::ElementTypeRulesCopyPasteTest.preCopyInitialization,ModelExplorerTest::ElementTypeRulesCopyPasteTest.postCopyRule"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_VJbwZHphEeGr6LTFg6LEhg" key="StereotypePropertyLocation" value="Compartment"/>
+ </eAnnotations>
+ <children xmi:type="notation:DecorationNode" xmi:id="_lM5CZHpgEeGr6LTFg6LEhg" type="5017"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_lM5CZXpgEeGr6LTFg6LEhg" type="7010">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_lM5CZnpgEeGr6LTFg6LEhg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_lM5CZ3pgEeGr6LTFg6LEhg"/>
+ </children>
+ <element xmi:type="uml:Package" href="SysMLModelExplorerCopyPasteTestModel.uml#_lLOOcHpgEeGr6LTFg6LEhg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_lM1_EXpgEeGr6LTFg6LEhg" x="15" y="7" width="575" height="229"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_Eh9ZAH2cEeGYcfVa7z8CyQ" type="3009" fontName="Segoe UI" lineColor="0">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_Eh9ZAn2cEeGYcfVa7z8CyQ" source="ShadowFigure">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_Eh9ZA32cEeGYcfVa7z8CyQ" key="ShadowFigure_Value" value="false"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_Eh9ZBH2cEeGYcfVa7z8CyQ" source="displayNameLabelIcon">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_Eh9ZBX2cEeGYcfVa7z8CyQ" key="displayNameLabelIcon_value" value="false"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_Eh9ZBn2cEeGYcfVa7z8CyQ" source="QualifiedName">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_Eh9ZB32cEeGYcfVa7z8CyQ" key="QualifiedNameDepth" value="1000"/>
+ </eAnnotations>
+ <children xmi:type="notation:DecorationNode" xmi:id="_Eh9ZCH2cEeGYcfVa7z8CyQ" type="5017"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_Eh9ZCX2cEeGYcfVa7z8CyQ" type="7010">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_Eh9ZCn2cEeGYcfVa7z8CyQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Eh9ZC32cEeGYcfVa7z8CyQ"/>
+ </children>
+ <element xmi:type="uml:Package" href="SysMLModelExplorerCopyPasteTestModel.uml#_v-7hMH2YEeGYcfVa7z8CyQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Eh9ZAX2cEeGYcfVa7z8CyQ" x="15" y="262"/>
+ </children>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_xYhuRnpfEeGr6LTFg6LEhg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_xYhuR3pfEeGr6LTFg6LEhg"/>
+ </children>
+ <element xmi:type="uml:Model" href="SysMLModelExplorerCopyPasteTestModel.uml#_Tj4CcHpOEeGpML05YPbTgg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_xYbnoXpfEeGr6LTFg6LEhg" x="5" y="10" width="762" height="562"/>
+ </children>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_TmNkwXpOEeGpML05YPbTgg"/>
+ <element xmi:type="uml:Model" href="SysMLModelExplorerCopyPasteTestModel.uml#_Tj4CcHpOEeGpML05YPbTgg"/>
+ </notation:Diagram>
+ <notation:Diagram xmi:id="_skVUkHphEeGr6LTFg6LEhg" type="PapyrusUMLClassDiagram" name="SysML_Part_MainDiagram" measurementUnit="Pixel">
+ <children xmi:type="notation:Shape" xmi:id="_tT-BwHphEeGr6LTFg6LEhg" type="2008" fontName="Segoe UI" fillColor="12560536" gradient="16777215, 16777215, 0" lineColor="0">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_tT-BwnphEeGr6LTFg6LEhg" source="ShadowFigure">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_tT-Bw3phEeGr6LTFg6LEhg" key="ShadowFigure_Value" value="false"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_tT-BxHphEeGr6LTFg6LEhg" source="displayNameLabelIcon">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_tT-BxXphEeGr6LTFg6LEhg" key="displayNameLabelIcon_value" value="false"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_tUBFEHphEeGr6LTFg6LEhg" source="QualifiedName">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_tUBFEXphEeGr6LTFg6LEhg" key="QualifiedNameDepth" value="1000"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_z6gQ4HphEeGr6LTFg6LEhg" source="Stereotype_Annotation">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_z6gQ4XphEeGr6LTFg6LEhg" key="StereotypeWithQualifiedNameList" value=""/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_z6gQ4nphEeGr6LTFg6LEhg" key="StereotypeList" value="ModelExplorerTest::SourceTargetRulesCopyPasteTest"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_z6gQ43phEeGr6LTFg6LEhg" key="Stereotype_Presentation_Kind" value="HorizontalStereo"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_z6gQ5HphEeGr6LTFg6LEhg" key="PropStereoDisplay" value=""/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_z6gQ5XphEeGr6LTFg6LEhg" key="StereotypePropertyLocation" value="Compartment"/>
+ </eAnnotations>
+ <children xmi:type="notation:DecorationNode" xmi:id="_tUBFEnphEeGr6LTFg6LEhg" type="5029"/>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_tUBFE3phEeGr6LTFg6LEhg" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_tUBFFHphEeGr6LTFg6LEhg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_tUBFFXphEeGr6LTFg6LEhg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_tUBFFnphEeGr6LTFg6LEhg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_tUBFF3phEeGr6LTFg6LEhg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_tUBFGHphEeGr6LTFg6LEhg" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_tUBFGXphEeGr6LTFg6LEhg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_tUBFGnphEeGr6LTFg6LEhg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_tUBFG3phEeGr6LTFg6LEhg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_tUBFHHphEeGr6LTFg6LEhg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_tUBFHXphEeGr6LTFg6LEhg" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_tUBFHnphEeGr6LTFg6LEhg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_tUBFH3phEeGr6LTFg6LEhg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_tUBFIHphEeGr6LTFg6LEhg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_tUBFIXphEeGr6LTFg6LEhg"/>
+ </children>
+ <element xmi:type="uml:Class" href="SysMLModelExplorerCopyPasteTestModel.uml#_tT030HphEeGr6LTFg6LEhg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_tT-BwXphEeGr6LTFg6LEhg" x="50" y="45" width="241" height="221"/>
+ </children>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_skVUkXphEeGr6LTFg6LEhg"/>
+ <element xmi:type="uml:Package" href="SysMLModelExplorerCopyPasteTestModel.uml#_lLOOcHpgEeGr6LTFg6LEhg"/>
+ </notation:Diagram>
+ <notation:Diagram xmi:id="_ByR8IH2bEeGYcfVa7z8CyQ" type="PapyrusUMLClassDiagram" name="SysML_Block" measurementUnit="Pixel">
+ <children xmi:type="notation:Shape" xmi:id="_COZ3cH2bEeGYcfVa7z8CyQ" type="2008" fontName="Segoe UI" lineColor="0">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_COZ3cn2bEeGYcfVa7z8CyQ" source="ShadowFigure">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_COZ3c32bEeGYcfVa7z8CyQ" key="ShadowFigure_Value" value="false"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_COZ3dH2bEeGYcfVa7z8CyQ" source="displayNameLabelIcon">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_COZ3dX2bEeGYcfVa7z8CyQ" key="displayNameLabelIcon_value" value="false"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_COZ3dn2bEeGYcfVa7z8CyQ" source="QualifiedName">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_COZ3d32bEeGYcfVa7z8CyQ" key="QualifiedNameDepth" value="1000"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_H-xTkH2bEeGYcfVa7z8CyQ" source="Stereotype_Annotation">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_9f2PoIMWEeGU2YHAOvJrlg" key="StereotypeWithQualifiedNameList" value=""/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_9f2PoYMWEeGU2YHAOvJrlg" key="StereotypeList" value="ModelExplorerTest::SourceTargetRulesCopyPasteTest,ModelExplorerTest::SourceTargetRulesCopyPasteTest,ModelExplorerTest::SourceTargetRulesCopyPasteTest,ModelExplorerTest::SourceTargetRulesCopyPasteTest,ModelExplorerTest::SourceTargetRulesCopyPasteTest,ModelExplorerTest::SourceTargetRulesCopyPasteTest,ModelExplorerTest::SourceTargetRulesCopyPasteTest,ModelExplorerTest::SourceTargetRulesCopyPasteTest"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_9f2PooMWEeGU2YHAOvJrlg" key="PropStereoDisplay" value="ModelExplorerTest::SourceTargetRulesCopyPasteTest.targets,ModelExplorerTest::SourceTargetRulesCopyPasteTest.feature,ModelExplorerTest::SourceTargetRulesCopyPasteTest.preCopyInitialization,ModelExplorerTest::SourceTargetRulesCopyPasteTest.postCopyRule,ModelExplorerTest::SourceTargetRulesCopyPasteTest.postUndoRule,ModelExplorerTest::SourceTargetRulesCopyPasteTest.postRedoRule,ModelExplorerTest::SourceTargetRulesCopyPasteTest.isCopyRuleValidInRedo,ModelExplorerTest::SourceTargetRulesCopyPasteTest.canCopy,ModelExplorerTest::SourceTargetRulesCopyPasteTest.sourceElement,ModelExplorerTest::SourceTargetRulesCopyPasteTest.additionalElementsQuantity"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_9f2Po4MWEeGU2YHAOvJrlg" key="Stereotype_Presentation_Kind" value="HorizontalStereo"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_9f2PpIMWEeGU2YHAOvJrlg" key="StereotypePropertyLocation" value="Compartment"/>
+ </eAnnotations>
+ <children xmi:type="notation:DecorationNode" xmi:id="_COZ3eH2bEeGYcfVa7z8CyQ" type="5029"/>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_COZ3eX2bEeGYcfVa7z8CyQ" visible="false" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_COZ3en2bEeGYcfVa7z8CyQ"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_COZ3e32bEeGYcfVa7z8CyQ"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_COZ3fH2bEeGYcfVa7z8CyQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_COZ3fX2bEeGYcfVa7z8CyQ"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_COZ3fn2bEeGYcfVa7z8CyQ" visible="false" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_COZ3f32bEeGYcfVa7z8CyQ"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_COZ3gH2bEeGYcfVa7z8CyQ"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_COZ3gX2bEeGYcfVa7z8CyQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_COZ3gn2bEeGYcfVa7z8CyQ"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_COZ3g32bEeGYcfVa7z8CyQ" visible="false" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_COZ3hH2bEeGYcfVa7z8CyQ"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_COZ3hX2bEeGYcfVa7z8CyQ"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_COZ3hn2bEeGYcfVa7z8CyQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_COZ3h32bEeGYcfVa7z8CyQ"/>
+ </children>
+ <element xmi:type="uml:Class" href="SysMLModelExplorerCopyPasteTestModel.uml#_ReSXcH2aEeGYcfVa7z8CyQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_COZ3cX2bEeGYcfVa7z8CyQ" x="50" y="80" width="291" height="336"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_COjBYH2bEeGYcfVa7z8CyQ" type="2008" fontName="Segoe UI" lineColor="0">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_COjBYn2bEeGYcfVa7z8CyQ" source="ShadowFigure">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_COjBY32bEeGYcfVa7z8CyQ" key="ShadowFigure_Value" value="false"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_COjBZH2bEeGYcfVa7z8CyQ" source="displayNameLabelIcon">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_COjBZX2bEeGYcfVa7z8CyQ" key="displayNameLabelIcon_value" value="false"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_COjBZn2bEeGYcfVa7z8CyQ" source="QualifiedName">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_COjBZ32bEeGYcfVa7z8CyQ" key="QualifiedNameDepth" value="1000"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_J0Jg0H2bEeGYcfVa7z8CyQ" source="Stereotype_Annotation">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_8w1NgIMWEeGU2YHAOvJrlg" key="StereotypeWithQualifiedNameList" value=""/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_8w1NgYMWEeGU2YHAOvJrlg" key="StereotypeList" value="ModelExplorerTest::SourceTargetRulesCopyPasteTest"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_8w1NgoMWEeGU2YHAOvJrlg" key="PropStereoDisplay" value="ModelExplorerTest::SourceTargetRulesCopyPasteTest.sourceElement,ModelExplorerTest::SourceTargetRulesCopyPasteTest.targets,ModelExplorerTest::SourceTargetRulesCopyPasteTest.feature,ModelExplorerTest::SourceTargetRulesCopyPasteTest.preCopyInitialization,ModelExplorerTest::SourceTargetRulesCopyPasteTest.postCopyRule,ModelExplorerTest::SourceTargetRulesCopyPasteTest.postUndoRule,ModelExplorerTest::SourceTargetRulesCopyPasteTest.postRedoRule,ModelExplorerTest::SourceTargetRulesCopyPasteTest.isCopyRuleValidInRedo,ModelExplorerTest::SourceTargetRulesCopyPasteTest.canCopy,ModelExplorerTest::SourceTargetRulesCopyPasteTest.additionalElementsQuantity"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_8w1Ng4MWEeGU2YHAOvJrlg" key="Stereotype_Presentation_Kind" value="HorizontalStereo"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_8w1NhIMWEeGU2YHAOvJrlg" key="StereotypePropertyLocation" value="Compartment"/>
+ </eAnnotations>
+ <children xmi:type="notation:DecorationNode" xmi:id="_COsyYH2bEeGYcfVa7z8CyQ" type="5029"/>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_COsyYX2bEeGYcfVa7z8CyQ" visible="false" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_COsyYn2bEeGYcfVa7z8CyQ"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_COsyY32bEeGYcfVa7z8CyQ"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_COsyZH2bEeGYcfVa7z8CyQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_COsyZX2bEeGYcfVa7z8CyQ"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_COsyZn2bEeGYcfVa7z8CyQ" visible="false" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_COsyZ32bEeGYcfVa7z8CyQ"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_COsyaH2bEeGYcfVa7z8CyQ"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_COsyaX2bEeGYcfVa7z8CyQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_COsyan2bEeGYcfVa7z8CyQ"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_COsya32bEeGYcfVa7z8CyQ" visible="false" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_COsybH2bEeGYcfVa7z8CyQ"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_COsybX2bEeGYcfVa7z8CyQ"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_COsybn2bEeGYcfVa7z8CyQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_COsyb32bEeGYcfVa7z8CyQ"/>
+ </children>
+ <element xmi:type="uml:Class" href="SysMLModelExplorerCopyPasteTestModel.uml#_wpG0sH2aEeGYcfVa7z8CyQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_COjBYX2bEeGYcfVa7z8CyQ" x="365" y="80" width="271" height="336"/>
+ </children>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_ByR8IX2bEeGYcfVa7z8CyQ"/>
+ <element xmi:type="uml:Package" href="SysMLModelExplorerCopyPasteTestModel.uml#_v-7hMH2YEeGYcfVa7z8CyQ"/>
+ </notation:Diagram>
+</xmi:XMI>
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/model/SysMLModelExplorerCopyPasteTestModel.uml b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/model/SysMLModelExplorerCopyPasteTestModel.uml
new file mode 100644
index 00000000000..58de843122d
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/model/SysMLModelExplorerCopyPasteTestModel.uml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ModelExplorerTest="http:///schemas/ModelExplorerTest/_JwNf8IMVEeGdYK4JhU1dXg/3" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/3.0.0/UML" xsi:schemaLocation="http:///schemas/ModelExplorerTest/_JwNf8IMVEeGdYK4JhU1dXg/3 pathmap://TEST_PROFILES/modelExplorerTest.profile.uml#_JwTmkIMVEeGdYK4JhU1dXg">
+ <uml:Model xmi:id="_Tj4CcHpOEeGpML05YPbTgg" name="Model">
+ <packageImport xmi:id="_Tj4CcXpOEeGpML05YPbTgg">
+ <importedPackage xmi:type="uml:Model" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/>
+ </packageImport>
+ <packageImport xmi:id="_nz8ZoHpfEeGr6LTFg6LEhg">
+ <importedPackage xmi:type="uml:Model" href="ModelWithBDD.uml#_UV0P8EAREeCMpNWxgNcrog"/>
+ </packageImport>
+ <packagedElement xmi:type="uml:Package" xmi:id="_lLOOcHpgEeGr6LTFg6LEhg" name="Part">
+ <packagedElement xmi:type="uml:Class" xmi:id="_tT030HphEeGr6LTFg6LEhg" name="SimplePart"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Package" xmi:id="_v-7hMH2YEeGYcfVa7z8CyQ" name="Block">
+ <packagedElement xmi:type="uml:Class" xmi:id="_ReSXcH2aEeGYcfVa7z8CyQ" name="SimpleBlock"/>
+ <packagedElement xmi:type="uml:Class" xmi:id="_wpG0sH2aEeGYcfVa7z8CyQ" name="SimpleBlock2"/>
+ </packagedElement>
+ <profileApplication xmi:id="_e41f0HpfEeGr6LTFg6LEhg">
+ <eAnnotations xmi:id="_e5gOMHpfEeGr6LTFg6LEhg" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <references xmi:type="ecore:EPackage" href="pathmap://TEST_PROFILES/modelExplorerTest.profile.uml#_JwTmkIMVEeGdYK4JhU1dXg"/>
+ </eAnnotations>
+ <appliedProfile href="pathmap://TEST_PROFILES/modelExplorerTest.profile.uml#_bA2ZgHnOEeGYn78b4G1s-Q"/>
+ </profileApplication>
+ </uml:Model>
+ <ModelExplorerTest:TestModel xmi:id="_hYbuwHpfEeGr6LTFg6LEhg" base_Model="_Tj4CcHpOEeGpML05YPbTgg">
+ <sourceModel href="ModelWithBDD.uml#_UV0P8EAREeCMpNWxgNcrog"/>
+ </ModelExplorerTest:TestModel>
+ <ModelExplorerTest:ElementTypeRulesCopyPasteTest xmi:id="_pia4MHpgEeGr6LTFg6LEhg" base_Package="_lLOOcHpgEeGr6LTFg6LEhg" elementType="org.eclipse.papyrus.sysml.PartProperty" postCopyRule="Association newAssociation = ((Property)newValues.get(0)).getAssociation(); Assert.assertNotNull(&quot;New Part should have an association&quot;, newAssociation);"/>
+ <ModelExplorerTest:SourceTargetRulesCopyPasteTest xmi:id="_z6XG8HphEeGr6LTFg6LEhg" base_Class="_tT030HphEeGr6LTFg6LEhg" feature="attribute">
+ <sourceElement xmi:type="uml:Property" href="ModelWithBDD.uml#_OsGu0HRGEeGbA9TcuN7qCA"/>
+ <targets xmi:type="uml:Class" href="ModelWithBDD.uml#__OVZQHRFEeGbA9TcuN7qCA"/>
+ <targets xmi:type="uml:Class" href="ModelWithBDD.uml#_CqW0MHRGEeGbA9TcuN7qCA"/>
+ <targets xmi:type="uml:Class" href="ModelWithBDD.uml#_Idw9QHRGEeGbA9TcuN7qCA"/>
+ <targets xmi:type="uml:Class" href="ModelWithBDD.uml#_K5RWYHRGEeGbA9TcuN7qCA"/>
+ </ModelExplorerTest:SourceTargetRulesCopyPasteTest>
+ <ModelExplorerTest:ElementTypeRulesCopyPasteTest xmi:id="_wKFoUH2YEeGYcfVa7z8CyQ" base_Package="_v-7hMH2YEeGYcfVa7z8CyQ" elementType="org.eclipse.papyrus.sysml.Block" preCopyInitialization="List&lt;Property> originalParts = new ArrayList&lt;Property>(); for(Property p : ((org.eclipse.uml2.uml.Class)copiedEObject).getAllAttributes()) { &#x9;if(new org.eclipse.papyrus.sysml.service.types.matcher.PartPropertyMatcher().matches(p)) {originalParts.add(p);}} additionalChecks.put(&quot;originalParts&quot;, originalParts);" postCopyRule="
+ FilteredCollectionView&lt;EObject&gt; newClasses = new FilteredCollectionView&lt;EObject&gt;(delta, new IFilter() {
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isAllowed(Object object) {
+ return object instanceof org.eclipse.uml2.uml.Class &amp;&amp; !(object instanceof org.eclipse.uml2.uml.Association);
+ }
+ });
+ Assert.assertEquals(&quot;New values should contain a Class&quot;, 1, newClasses.size());
+ org.eclipse.uml2.uml.Class newBlock = newClasses.toArray(new org.eclipse.uml2.uml.Class[]{})[0];
+ Assert.assertNotNull(&quot;Block stereotype should be applied&quot;,
+ ((org.eclipse.uml2.uml.Class) newBlock)
+ .getAppliedStereotype(&quot;SysML::Blocks::Block&quot;));
+ List&lt;Property&gt; originalParts = (List&lt;Property&gt;) originalModel
+ .get(&quot;originalParts&quot;);
+ List&lt;Property&gt; newParts = new ArrayList&lt;Property&gt;();
+ for (Property p : ((org.eclipse.uml2.uml.Class) newBlock)
+ .getAllAttributes()) {
+ if (new org.eclipse.papyrus.sysml.service.types.matcher.PartPropertyMatcher().matches(p)) {
+ newParts.add(p);
+ Assert.assertNotNull(
+ &quot;Part should have an associated association.&quot;,
+ p.getAssociation());
+ }
+ }
+ Assert.assertEquals(
+ &quot;Both original and new list of attributes should be quivalent for the blocks&quot;,
+ originalParts.size(), newParts.size());"/>
+ <ModelExplorerTest:SourceTargetRulesCopyPasteTest xmi:id="_Rel5f32aEeGYcfVa7z8CyQ" base_Class="_ReSXcH2aEeGYcfVa7z8CyQ" feature="ownedElement" additionalElementsQuantity="3">
+ <sourceElement xmi:type="uml:Class" href="ModelWithBDD.uml#__OVZQHRFEeGbA9TcuN7qCA"/>
+ <targets xmi:type="uml:Package" href="ModelWithBDD.uml#_E8hEEHRGEeGbA9TcuN7qCA"/>
+ <targets xmi:type="uml:Model" href="ModelWithBDD.uml#_UV0P8EAREeCMpNWxgNcrog"/>
+ </ModelExplorerTest:SourceTargetRulesCopyPasteTest>
+ <ModelExplorerTest:SourceTargetRulesCopyPasteTest xmi:id="_wpZIkH2aEeGYcfVa7z8CyQ" base_Class="_wpG0sH2aEeGYcfVa7z8CyQ" feature="ownedElement" additionalElementsQuantity="3">
+ <sourceElement xmi:type="uml:Class" href="ModelWithBDD.uml#_Idw9QHRGEeGbA9TcuN7qCA"/>
+ <targets xmi:type="uml:Package" href="ModelWithBDD.uml#_E8hEEHRGEeGbA9TcuN7qCA"/>
+ <targets xmi:type="uml:Model" href="ModelWithBDD.uml#_UV0P8EAREeCMpNWxgNcrog"/>
+ </ModelExplorerTest:SourceTargetRulesCopyPasteTest>
+</xmi:XMI>
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/org.eclipse.papyrus.sysml.modelexplorer.tests.launch b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/org.eclipse.papyrus.sysml.modelexplorer.tests.launch
new file mode 100644
index 00000000000..6e78474c3d4
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/org.eclipse.papyrus.sysml.modelexplorer.tests.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="bad_container_name" value="\org.eclipse.papyrus.sysml.modelexplorer.tests."/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="[NONE]"/>
+<booleanAttribute key="clearConfig" value="true"/>
+<booleanAttribute key="clearws" value="true"/>
+<booleanAttribute key="clearwslog" value="false"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
+<booleanAttribute key="default" value="true"/>
+<booleanAttribute key="includeOptional" value="true"/>
+<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/suites/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"/>
+<stringAttribute key="org.eclipse.jdt.launching.JAVA_COMMAND" value="java"/>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.papyrus.sysml.modelexplorer.tests.suites.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.sysml.modelexplorer.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.5 -Xms40m -Xmx512m -XX:PermSize=512M -XX:MaxPermSize=512M"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="org.eclipse.sdk.ide"/>
+<booleanAttribute key="run_in_ui_thread" value="true"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useCustomFeatures" value="false"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<booleanAttribute key="useDefaultConfigArea" value="false"/>
+<booleanAttribute key="useProduct" value="true"/>
+</launchConfiguration>
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/plugin.properties b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/plugin.properties
new file mode 100644
index 00000000000..31e32227982
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/plugin.properties
@@ -0,0 +1,14 @@
+#################################################################################
+# Copyright (c) 2011 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:
+#
+# CEA LIST - Initial API and Implementation.
+#
+##################################################################################
+pluginName=Papyrus SysML Model Explorer Tests (Incubation)
+providerName=Eclipse Modeling Project
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteBlockTest.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteBlockTest.java
new file mode 100644
index 00000000000..2028a57fa18
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteBlockTest.java
@@ -0,0 +1,85 @@
+/*****************************************************************************
+ * Copyright (c) 2011 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:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ * @Generated from Block - Model
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.modelexplorer.tests.copypaste;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.papyrus.core.utils.FilteredCollectionView;
+import org.eclipse.papyrus.core.utils.IFilter;
+import org.eclipse.uml2.uml.Property;
+import org.junit.Assert;
+
+
+/**
+ * Test for Copy / Paste of a Part
+ */
+public abstract class AbstractCopyPasteBlockTest extends AbstractCopyPasteTest {
+
+ /**
+ * {@inheritDoc}
+ *
+ * @generated
+ */
+ @Override
+ protected void initializeTest(Map<Object, Object> additionalChecks, EObject targetContainer, EObject copiedEObject) {
+ super.initializeTest(additionalChecks, targetContainer, copiedEObject);
+
+ /* pre-copy initialization */
+ List<Property> originalParts = new ArrayList<Property>();
+ for(Property p : ((org.eclipse.uml2.uml.Class)copiedEObject).getAllAttributes()) {
+ if(new org.eclipse.papyrus.sysml.service.types.matcher.PartPropertyMatcher().matches(p)) {
+ originalParts.add(p);
+ }
+ }
+ additionalChecks.put("originalParts", originalParts);
+ /* END OF pre-copy initialization */
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @generated
+ */
+ @Override
+ protected void postCopyAdditionalChecks(Map<?, ?> originalModel, List<EObject> newValues, List<EObject> delta) throws Exception {
+ super.postCopyAdditionalChecks(originalModel, newValues, delta);
+
+ /* post copy checks */
+ FilteredCollectionView<EObject> newClasses = new FilteredCollectionView<EObject>(delta, new IFilter() {
+
+ /** * {@inheritDoc} */
+ public boolean isAllowed(Object object) {
+ return object instanceof org.eclipse.uml2.uml.Class && !(object instanceof org.eclipse.uml2.uml.Association);
+ }
+ });
+ Assert.assertEquals("New values should contain a Class", 1, newClasses.size());
+ org.eclipse.uml2.uml.Class newBlock = newClasses.toArray(new org.eclipse.uml2.uml.Class[]{})[0];
+ Assert.assertNotNull("Block stereotype should be applied", ((org.eclipse.uml2.uml.Class)newBlock).getAppliedStereotype("SysML::Blocks::Block"));
+ List<Property> originalParts = (List<Property>)originalModel.get("originalParts");
+ List<Property> newParts = new ArrayList<Property>();
+ for(Property p : ((org.eclipse.uml2.uml.Class)newBlock).getAllAttributes()) {
+ if(new org.eclipse.papyrus.sysml.service.types.matcher.PartPropertyMatcher().matches(p)) {
+ newParts.add(p);
+ Assert.assertNotNull("Part should have an associated association.", p.getAssociation());
+ }
+ }
+ Assert.assertEquals("Both original and new list of attributes should be quivalent for the blocks", originalParts.size(), newParts.size());
+ /* END OF post copy checks */
+ }
+
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPastePartTest.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPastePartTest.java
new file mode 100644
index 00000000000..2e69664639c
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPastePartTest.java
@@ -0,0 +1,70 @@
+/*****************************************************************************
+ * Copyright (c) 2011 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:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ * @Generated from Part - Model
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.modelexplorer.tests.copypaste;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.papyrus.core.utils.FilteredCollectionView;
+import org.eclipse.papyrus.core.utils.IFilter;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.ui.IWorkbenchCommandConstants;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.commands.ICommandService;
+import org.eclipse.uml2.uml.Association;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+
+/**
+ * Test for Copy / Paste of a Part
+ */
+public abstract class AbstractCopyPastePartTest extends AbstractCopyPasteTest {
+
+ /**
+ * {@inheritDoc}
+ * @generated
+ */
+ @Override
+ protected void initializeTest(Map<Object, Object> additionalChecks, EObject targetContainer, EObject copiedEObject) {
+ super.initializeTest(additionalChecks, targetContainer, copiedEObject);
+
+ /* pre-copy initialization */
+
+ /* END OF pre-copy initialization */
+ }
+
+ /**
+ * {@inheritDoc}
+ * @generated
+ */
+ @Override
+ protected void postCopyAdditionalChecks(Map<?, ?> originalModel, List<EObject> newValues, List<EObject> delta) throws Exception {
+ super.postCopyAdditionalChecks(originalModel, newValues, delta);
+
+ /* post copy checks */
+ Association newAssociation = ((Property)newValues.get(0)).getAssociation(); Assert.assertNotNull("New Part should have an association", newAssociation);
+ /* END OF post copy checks */
+ }
+
+}
+
+
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteTest.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteTest.java
new file mode 100644
index 00000000000..650bf161fde
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteTest.java
@@ -0,0 +1,390 @@
+/*****************************************************************************
+ * Copyright (c) 2011 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:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ * @Generated from Model
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.modelexplorer.tests.copypaste;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import junit.framework.Assert;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
+import org.eclipse.papyrus.core.utils.FilteredCollectionView;
+import org.eclipse.papyrus.core.utils.IFilter;
+import org.eclipse.papyrus.modelexplorer.ModelExplorerPageBookView;
+import org.eclipse.papyrus.modelexplorer.ModelExplorerView;
+import org.eclipse.papyrus.modelexplorer.NavigatorUtils;
+import org.eclipse.papyrus.sysml.modelexplorer.Activator;
+import org.eclipse.papyrus.sysml.modelexplorer.tests.utils.EditorUtils;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchCommandConstants;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.commands.ICommandService;
+import org.eclipse.ui.intro.IIntroPart;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.Model;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.Property;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+
+
+/**
+ * Abstract class for Copy/paste
+ */
+public abstract class AbstractCopyPasteTest {
+
+ /** boolean to indicate if the test is initialized or not */
+ private static boolean isInitialized;
+
+ /** main papyrus editor */
+ public static IEditorPart editor = null;
+
+ /** id of the papyrus editor */
+ public static String editorID = "org.eclipse.papyrus.core.papyrusEditor";
+
+ /** view part: the model explorer */
+ protected static IViewPart modelExplorerPart;
+
+ /** generated selectable objects */
+ protected static org.eclipse.uml2.uml.Model model_EObject;
+ protected static org.eclipse.uml2.uml.Class b1_EObject;
+ protected static org.eclipse.uml2.uml.Property pB2_B1_EObject;
+ protected static org.eclipse.uml2.uml.Property pB1P1_B1_EObject;
+
+ protected static org.eclipse.uml2.uml.Class b2_EObject;
+
+ protected static org.eclipse.uml2.uml.Package p1_EObject;
+ protected static org.eclipse.uml2.uml.Class b2P1_P1_EObject;
+
+ protected static org.eclipse.uml2.uml.Class b1P1_P1_EObject;
+ protected static org.eclipse.uml2.uml.Property pB2P1_B1P1_P1_EObject;
+ protected static org.eclipse.uml2.uml.Property pB1_B1P1_P1_EObject;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /** end of generated selectable objects */
+
+ /**
+ * Prepare the diagram before testing
+ *
+ * @throws Exception
+ * exception thrown in case of problem
+ */
+ @BeforeClass
+ public static void prepareTest() throws Exception {
+ DiagramEditPart diagramEditPart = EditorUtils.getDiagramEditPart();
+ EObject root = diagramEditPart.getDiagramView().getElement();
+
+ Assert.assertTrue("Impossible to find main model", root instanceof Model);
+
+ /** generated selectable objects */
+ model_EObject = (org.eclipse.uml2.uml.Model)root;
+ b1_EObject = (org.eclipse.uml2.uml.Class) model_EObject.getPackagedElement("B1");
+ pB2_B1_EObject = (org.eclipse.uml2.uml.Property) b1_EObject.getAttribute("pB2", null);
+ pB1P1_B1_EObject = (org.eclipse.uml2.uml.Property) b1_EObject.getAttribute("pB1P1", null);
+
+ b2_EObject = (org.eclipse.uml2.uml.Class) model_EObject.getPackagedElement("B2");
+
+ p1_EObject = (org.eclipse.uml2.uml.Package) model_EObject.getPackagedElement("P1");
+ b2P1_P1_EObject = (org.eclipse.uml2.uml.Class) p1_EObject.getPackagedElement("B2P1");
+
+ b1P1_P1_EObject = (org.eclipse.uml2.uml.Class) p1_EObject.getPackagedElement("B1P1");
+ pB2P1_B1P1_P1_EObject = (org.eclipse.uml2.uml.Property) b1P1_P1_EObject.getAttribute("pB2P1", null);
+ pB1_B1P1_P1_EObject = (org.eclipse.uml2.uml.Property) b1P1_P1_EObject.getAttribute("pB1", null);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /** end of generated selectable objects */
+ }
+
+
+ /**
+ * Initialization of the test
+ *
+ * @throws Exception
+ * thrown when initialization has problem
+ */
+ @BeforeClass
+ public static void openPapyrusWithAnEmptyProject() throws Exception {
+ IIntroPart introPart = PlatformUI.getWorkbench().getIntroManager().getIntro();
+ PlatformUI.getWorkbench().getIntroManager().closeIntro(introPart);
+ // Prepare new project for tests
+ IProject testProject = ResourcesPlugin.getWorkspace().getRoot().getProject("TestProject");
+ if(!testProject.exists()) {
+ testProject.create(new NullProgressMonitor());
+ }
+
+ if(!testProject.isOpen()) {
+ testProject.open(new NullProgressMonitor());
+ }
+
+ // Copy EmptyModel from bundle to the test project
+ IFile emptyModel_di = testProject.getFile("ModelWithBDD.di");
+ IFile emptyModel_no = testProject.getFile("ModelWithBDD.notation");
+ IFile emptyModel_uml = testProject.getFile("ModelWithBDD.uml");
+
+ // isInitialized = isInitialized || emptyModel_di.exists();
+
+ if(!isInitialized) {
+ isInitialized = true;
+ emptyModel_di.create(Activator.getDefault().getBundle().getResource("/model/ModelWithBDD.di").openStream(), true, new NullProgressMonitor());
+ emptyModel_no.create(Activator.getDefault().getBundle().getResource("/model/ModelWithBDD.notation").openStream(), true, new NullProgressMonitor());
+ emptyModel_uml.create(Activator.getDefault().getBundle().getResource("/model/ModelWithBDD.uml").openStream(), true, new NullProgressMonitor());
+ }
+
+ // Open the EmptyModel.di file with Papyrus (assumed to be the default editor for "di" files here).
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ editor = page.openEditor(new FileEditorInput(emptyModel_di), editorID);
+
+ modelExplorerPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(ModelExplorerPageBookView.VIEW_ID);
+ Assert.assertNotNull("Model explorer is null", modelExplorerPart);
+ }
+
+ /**
+ * Close editor
+ *
+ * @throws Exception
+ * exception thrown in case of problem
+ */
+ @AfterClass
+ public static void closePapyrusAndCleanProject() throws Exception {
+ // Close the editor without saving content created during tests
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ page.closeEditor(editor, false);
+ }
+
+
+ /**
+ * Selects and reveal the specified element
+ *
+ * @param object
+ * the object to select
+ * @throws Exception
+ * exception thrown in case element could not be selected
+ */
+ public static void selectAndReveal(EObject object) throws Exception {
+ selectAndReveal(Arrays.asList(object));
+ }
+
+ /**
+ * Selects and reveal the specified list of elements
+ *
+ * @param newElements
+ * the list of objects to select
+ * @throws Exception
+ * exception thrown in case element could not be selected
+ */
+ public static void selectAndReveal(List<EObject> newElements) throws Exception {
+ // Retrieve model explorer
+ ModelExplorerView modelExplorerView = null;
+
+ ModelExplorerPageBookView bookViewPart = (ModelExplorerPageBookView)NavigatorUtils.findViewPart(ModelExplorerPageBookView.VIEW_ID); //$NON-NLS-0$
+ if(bookViewPart != null) {
+ modelExplorerView = (ModelExplorerView)((ModelExplorerPageBookView)bookViewPart).getActiveView();
+ }
+
+ // Set selection on new element in the model explorer
+ if((modelExplorerView != null) && (newElements != null)) {
+ List<EObject> semanticElementList = new ArrayList<EObject>();
+ semanticElementList.addAll(newElements);
+ modelExplorerView.revealSemanticElement(semanticElementList);
+ } else {
+ throw new Exception("Impossible to find the model explorer required to select: " + newElements);
+ }
+ }
+
+ /**
+ * Generic implementation of the test
+ *
+ * @throws Exception
+ * exception thrown when the test has problems
+ */
+ protected void testExecutableCopyPaste(EObject targetContainer, EObject copiedEObject, String featureName, int expectedNumberOfAddedElements) throws Exception {
+ testExecutableCopyPaste(targetContainer, copiedEObject, targetContainer.eClass().getEStructuralFeature(featureName), expectedNumberOfAddedElements);
+ }
+
+ /**
+ * Generic implementation of the test
+ *
+ * @throws Exception
+ * exception thrown when the test has problems
+ */
+ protected void testExecutableCopyPaste(EObject targetContainer, EObject copiedEObject, EStructuralFeature feature, int expectedNumberOfAddedElements) throws Exception {
+ // retrieve elements in the model explorer
+ selectAndReveal(targetContainer);
+
+ List<EObject> originalValues = new ArrayList<EObject>((List<EObject>)targetContainer.eGet(feature));
+
+ Map<Object, Object> originalModel = new HashMap<Object, Object>();
+ initializeTest(originalModel, targetContainer, copiedEObject);
+
+ // try to paste in several places
+ // copy Paste b1EObject
+ ICommandService commandService = (ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class);
+ commandService.refreshElements(IWorkbenchCommandConstants.EDIT_PASTE, null);
+ org.eclipse.core.commands.Command pasteCommand = commandService.getCommand(IWorkbenchCommandConstants.EDIT_PASTE);
+ Assert.assertNotNull("Impossible to find paste command", pasteCommand);
+ Assert.assertTrue("command in not enabled", pasteCommand.isEnabled());
+ Assert.assertTrue("command in not defined", pasteCommand.isDefined());
+
+ pasteCommand.executeWithChecks(new ExecutionEvent());
+
+ // check editor state (should be non dirty)
+ Assert.assertTrue("Editor should be dirty after paste command execution", isEditorDirty());
+
+
+ // should retrieve a new Part AND a new association
+ List<EObject> newValues = (List<EObject>)targetContainer.eGet(feature);
+ // compute delta
+ List<EObject> delta = new ArrayList<EObject>();
+ for(EObject o : newValues) {
+ if(!originalValues.contains(o)) {
+ delta.add(o);
+ }
+ }
+
+ // size = original size +1
+ Assert.assertEquals("Wrong number of attributes after paste", expectedNumberOfAddedElements, delta.size());
+
+ // part should be linked to an association
+ postCopyAdditionalChecks(originalModel, newValues, delta);
+
+ // undo
+ if(getEditingDomain().getCommandStack().canUndo()) {
+ getEditingDomain().getCommandStack().undo();
+ } else {
+ throw new Exception("Impossible to undo the paste command: " + pasteCommand);
+ }
+ // check editor state (should be non dirty)
+ Assert.assertFalse("Editor should not be dirty after undo", isEditorDirty());
+ // check old values equals the actual values
+ newValues = (List<EObject>)targetContainer.eGet(feature);
+ Assert.assertEquals("Initial and current list feature list should be equivalent", newValues, originalValues);
+
+ // redo
+ if(getEditingDomain().getCommandStack().canRedo()) {
+ getEditingDomain().getCommandStack().redo();
+ } else {
+ throw new Exception("Impossible to redo the paste command: " + pasteCommand);
+ }
+ // check editor state (should be non dirty)
+ Assert.assertTrue("Editor should not dirty after redo", isEditorDirty());
+
+ // check as it was the result of the paste command
+ newValues = (List<EObject>)targetContainer.eGet(feature);
+ delta = new ArrayList<EObject>();
+ for(EObject o : newValues) {
+ if(!originalValues.contains(o)) {
+ delta.add(o);
+ }
+ }
+
+ // size = original size + delta
+ Assert.assertEquals("Wrong number of attributes after paste", expectedNumberOfAddedElements, delta.size());
+
+ // part should be linked to an association
+ postCopyAdditionalChecks(originalModel, newValues, delta);
+
+ // undo again, to restore state
+ if(getEditingDomain().getCommandStack().canUndo()) {
+ getEditingDomain().getCommandStack().undo();
+ } else {
+ throw new Exception("Impossible to re-undo the paste command: " + pasteCommand);
+ }
+ // check editor state (should be non dirty)
+ Assert.assertFalse("Editor should not be dirty after undo", isEditorDirty());
+
+ }
+
+ /**
+ * executes additional checks on the new value
+ *
+ * @param originalModel
+ * the map containing all values stored before launching the test
+ * @param newValue
+ * the new value, result of the copy
+ * @param delta
+ * differences between original list and the new one
+ */
+ protected void postCopyAdditionalChecks(Map<?, ?> originalModel, List<EObject> newValues, List<EObject> delta) throws Exception {
+ // use the values contained in the map to do additional checks
+ }
+
+ protected void initializeTest(Map<Object, Object> additionalChecks, EObject targetContainer, EObject copiedEObject) {
+ // nothing to do here
+ }
+
+ /**
+ * Returns the current editing domain
+ *
+ * @return
+ * the current editing domain
+ */
+ protected TransactionalEditingDomain getEditingDomain() throws Exception {
+ return org.eclipse.papyrus.core.utils.ServiceUtilsForActionHandlers.getInstance().getTransactionalEditingDomain();
+ }
+
+ /**
+ * Returns <code>true</code> if the current Active editor is dirty.
+ *
+ * @return <code>true</code> if the current Active editor is dirty
+ * @throws Exception
+ * exception thrown in case of problem (NPE, etc.)
+ */
+ protected boolean isEditorDirty() throws Exception {
+ return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().isDirty();
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimpleBlock2Test.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimpleBlock2Test.java
new file mode 100644
index 00000000000..ee26217356f
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimpleBlock2Test.java
@@ -0,0 +1,117 @@
+/*****************************************************************************
+ * Copyright (c) 2011 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:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ * @Generated from SimpleBlock2 - Model
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.modelexplorer.tests.copypaste;
+
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.ui.IWorkbenchCommandConstants;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.commands.ICommandService;
+import org.eclipse.uml2.uml.Association;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+
+/**
+ * Test for Copy / Paste of a Part
+ */
+public class CopyPasteSimpleBlock2Test extends AbstractCopyPasteBlockTest {
+
+ /**
+ * prepare the copy
+ *
+ * @throws Exception
+ * exception thrown in case of problems
+ */
+ @Before
+ public void testPrepare() throws Exception {
+ // check editor state (should be non dirty)
+ Assert.assertFalse("Editor should not be dirty at initialization", isEditorDirty());
+ // retrieve elements in the model explorer
+ selectAndReveal( b1P1_P1_EObject);
+
+ // copy Paste
+ ICommandService commandService = (ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class);
+ commandService.refreshElements(IWorkbenchCommandConstants.EDIT_COPY, null);
+ org.eclipse.core.commands.Command copyCommand = commandService.getCommand(IWorkbenchCommandConstants.EDIT_COPY);
+ Assert.assertNotNull("Impossible to find copy command", copyCommand);
+ Assert.assertTrue("command in not enabled", copyCommand.isEnabled());
+ Assert.assertTrue("command in not defined", copyCommand.isDefined());
+ copyCommand.executeWithChecks(new ExecutionEvent());
+
+ // check editor state (should be non dirty)
+ // Assert.assertFalse("Editor should not be dirty after copy", isEditorDirty());
+
+ // NOTE: save editor. The copy command should not dirty the model, the implementation of the copy command or the editor should be modified
+ Assert.assertTrue("Copy command is dirtying the model, whereas it should not. This assert is here to remember that the test code should be modified: Isdirty = false after copy...", isEditorDirty());
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().doSave(new NullProgressMonitor());
+ Assert.assertFalse("Save command is non-dirtying the model, whereas it should. ", isEditorDirty());
+ // END NOTE
+ }
+
+ @Override
+ protected void initializeTest(Map<Object, Object> additionalChecks, EObject targetContainer, EObject copiedEObject) {
+ super.initializeTest(additionalChecks, targetContainer, copiedEObject);
+
+ /* pre-copy initialization */
+
+ /* END OF pre-copy initialization */
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void postCopyAdditionalChecks(Map<?, ?> originalModel, List<EObject> newValues, List<EObject> delta) throws Exception {
+ super.postCopyAdditionalChecks(originalModel, newValues, delta);
+
+ /* post copy checks */
+
+ /* END OF post copy checks */
+ }
+
+
+ /**
+ * Test the copy /paste on P1
+ *
+ * @throws Exception
+ * exception thrown in case of problems
+ */
+ @Test
+ public void testCopyPasteInP1() throws Exception {
+ testExecutableCopyPaste( p1_EObject, b1P1_P1_EObject, "ownedElement", 3);
+ }
+ /**
+ * Test the copy /paste on model
+ *
+ * @throws Exception
+ * exception thrown in case of problems
+ */
+ @Test
+ public void testCopyPasteInmodel() throws Exception {
+ testExecutableCopyPaste( model_EObject, b1P1_P1_EObject, "ownedElement", 3);
+ }
+
+
+}
+
+
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimpleBlockTest.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimpleBlockTest.java
new file mode 100644
index 00000000000..7a310508228
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimpleBlockTest.java
@@ -0,0 +1,117 @@
+/*****************************************************************************
+ * Copyright (c) 2011 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:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ * @Generated from SimpleBlock - Model
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.modelexplorer.tests.copypaste;
+
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.ui.IWorkbenchCommandConstants;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.commands.ICommandService;
+import org.eclipse.uml2.uml.Association;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+
+/**
+ * Test for Copy / Paste of a Part
+ */
+public class CopyPasteSimpleBlockTest extends AbstractCopyPasteBlockTest {
+
+ /**
+ * prepare the copy
+ *
+ * @throws Exception
+ * exception thrown in case of problems
+ */
+ @Before
+ public void testPrepare() throws Exception {
+ // check editor state (should be non dirty)
+ Assert.assertFalse("Editor should not be dirty at initialization", isEditorDirty());
+ // retrieve elements in the model explorer
+ selectAndReveal( b1_EObject);
+
+ // copy Paste
+ ICommandService commandService = (ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class);
+ commandService.refreshElements(IWorkbenchCommandConstants.EDIT_COPY, null);
+ org.eclipse.core.commands.Command copyCommand = commandService.getCommand(IWorkbenchCommandConstants.EDIT_COPY);
+ Assert.assertNotNull("Impossible to find copy command", copyCommand);
+ Assert.assertTrue("command in not enabled", copyCommand.isEnabled());
+ Assert.assertTrue("command in not defined", copyCommand.isDefined());
+ copyCommand.executeWithChecks(new ExecutionEvent());
+
+ // check editor state (should be non dirty)
+ // Assert.assertFalse("Editor should not be dirty after copy", isEditorDirty());
+
+ // NOTE: save editor. The copy command should not dirty the model, the implementation of the copy command or the editor should be modified
+ Assert.assertTrue("Copy command is dirtying the model, whereas it should not. This assert is here to remember that the test code should be modified: Isdirty = false after copy...", isEditorDirty());
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().doSave(new NullProgressMonitor());
+ Assert.assertFalse("Save command is non-dirtying the model, whereas it should. ", isEditorDirty());
+ // END NOTE
+ }
+
+ @Override
+ protected void initializeTest(Map<Object, Object> additionalChecks, EObject targetContainer, EObject copiedEObject) {
+ super.initializeTest(additionalChecks, targetContainer, copiedEObject);
+
+ /* pre-copy initialization */
+
+ /* END OF pre-copy initialization */
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void postCopyAdditionalChecks(Map<?, ?> originalModel, List<EObject> newValues, List<EObject> delta) throws Exception {
+ super.postCopyAdditionalChecks(originalModel, newValues, delta);
+
+ /* post copy checks */
+
+ /* END OF post copy checks */
+ }
+
+
+ /**
+ * Test the copy /paste on P1
+ *
+ * @throws Exception
+ * exception thrown in case of problems
+ */
+ @Test
+ public void testCopyPasteInP1() throws Exception {
+ testExecutableCopyPaste( p1_EObject, b1_EObject, "ownedElement", 3);
+ }
+ /**
+ * Test the copy /paste on model
+ *
+ * @throws Exception
+ * exception thrown in case of problems
+ */
+ @Test
+ public void testCopyPasteInmodel() throws Exception {
+ testExecutableCopyPaste( model_EObject, b1_EObject, "ownedElement", 3);
+ }
+
+
+}
+
+
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimplePartTest.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimplePartTest.java
new file mode 100644
index 00000000000..f6c38b50f17
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimplePartTest.java
@@ -0,0 +1,137 @@
+/*****************************************************************************
+ * Copyright (c) 2011 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:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ * @Generated from SimplePart - Model
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.modelexplorer.tests.copypaste;
+
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.ui.IWorkbenchCommandConstants;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.commands.ICommandService;
+import org.eclipse.uml2.uml.Association;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+
+/**
+ * Test for Copy / Paste of a Part
+ */
+public class CopyPasteSimplePartTest extends AbstractCopyPastePartTest {
+
+ /**
+ * prepare the copy
+ *
+ * @throws Exception
+ * exception thrown in case of problems
+ */
+ @Before
+ public void testPrepare() throws Exception {
+ // check editor state (should be non dirty)
+ Assert.assertFalse("Editor should not be dirty at initialization", isEditorDirty());
+ // retrieve elements in the model explorer
+ selectAndReveal( pB2_B1_EObject);
+
+ // copy Paste
+ ICommandService commandService = (ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class);
+ commandService.refreshElements(IWorkbenchCommandConstants.EDIT_COPY, null);
+ org.eclipse.core.commands.Command copyCommand = commandService.getCommand(IWorkbenchCommandConstants.EDIT_COPY);
+ Assert.assertNotNull("Impossible to find copy command", copyCommand);
+ Assert.assertTrue("command in not enabled", copyCommand.isEnabled());
+ Assert.assertTrue("command in not defined", copyCommand.isDefined());
+ copyCommand.executeWithChecks(new ExecutionEvent());
+
+ // check editor state (should be non dirty)
+ // Assert.assertFalse("Editor should not be dirty after copy", isEditorDirty());
+
+ // NOTE: save editor. The copy command should not dirty the model, the implementation of the copy command or the editor should be modified
+ Assert.assertTrue("Copy command is dirtying the model, whereas it should not. This assert is here to remember that the test code should be modified: Isdirty = false after copy...", isEditorDirty());
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().doSave(new NullProgressMonitor());
+ Assert.assertFalse("Save command is non-dirtying the model, whereas it should. ", isEditorDirty());
+ // END NOTE
+ }
+
+ @Override
+ protected void initializeTest(Map<Object, Object> additionalChecks, EObject targetContainer, EObject copiedEObject) {
+ super.initializeTest(additionalChecks, targetContainer, copiedEObject);
+
+ /* pre-copy initialization */
+
+ /* END OF pre-copy initialization */
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void postCopyAdditionalChecks(Map<?, ?> originalModel, List<EObject> newValues, List<EObject> delta) throws Exception {
+ super.postCopyAdditionalChecks(originalModel, newValues, delta);
+
+ /* post copy checks */
+
+ /* END OF post copy checks */
+ }
+
+
+ /**
+ * Test the copy /paste on B1
+ *
+ * @throws Exception
+ * exception thrown in case of problems
+ */
+ @Test
+ public void testCopyPasteInB1() throws Exception {
+ testExecutableCopyPaste( b1_EObject, pB2_B1_EObject, "attribute", 1);
+ }
+ /**
+ * Test the copy /paste on B2
+ *
+ * @throws Exception
+ * exception thrown in case of problems
+ */
+ @Test
+ public void testCopyPasteInB2() throws Exception {
+ testExecutableCopyPaste( b2_EObject, pB2_B1_EObject, "attribute", 1);
+ }
+ /**
+ * Test the copy /paste on B1P1
+ *
+ * @throws Exception
+ * exception thrown in case of problems
+ */
+ @Test
+ public void testCopyPasteInB1P1() throws Exception {
+ testExecutableCopyPaste( b1P1_P1_EObject, pB2_B1_EObject, "attribute", 1);
+ }
+ /**
+ * Test the copy /paste on B2P1
+ *
+ * @throws Exception
+ * exception thrown in case of problems
+ */
+ @Test
+ public void testCopyPasteInB2P1() throws Exception {
+ testExecutableCopyPaste( b2P1_P1_EObject, pB2_B1_EObject, "attribute", 1);
+ }
+
+
+}
+
+
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/suites/AllCopyPasteTests.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/suites/AllCopyPasteTests.java
new file mode 100644
index 00000000000..c53f0dbcce0
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/suites/AllCopyPasteTests.java
@@ -0,0 +1,36 @@
+ /*****************************************************************************
+ * Copyright (c) 2011 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:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ * @generated
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.modelexplorer.tests.suites;
+
+import org.eclipse.papyrus.sysml.modelexplorer.tests.copypaste.*;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+
+/**
+ * Tests suite for Copy/Paste
+ * @generated
+ */
+@RunWith(Suite.class)
+@SuiteClasses({
+// Block
+CopyPasteSimpleBlock2Test.class,
+CopyPasteSimpleBlockTest.class,
+// Part
+CopyPasteSimplePartTest.class,
+
+})
+public class AllCopyPasteTests {
+
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteTest.java_bak b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteTest.java_bak
new file mode 100644
index 00000000000..115dc02fe67
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteTest.java_bak
@@ -0,0 +1,358 @@
+/*****************************************************************************
+ * Copyright (c) 2011 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:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.modelexplorer.tests.copypaste;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import junit.framework.Assert;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
+import org.eclipse.papyrus.modelexplorer.ModelExplorerPageBookView;
+import org.eclipse.papyrus.modelexplorer.ModelExplorerView;
+import org.eclipse.papyrus.modelexplorer.NavigatorUtils;
+import org.eclipse.papyrus.sysml.modelexplorer.Activator;
+import org.eclipse.papyrus.sysml.modelexplorer.tests.utils.EditorUtils;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchCommandConstants;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.commands.ICommandService;
+import org.eclipse.ui.intro.IIntroPart;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.Model;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.Property;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+
+
+/**
+ * Abstract class for Copy/paste
+ */
+public class AbstractCopyPasteTest {
+
+ /** boolean to indicate if the test is initialized or not */
+ private static boolean isInitialized;
+
+ /** main papyrus editor */
+ public static IEditorPart editor = null;
+
+ /** id of the papyrus editor */
+ public static String editorID = "org.eclipse.papyrus.core.papyrusEditor";
+
+ /** view part: the model explorer */
+ protected static IViewPart modelExplorerPart;
+
+ // EObjects selectable
+ protected static Model modelEObject;
+
+ protected static org.eclipse.uml2.uml.Class b1EObject;
+
+ protected static Property b1_pB2EObject;
+
+ protected static Property b1_pB1P2EObject;
+
+ protected static org.eclipse.uml2.uml.Class b2EObject;
+
+ protected static Package p1EObject;
+
+ protected static org.eclipse.uml2.uml.Class p1_b1p1EObject;
+
+ protected static Property p1_b1p1_pB1EObject;
+
+ protected static Property p1_b1p1_pB2P1EObject;
+
+ protected static org.eclipse.uml2.uml.Class p1_b2p1EObject;
+
+ // end of selectable EObjects
+ /**
+ * Prepare the diagram before testing
+ *
+ * @throws Exception
+ * exception thrown in case of problem
+ */
+ @BeforeClass
+ public static void prepareTest() throws Exception {
+ DiagramEditPart diagramEditPart = EditorUtils.getDiagramEditPart();
+ EObject root = diagramEditPart.getDiagramView().getElement();
+
+ Assert.assertTrue("Impossible to find main model", root instanceof Model);
+ modelEObject = (Model)root;
+ b1EObject = (Class)modelEObject.getPackagedElement("B1");
+ Assert.assertNotNull(b1EObject);
+ b1_pB2EObject = b1EObject.getPart("pB2", null);
+ Assert.assertNotNull(b1_pB2EObject);
+ b1_pB1P2EObject = b1EObject.getPart("pB1P1", null);
+ Assert.assertNotNull(b1_pB1P2EObject);
+ b2EObject = (Class)modelEObject.getPackagedElement("B2");
+ Assert.assertNotNull(b2EObject);
+ p1EObject = (Package)modelEObject.getPackagedElement("P1");
+ Assert.assertNotNull(p1EObject);
+ p1_b1p1EObject = (Class)p1EObject.getPackagedElement("B1P1");
+ Assert.assertNotNull(p1_b1p1EObject);
+ p1_b1p1_pB1EObject = p1_b1p1EObject.getPart("pB1", null);
+ Assert.assertNotNull(p1_b1p1_pB1EObject);
+ p1_b1p1_pB2P1EObject = p1_b1p1EObject.getPart("pB2P1", null);
+ Assert.assertNotNull(p1_b1p1_pB2P1EObject);
+ p1_b2p1EObject = (Class)p1EObject.getPackagedElement("B2P1");
+ Assert.assertNotNull(p1_b2p1EObject);
+ }
+
+ /**
+ * Initialization of the test
+ *
+ * @throws Exception
+ * thrown when initialization has problem
+ */
+ @BeforeClass
+ public static void openPapyrusWithAnEmptyProject() throws Exception {
+ IIntroPart introPart = PlatformUI.getWorkbench().getIntroManager().getIntro();
+ PlatformUI.getWorkbench().getIntroManager().closeIntro(introPart);
+ // Prepare new project for tests
+ IProject testProject = ResourcesPlugin.getWorkspace().getRoot().getProject("TestProject");
+ if(!testProject.exists()) {
+ testProject.create(new NullProgressMonitor());
+ }
+
+ if(!testProject.isOpen()) {
+ testProject.open(new NullProgressMonitor());
+ }
+
+ // Copy EmptyModel from bundle to the test project
+ IFile emptyModel_di = testProject.getFile("ModelWithBDD.di");
+ IFile emptyModel_no = testProject.getFile("ModelWithBDD.notation");
+ IFile emptyModel_uml = testProject.getFile("ModelWithBDD.uml");
+
+ // isInitialized = isInitialized || emptyModel_di.exists();
+
+ if(!isInitialized) {
+ isInitialized = true;
+ emptyModel_di.create(Activator.getDefault().getBundle().getResource("/model/ModelWithBDD.di").openStream(), true, new NullProgressMonitor());
+ emptyModel_no.create(Activator.getDefault().getBundle().getResource("/model/ModelWithBDD.notation").openStream(), true, new NullProgressMonitor());
+ emptyModel_uml.create(Activator.getDefault().getBundle().getResource("/model/ModelWithBDD.uml").openStream(), true, new NullProgressMonitor());
+ }
+
+ // Open the EmptyModel.di file with Papyrus (assumed to be the default editor for "di" files here).
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ editor = page.openEditor(new FileEditorInput(emptyModel_di), editorID);
+
+ modelExplorerPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(ModelExplorerPageBookView.VIEW_ID);
+ Assert.assertNotNull("Model explorer is null", modelExplorerPart);
+ }
+
+ /**
+ * Close editor
+ *
+ * @throws Exception
+ * exception thrown in case of problem
+ */
+ @AfterClass
+ public static void closePapyrusAndCleanProject() throws Exception {
+ // Close the editor without saving content created during tests
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ page.closeEditor(editor, false);
+ }
+
+
+ /**
+ * Selects and reveal the specified element
+ *
+ * @param object
+ * the object to select
+ * @throws Exception
+ * exception thrown in case element could not be selected
+ */
+ public static void selectAndReveal(EObject object) throws Exception {
+ selectAndReveal(Arrays.asList(object));
+ }
+
+ /**
+ * Selects and reveal the specified list of elements
+ *
+ * @param newElements
+ * the list of objects to select
+ * @throws Exception
+ * exception thrown in case element could not be selected
+ */
+ public static void selectAndReveal(List<EObject> newElements) throws Exception {
+ // Retrieve model explorer
+ ModelExplorerView modelExplorerView = null;
+
+ ModelExplorerPageBookView bookViewPart = (ModelExplorerPageBookView)NavigatorUtils.findViewPart(ModelExplorerPageBookView.VIEW_ID); //$NON-NLS-0$
+ if(bookViewPart != null) {
+ modelExplorerView = (ModelExplorerView)((ModelExplorerPageBookView)bookViewPart).getActiveView();
+ }
+
+ // Set selection on new element in the model explorer
+ if((modelExplorerView != null) && (newElements != null)) {
+ List<EObject> semanticElementList = new ArrayList<EObject>();
+ semanticElementList.addAll(newElements);
+ modelExplorerView.revealSemanticElement(semanticElementList);
+ } else {
+ throw new Exception("Impossible to find the model explorer required to select: " + newElements);
+ }
+ }
+
+ /**
+ * Generic implementation of the test
+ *
+ * @throws Exception
+ * exception thrown when the test has problems
+ */
+ protected void testExecutableCopyPaste(EObject targetContainer, EObject copiedEObject, EStructuralFeature feature) throws Exception {
+ // retrieve elements in the model explorer
+ selectAndReveal(targetContainer);
+
+ List<EObject> originalValues = new ArrayList<EObject>((List<EObject>)targetContainer.eGet(feature));
+
+ Map<Object, Object> originalModel = new HashMap<Object, Object>();
+ initializeTest(originalModel, targetContainer, copiedEObject);
+
+ // try to paste in several places
+ // copy Paste b1EObject
+ ICommandService commandService = (ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class);
+ commandService.refreshElements(IWorkbenchCommandConstants.EDIT_PASTE, null);
+ org.eclipse.core.commands.Command pasteCommand = commandService.getCommand(IWorkbenchCommandConstants.EDIT_PASTE);
+ Assert.assertNotNull("Impossible to find paste command", pasteCommand);
+ Assert.assertTrue("command in not enabled", pasteCommand.isEnabled());
+ Assert.assertTrue("command in not defined", pasteCommand.isDefined());
+
+ pasteCommand.executeWithChecks(new ExecutionEvent());
+
+ // check editor state (should be non dirty)
+ Assert.assertTrue("Editor should be dirty after paste command execution", isEditorDirty());
+
+
+ // should retrieve a new Part AND a new association
+ List<EObject> newValues = (List<EObject>)targetContainer.eGet(feature);
+ // size = original size +1
+ Assert.assertEquals("Wrong number of attributes after paste", originalValues.size() + 1, newValues.size());
+
+ // check the new one has a property
+ Iterator<EObject> it = newValues.iterator();
+ EObject newValue = null;
+ while(it.hasNext()) {
+ EObject value = it.next();
+ if(!originalValues.contains(value)) {
+ newValue = value;
+ }
+ }
+
+ Assert.assertNotNull("Impossible to find the new Part", newValue);
+
+ // part should be linked to an association
+ postCopyAdditionalChecks(originalModel, newValue);
+
+ // undo
+ if(getEditingDomain().getCommandStack().canUndo()) {
+ getEditingDomain().getCommandStack().undo();
+ } else {
+ throw new Exception("Impossible to undo the paste command: " + pasteCommand);
+ }
+ // check editor state (should be non dirty)
+ Assert.assertTrue("Editor should not be dirty after undo", isEditorDirty());
+ // check old values equals the actual values
+ newValues = (List<EObject>)targetContainer.eGet(feature);
+ Assert.assertEquals("Initial and current list feature list should be equivalent", newValues, originalValues);
+
+ // redo
+ if(getEditingDomain().getCommandStack().canRedo()) {
+ getEditingDomain().getCommandStack().redo();
+ } else {
+ throw new Exception("Impossible to redo the paste command: " + pasteCommand);
+ }
+ // check editor state (should be non dirty)
+ Assert.assertFalse("Editor should not dirty after redo", isEditorDirty());
+
+ // check as it was the result of the paste command
+ newValues = (List<EObject>)targetContainer.eGet(feature);
+ // size = 3
+ Assert.assertEquals("Wrong number of attributes after paste", originalValues.size() + 1, newValues.size());
+
+ // check the new one has a property
+ it = newValues.iterator();
+ newValue = null;
+ while(it.hasNext()) {
+ EObject value = it.next();
+ if(!originalValues.contains(value)) {
+ newValue = value;
+ }
+ }
+ Assert.assertNotNull("Impossible to find the new Part", newValue);
+
+ // part should be linked to an association
+ postCopyAdditionalChecks(originalModel, newValue);
+
+ // undo again, to restore state
+ if(getEditingDomain().getCommandStack().canUndo()) {
+ getEditingDomain().getCommandStack().undo();
+ } else {
+ throw new Exception("Impossible to re-undo the paste command: " + pasteCommand);
+ }
+ // check editor state (should be non dirty)
+ Assert.assertTrue("Editor should not be dirty after undo", isEditorDirty());
+
+ }
+
+ /**
+ * executes additional checks on the new value
+ *
+ * @param originalModel
+ * the map containing all values stored before launching the test
+ * @param newValue
+ * the new value, result of the copy
+ */
+ protected void postCopyAdditionalChecks(Map<?, ?> originalModel, EObject newValue) throws Exception {
+ // use the values contained in the map to do additional checks
+ }
+
+ protected void initializeTest(Map<Object, Object> additionalChecks, EObject targetContainer, EObject copiedEObject) {
+ // nothing to do here
+ }
+
+ /**
+ * Returns the current editing domain
+ *
+ * @return
+ * the current editing domain
+ */
+ protected TransactionalEditingDomain getEditingDomain() throws Exception {
+ return org.eclipse.papyrus.core.utils.ServiceUtilsForActionHandlers.getInstance().getTransactionalEditingDomain();
+ }
+
+ /**
+ * Returns <code>true</code> if the current Active editor is dirty.
+ *
+ * @return <code>true</code> if the current Active editor is dirty
+ * @throws Exception
+ * exception thrown in case of problem (NPE, etc.)
+ */
+ protected boolean isEditorDirty() throws Exception {
+ return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().isDirty();
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPastePartTest.java_bak b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPastePartTest.java_bak
new file mode 100644
index 00000000000..c32b1b55815
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPastePartTest.java_bak
@@ -0,0 +1,129 @@
+/*****************************************************************************
+ * Copyright (c) 2011 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:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.modelexplorer.tests.copypaste;
+
+import java.util.Map;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.ui.IWorkbenchCommandConstants;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.commands.ICommandService;
+import org.eclipse.uml2.uml.Association;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+
+/**
+ * Test for Copy / Paste of a Part
+ */
+public class CopyPastePartTest extends AbstractCopyPasteTest {
+
+ /**
+ * prepare the copy
+ *
+ * @throws Exception
+ * exception thrown in case of problems
+ */
+ @Before
+ public void testPrepare() throws Exception {
+ // check editor state (should be non dirty)
+ Assert.assertFalse("Editor should not be dirty at initialization", isEditorDirty());
+ // retrieve elements in the model explorer
+ selectAndReveal(pB2_B1_EObject);
+
+ // copy Paste b1EObject
+ ICommandService commandService = (ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class);
+ commandService.refreshElements(IWorkbenchCommandConstants.EDIT_COPY, null);
+ org.eclipse.core.commands.Command copyCommand = commandService.getCommand(IWorkbenchCommandConstants.EDIT_COPY);
+ Assert.assertNotNull("Impossible to find copy command", copyCommand);
+ Assert.assertTrue("command in not enabled", copyCommand.isEnabled());
+ Assert.assertTrue("command in not defined", copyCommand.isDefined());
+ copyCommand.executeWithChecks(new ExecutionEvent());
+
+ // check editor state (should be non dirty)
+ // Assert.assertFalse("Editor should not be dirty after copy", isEditorDirty());
+
+ // NOTE: save editor. The copy command should not dirty the model, the implementation of the copy command or the editor should be modified
+ Assert.assertTrue("Copy command is dirtying the model, whereas it should not. This assert is here to remember that the test code should be modified: Isdirty = false after copy...", isEditorDirty());
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().doSave(new NullProgressMonitor());
+ Assert.assertFalse("Save command is non-dirtying the model, whereas it should. ", isEditorDirty());
+ // END NOTE
+ }
+
+ @Override
+ protected void initializeTest(Map<Object, Object> additionalChecks, EObject targetContainer, EObject copiedEObject) {
+ super.initializeTest(additionalChecks, targetContainer, copiedEObject);
+ // nothing here
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void postCopyAdditionalChecks(Map<?, ?> originalModel, EObject newValue) throws Exception {
+ super.postCopyAdditionalChecks(originalModel, newValue);
+
+ Association newAssociation = ((Property)newValue).getAssociation();
+ Assert.assertNotNull("New Part should have an association", newAssociation);
+
+ }
+
+ /**
+ * Test the copy /paste of a part
+ *
+ * @throws Exception
+ * exception thrown in case of problems
+ */
+ @Test
+ public void testPastePartInBlockB1() throws Exception {
+ testExecutableCopyPaste(b1_EObject, pB2_B1_EObject, UMLPackage.eINSTANCE.getClassifier_Attribute());
+ }
+
+ /**
+ * Test the copy /paste of a part
+ *
+ * @throws Exception
+ * exception thrown in case of problems
+ */
+ @Test
+ public void testPastePartInBlockB2() throws Exception {
+ testExecutableCopyPaste(b2_EObject, pB2_B1_EObject, UMLPackage.eINSTANCE.getClassifier_Attribute());
+ }
+
+ /**
+ * Test the copy /paste of a part
+ *
+ * @throws Exception
+ * exception thrown in case of problems
+ */
+ @Test
+ public void testPastePartInBlockB1P1() throws Exception {
+ testExecutableCopyPaste(b1P1_P1_EObject, pB2_B1_EObject, UMLPackage.eINSTANCE.getClassifier_Attribute());
+ }
+
+ /**
+ * Test the copy /paste of a part
+ *
+ * @throws Exception
+ * exception thrown in case of problems
+ */
+ @Test
+ public void testPastePartInBlockB2P1() throws Exception {
+ testExecutableCopyPaste(b2P1_P1_EObject, pB2_B1_EObject, UMLPackage.eINSTANCE.getClassifier_Attribute());
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/suites/AllCopyPasteTests.java_bak b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/suites/AllCopyPasteTests.java_bak
new file mode 100644
index 00000000000..285238bbc47
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/suites/AllCopyPasteTests.java_bak
@@ -0,0 +1,28 @@
+/*****************************************************************************
+ * Copyright (c) 2011 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:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.modelexplorer.tests.suites;
+
+import org.eclipse.papyrus.sysml.modelexplorer.tests.copypaste.CopyPasteSimplePartTest;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+
+/**
+ *
+ */
+@RunWith(Suite.class)
+@SuiteClasses({ CopyPasteSimplePartTest.class, })
+public class AllCopyPasteTests {
+
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/suites/AllTests.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/suites/AllTests.java
new file mode 100644
index 00000000000..7ab6b62e4fa
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/suites/AllTests.java
@@ -0,0 +1,29 @@
+/*****************************************************************************
+ * Copyright (c) 2011 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:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.modelexplorer.tests.suites;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+
+/**
+ * Main test suite class
+ */
+@RunWith(Suite.class)
+@SuiteClasses({
+ AllCopyPasteTests.class,
+})
+public class AllTests {
+
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/utils/EditorUtils.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/utils/EditorUtils.java
new file mode 100644
index 00000000000..edfe37f104d
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/utils/EditorUtils.java
@@ -0,0 +1,63 @@
+/*****************************************************************************
+ * Copyright (c) 2011 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:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.modelexplorer.tests.utils;
+
+import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor;
+import org.eclipse.papyrus.core.services.ServiceException;
+import org.eclipse.papyrus.core.services.ServicesRegistry;
+import org.eclipse.papyrus.core.utils.ServiceUtils;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PlatformUI;
+
+
+/**
+ * Utility class for tests
+ */
+public class EditorUtils {
+
+ /**
+ * Retrieves current active editor
+ *
+ * @return current active editor
+ * @throws Exception
+ * exception thrown in case of issue
+ */
+ public static IEditorPart getEditor() throws Exception {
+ return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ }
+
+ public static DiagramEditor getDiagramEditor() throws Exception {
+
+ ServicesRegistry serviceRegistry = (ServicesRegistry)getEditor().getAdapter(ServicesRegistry.class);
+ try {
+ return (DiagramEditor)ServiceUtils.getInstance().getNestedActiveIEditorPart(serviceRegistry);
+
+ } catch (ServiceException e) {
+ throw new Exception("Unable to retrieve service.", e);
+ } catch (ClassCastException e) {
+ throw new Exception("Active diagram is not a DiagramEditor." + e.getMessage(), e);
+ }
+ }
+
+ public static DiagramEditPart getDiagramEditPart() throws Exception {
+
+ try {
+ return getDiagramEditor().getDiagramEditPart();
+
+ } catch (NullPointerException e) {
+ throw new Exception("Could not find diagram edit part.", e);
+ }
+ }
+
+}

Back to the top