summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoit Maggi2014-05-06 07:41:47 (EDT)
committerBenoit Maggi2014-05-06 07:41:47 (EDT)
commit11bb2f6d9c8f60a98e1fb5e98e5c2a3f40c18f23 (patch)
treee728e3bdd880744a578477bc87ac7153c1d6634c
parent7f14df266a69b5a465eb71b816009c2824c21f4c (diff)
downloadorg.eclipse.papyrus-11bb2f6d9c8f60a98e1fb5e98e5c2a3f40c18f23.zip
org.eclipse.papyrus-11bb2f6d9c8f60a98e1fb5e98e5c2a3f40c18f23.tar.gz
org.eclipse.papyrus-11bb2f6d9c8f60a98e1fb5e98e5c2a3f40c18f23.tar.bz2
Bug 290261 - [Usability] Papyrus shall provide a copy/paste/cut featurerefs/changes/35/26035/1
- Branch simple copy-paste for model explorer Change-Id: I23c5e970e8fc68c1b4fa30eefc5544de785548c2 Signed-off-by: Benoit Maggi <benoit.maggi@cea.fr>
-rw-r--r--tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/src/org/eclipse/papyrus/uml/modelexplorer/tests/AllTests.java61
-rw-r--r--tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/src/org/eclipse/papyrus/uml/modelexplorer/tests/paste/CopyPasteHandlerTest.java11
2 files changed, 37 insertions, 35 deletions
diff --git a/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/src/org/eclipse/papyrus/uml/modelexplorer/tests/AllTests.java b/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/src/org/eclipse/papyrus/uml/modelexplorer/tests/AllTests.java
index 59e6676..068c0dd 100644
--- a/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/src/org/eclipse/papyrus/uml/modelexplorer/tests/AllTests.java
+++ b/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/src/org/eclipse/papyrus/uml/modelexplorer/tests/AllTests.java
@@ -1,30 +1,31 @@
-/*******************************************************************************
- * Copyright (c) 2011 Mia-Software.
- * 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:
- * Nicolas Guyomar (Mia-Software) - Bug 340681 - Facet column implementation
- * Nicolas Guyomar (Mia-Software) - Bug 344413 - Facet Columns are never created when we begin with an empty table
- * Nicolas Guyomar (Mia-Software) - Bug 344921 - Undo/Redo just after the creation of the table
- * Nicolas Guyomar (Mia-Software) - Bug 346465 - [EMF Facet Table] Remove line does not remove obsolete column
- * Gregoire Dupe (Mia-Software) - Bug 350700 - TableWidget: Wrong cell label in multi-valued facet reference columns
- * Gregoire Dupe (Mia-Software) - Bug 345730 - Deleting an element in the model breaks the table
- *******************************************************************************/
-package org.eclipse.papyrus.uml.modelexplorer.tests;
-
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-@RunWith(Suite.class)
-@SuiteClasses({
- DeleteHandlerTest.class, RenameHandlerTest.class, ModelExplorerViewTests.class
-
-})
-public class AllTests {
- // JUnit for test suite
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Mia-Software.
+ * 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:
+ * Nicolas Guyomar (Mia-Software) - Bug 340681 - Facet column implementation
+ * Nicolas Guyomar (Mia-Software) - Bug 344413 - Facet Columns are never created when we begin with an empty table
+ * Nicolas Guyomar (Mia-Software) - Bug 344921 - Undo/Redo just after the creation of the table
+ * Nicolas Guyomar (Mia-Software) - Bug 346465 - [EMF Facet Table] Remove line does not remove obsolete column
+ * Gregoire Dupe (Mia-Software) - Bug 350700 - TableWidget: Wrong cell label in multi-valued facet reference columns
+ * Gregoire Dupe (Mia-Software) - Bug 345730 - Deleting an element in the model breaks the table
+ *******************************************************************************/
+package org.eclipse.papyrus.uml.modelexplorer.tests;
+
+
+import org.eclipse.papyrus.uml.modelexplorer.tests.paste.CopyPasteHandlerTest;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+@RunWith(Suite.class)
+@SuiteClasses({
+ DeleteHandlerTest.class, RenameHandlerTest.class, ModelExplorerViewTests.class, CopyPasteHandlerTest.class
+
+})
+public class AllTests {
+ // JUnit for test suite
+}
diff --git a/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/src/org/eclipse/papyrus/uml/modelexplorer/tests/paste/CopyPasteHandlerTest.java b/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/src/org/eclipse/papyrus/uml/modelexplorer/tests/paste/CopyPasteHandlerTest.java
index 582063d..a1f231b 100644
--- a/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/src/org/eclipse/papyrus/uml/modelexplorer/tests/paste/CopyPasteHandlerTest.java
+++ b/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/src/org/eclipse/papyrus/uml/modelexplorer/tests/paste/CopyPasteHandlerTest.java
@@ -21,6 +21,7 @@ import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.papyrus.uml.modelexplorer.tests.Activator;
+import org.eclipse.papyrus.uml.tools.utils.NamedElementUtil;
import org.eclipse.papyrus.views.modelexplorer.tests.AbstractDualHandlerTest;
import org.eclipse.uml2.uml.NamedElement;
import org.junit.Assert;
@@ -70,8 +71,8 @@ public class CopyPasteHandlerTest extends AbstractDualHandlerTest {
Assert.assertTrue(pasteHandler.isEnabled());
pasteHandler.execute(new ExecutionEvent());
- // check that there is 2 Class1
- Assert.assertEquals("Class1 copy is missing", getCountElementByName(CLASS1), 2); //$NON-NLS-1$
+ // check that there is a Class1
+ Assert.assertNotNull("Class1 copy is missing", getNameElementByName(NamedElementUtil.COPY_OF+"_"+CLASS1+"_1")); //$NON-NLS-1$
} catch (ExecutionException e) {
Assert.fail(e.toString());
@@ -112,9 +113,9 @@ public class CopyPasteHandlerTest extends AbstractDualHandlerTest {
IHandler pasteHandler = getSecondActiveHandler();
Assert.assertTrue(pasteHandler.isEnabled());
pasteHandler.execute(new ExecutionEvent());
- // check that there is 2 Class1 and 2 Class2
- Assert.assertEquals("Class1 copy is missing", getCountElementByName(CLASS1), 2); //$NON-NLS-1$
- Assert.assertEquals("Class2 copy is missing", getCountElementByName(CLASS2), 2); //$NON-NLS-1$
+ // check that there are Class1 and Class2
+ Assert.assertNotNull("Class1 copy is missing", getNameElementByName(NamedElementUtil.COPY_OF+"_"+CLASS1+"_1")); //$NON-NLS-1$
+ Assert.assertNotNull("Class2 copy is missing", getNameElementByName(NamedElementUtil.COPY_OF+"_"+CLASS2+"_1")); //$NON-NLS-1$
} catch (ExecutionException e) {
Assert.fail(e.toString());