Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxime Porhel2018-09-28 15:15:51 +0000
committerMaxime Porhel2018-10-04 15:42:38 +0000
commit2c9e207aa63a3a819acbad4f55732c2b9be57084 (patch)
tree36c32ea21b6615056b2b91ad343c4ebfc09911b1
parent647bc013450ff647f4a7bd8b607589badf6f6f4a (diff)
downloadorg.eclipse.sirius-2c9e207aa63a3a819acbad4f55732c2b9be57084.tar.gz
org.eclipse.sirius-2c9e207aa63a3a819acbad4f55732c2b9be57084.tar.xz
org.eclipse.sirius-2c9e207aa63a3a819acbad4f55732c2b9be57084.zip
[525261] Use SiriusCopier instead of EcoreUtil.Copier in testsv6.1.0M4
The copies done in tests must also avoid to duplicate the uids. Change-Id: I6e261d5f4444ae696d41f94b92b4959c9f4b06a9 Signed-off-by: Maxime Porhel <maxime.porhel@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/format/data/AbstractFormatHelperImplNodeFormatDataTest.java3
-rw-r--r--plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/format/data/FormatHelperImplEdgeFormatDataTest.java3
-rw-r--r--plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/layout/data/AbstractLayoutHelperImplNodeLayoutDataTest.java3
-rw-r--r--plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/layout/data/LayoutHelperImplEdgeLayoutDataTest.java3
-rw-r--r--plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/perf/diagram/refresh/DiagramSynchronizerMappingScaleTest.java6
-rw-r--r--plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/table/unit/refresh/DCrossTableNoDomainSynchronizerVSMWithEditorTest.java19
-rw-r--r--plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/table/unit/refresh/DCrossTableSynchronizerVSMWithEditorTest.java19
-rw-r--r--plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/table/unit/refresh/DTableSynchronizerVSMWithEditorTest.java19
-rw-r--r--plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/table/unit/tools/NoVariableDuplicationTest.java28
-rw-r--r--plugins/org.eclipse.sirius.tests.tree/src/org/eclipse/sirius/tests/unit/tree/tools/NoVariableDuplicationTest.java17
10 files changed, 53 insertions, 67 deletions
diff --git a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/format/data/AbstractFormatHelperImplNodeFormatDataTest.java b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/format/data/AbstractFormatHelperImplNodeFormatDataTest.java
index b67a9ea0d8..cd48dc8aac 100644
--- a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/format/data/AbstractFormatHelperImplNodeFormatDataTest.java
+++ b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/format/data/AbstractFormatHelperImplNodeFormatDataTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2016 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2018 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -51,6 +51,7 @@ public abstract class AbstractFormatHelperImplNodeFormatDataTest extends Abstrac
*/
@Override
protected AbstractFormatHelperImplTest<NodeFormatData>.FormatDataWrapper createWrappedInstance(final NodeFormatData from) throws Exception {
+ // Do not use SiriusCopier here as we want to copy the id in the format data tree.
final NodeFormatData nodeFormatData = EcoreUtil.copy(from);
return new NodeFormatDataWrapper(nodeFormatData);
}
diff --git a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/format/data/FormatHelperImplEdgeFormatDataTest.java b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/format/data/FormatHelperImplEdgeFormatDataTest.java
index 6212412d46..d0344cc555 100644
--- a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/format/data/FormatHelperImplEdgeFormatDataTest.java
+++ b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/format/data/FormatHelperImplEdgeFormatDataTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2016 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2018 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -51,6 +51,7 @@ public class FormatHelperImplEdgeFormatDataTest extends AbstractFormatHelperImpl
*/
@Override
protected AbstractFormatHelperImplTest<EdgeFormatData>.FormatDataWrapper createWrappedInstance(final EdgeFormatData from) throws Exception {
+ // Do not use SiriusCopier here as we want to copy the id in the format data tree.
final EdgeFormatData nodeFormatData = (EdgeFormatData) EcoreUtil.copy(from);
return new EdgeFormatDataWrapper(nodeFormatData);
}
diff --git a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/layout/data/AbstractLayoutHelperImplNodeLayoutDataTest.java b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/layout/data/AbstractLayoutHelperImplNodeLayoutDataTest.java
index 7db870ee01..eaf01e9cfb 100644
--- a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/layout/data/AbstractLayoutHelperImplNodeLayoutDataTest.java
+++ b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/layout/data/AbstractLayoutHelperImplNodeLayoutDataTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2018 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -50,6 +50,7 @@ public abstract class AbstractLayoutHelperImplNodeLayoutDataTest extends Abstrac
*/
@Override
protected AbstractLayoutHelperImplTest<NodeLayoutData>.LayoutDataWrapper createWrappedInstance(final NodeLayoutData from) throws Exception {
+ // Do not use SiriusCopier here as we want to copy the id in the layout data tree.
final NodeLayoutData nodeLayoutData = (NodeLayoutData) EcoreUtil.copy(from);
return new NodeLayoutDataWrapper(nodeLayoutData);
}
diff --git a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/layout/data/LayoutHelperImplEdgeLayoutDataTest.java b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/layout/data/LayoutHelperImplEdgeLayoutDataTest.java
index 7cfbf54b2b..58b0329ec7 100644
--- a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/layout/data/LayoutHelperImplEdgeLayoutDataTest.java
+++ b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/layout/data/LayoutHelperImplEdgeLayoutDataTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2018 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -48,6 +48,7 @@ public class LayoutHelperImplEdgeLayoutDataTest extends AbstractLayoutHelperImpl
*/
@Override
protected AbstractLayoutHelperImplTest<EdgeLayoutData>.LayoutDataWrapper createWrappedInstance(final EdgeLayoutData from) throws Exception {
+ // Do not use SiriusCopier here as we want to copy the id in the layout data tree.
final EdgeLayoutData nodeLayoutData = (EdgeLayoutData) EcoreUtil.copy(from);
return new EdgeLayoutDataWrapper(nodeLayoutData);
}
diff --git a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/perf/diagram/refresh/DiagramSynchronizerMappingScaleTest.java b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/perf/diagram/refresh/DiagramSynchronizerMappingScaleTest.java
index b31c823203..8262745321 100644
--- a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/perf/diagram/refresh/DiagramSynchronizerMappingScaleTest.java
+++ b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/perf/diagram/refresh/DiagramSynchronizerMappingScaleTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2018 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -12,9 +12,9 @@
*******************************************************************************/
package org.eclipse.sirius.tests.unit.perf.diagram.refresh;
-import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.transaction.RecordingCommand;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.sirius.common.tools.api.util.SiriusCopier;
import org.eclipse.sirius.diagram.description.DiagramDescription;
import org.eclipse.sirius.diagram.description.NodeMapping;
import org.eclipse.sirius.tests.unit.diagram.refresh.AbstractSynchronizerTest;
@@ -49,7 +49,7 @@ public class DiagramSynchronizerMappingScaleTest extends AbstractSynchronizerTes
prepareSynchronizer(classDiag, "Test class diagram");
for (int j = 1; j < nbNewElements + 1; j++) {
- final NodeMapping newMapping = (NodeMapping) EcoreUtil.copy(originalMapping);
+ final NodeMapping newMapping = (NodeMapping) SiriusCopier.Helper.copy(originalMapping);
newMapping.setName("New Mapping" + j);
domain.getCommandStack().execute(new RecordingCommand(domain) {
diff --git a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/table/unit/refresh/DCrossTableNoDomainSynchronizerVSMWithEditorTest.java b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/table/unit/refresh/DCrossTableNoDomainSynchronizerVSMWithEditorTest.java
index 77314c2667..0fd6247b7f 100644
--- a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/table/unit/refresh/DCrossTableNoDomainSynchronizerVSMWithEditorTest.java
+++ b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/table/unit/refresh/DCrossTableNoDomainSynchronizerVSMWithEditorTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2015 THALES GLOBAL SERVICES and others.
+ * Copyright (c) 2010, 2018 THALES GLOBAL SERVICES and others.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -17,7 +17,7 @@ import java.util.List;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.sirius.common.tools.api.util.SiriusCopier;
import org.eclipse.sirius.table.metamodel.table.DTable;
import org.eclipse.sirius.table.metamodel.table.description.ColumnMapping;
import org.eclipse.sirius.table.metamodel.table.description.CrossTableDescription;
@@ -37,8 +37,7 @@ import org.eclipse.swt.widgets.Tree;
import org.eclipse.ui.IEditorPart;
/**
- * Test synchronization between modeler and editor on Cross table with no domain
- * based. Test VP-597 VP-598 & VP-1680
+ * Test synchronization between modeler and editor on Cross table with no domain based. Test VP-597 VP-598 & VP-1680
*
* @author jdupont
*
@@ -111,7 +110,7 @@ public class DCrossTableNoDomainSynchronizerVSMWithEditorTest extends TableTestC
// Add 1 column.
String commandName = "Add a new column mapping";
- final ElementColumnMapping columnToAdd = (ElementColumnMapping) EcoreUtil.copy(columns.get(0));
+ final ElementColumnMapping columnToAdd = (ElementColumnMapping) SiriusCopier.Helper.copy(columns.get(0));
session.getTransactionalEditingDomain().getCommandStack().execute(new SiriusCommand(session.getTransactionalEditingDomain(), commandName) {
protected void doExecute() {
columnToAdd.setName("crossColumn2");
@@ -231,8 +230,7 @@ public class DCrossTableNoDomainSynchronizerVSMWithEditorTest extends TableTestC
* </UL>
*
* @param surroundVSModificationByCloseAndOpen
- * true if the table must be close before VSM modification and
- * open after, false otherwise.
+ * true if the table must be close before VSM modification and open after, false otherwise.
*/
protected void testRefreshFeatureColumnFirstLevelSubLineMapping(boolean surroundVSModificationByCloseAndOpen) {
final TableDescription tableDescription = find(TABLE_DESCRIPTION_ID);
@@ -264,7 +262,7 @@ public class DCrossTableNoDomainSynchronizerVSMWithEditorTest extends TableTestC
}
// Add 1 sub line mapping.
- final LineMapping lineToAdd = (LineMapping) EcoreUtil.copy(lines.get(0).getAllSubLines().get(1));
+ final LineMapping lineToAdd = (LineMapping) SiriusCopier.Helper.copy(lines.get(0).getAllSubLines().get(1));
assertEquals("Bad line to copy", "Attribut2", lineToAdd.getName());
String commandName = "Add a new sub line mapping";
@@ -382,8 +380,7 @@ public class DCrossTableNoDomainSynchronizerVSMWithEditorTest extends TableTestC
* Test the modification of sub line mapping in the VSM.
*
* @param surroundVSModificationByCloseAndOpen
- * true if the table must be close before VSM modification and
- * open after, false otherwise.
+ * true if the table must be close before VSM modification and open after, false otherwise.
*/
protected void testRefreshFeatureColumnOtherLevelSubLineMapping(boolean surroundVSModificationByCloseAndOpen) {
final TableDescription tableDescription = find(TABLE_DESCRIPTION_ID);
@@ -416,7 +413,7 @@ public class DCrossTableNoDomainSynchronizerVSMWithEditorTest extends TableTestC
assertEquals("The number of sub sub line mapping is not correct", 3, lines.get(0).getAllSubLines().get(0).getAllSubLines().size());
// Add 1 sub line to the first sub line of the first line.
- final LineMapping lineToAdd = (LineMapping) EcoreUtil.copy(lines.get(0).getAllSubLines().get(0).getAllSubLines().get(0));
+ final LineMapping lineToAdd = (LineMapping) SiriusCopier.Helper.copy(lines.get(0).getAllSubLines().get(0).getAllSubLines().get(0));
session.getTransactionalEditingDomain().getCommandStack().execute(new SiriusCommand(session.getTransactionalEditingDomain()) {
protected void doExecute() {
lineToAdd.setName("SousAttribut4");
diff --git a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/table/unit/refresh/DCrossTableSynchronizerVSMWithEditorTest.java b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/table/unit/refresh/DCrossTableSynchronizerVSMWithEditorTest.java
index 92b04a19a7..cbe69052da 100644
--- a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/table/unit/refresh/DCrossTableSynchronizerVSMWithEditorTest.java
+++ b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/table/unit/refresh/DCrossTableSynchronizerVSMWithEditorTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2018 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -17,7 +17,7 @@ import java.util.List;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.sirius.common.tools.api.util.SiriusCopier;
import org.eclipse.sirius.table.metamodel.table.DTable;
import org.eclipse.sirius.table.metamodel.table.description.ColumnMapping;
import org.eclipse.sirius.table.metamodel.table.description.CrossTableDescription;
@@ -37,8 +37,7 @@ import org.eclipse.swt.widgets.Tree;
import org.eclipse.ui.IEditorPart;
/**
- * Test synchronization between modeler and editor on Cross Table. Test VP-597
- * VP-598 & VP-1680
+ * Test synchronization between modeler and editor on Cross Table. Test VP-597 VP-598 & VP-1680
*
* @author jdupont
*/
@@ -116,7 +115,7 @@ public class DCrossTableSynchronizerVSMWithEditorTest extends TableTestCase {
tree = tableEditor.getTableViewer().getTreeViewer().getTree();
String commandName = "Add a new column mapping";
- final ElementColumnMapping columnToAdd = (ElementColumnMapping) EcoreUtil.copy(columns.get(0));
+ final ElementColumnMapping columnToAdd = (ElementColumnMapping) SiriusCopier.Helper.copy(columns.get(0));
session.getTransactionalEditingDomain().getCommandStack().execute(new SiriusCommand(session.getTransactionalEditingDomain(), commandName) {
protected void doExecute() {
columnToAdd.setName("crossColumn2");
@@ -222,8 +221,7 @@ public class DCrossTableSynchronizerVSMWithEditorTest extends TableTestCase {
* </UL>
*
* @param surroundVSModificationByCloseAndOpen
- * true if the table must be close before VSM modification and
- * open after, false otherwise.
+ * true if the table must be close before VSM modification and open after, false otherwise.
*/
protected void testRefreshFeatureColumnFirstLevelSubLineMapping(boolean surroundVSModificationByCloseAndOpen) {
final TableDescription tableDescription = find(TABLE_DESCRIPTION_ID);
@@ -256,7 +254,7 @@ public class DCrossTableSynchronizerVSMWithEditorTest extends TableTestCase {
}
// Add 1 sub line mapping.
- final LineMapping lineToAdd = (LineMapping) EcoreUtil.copy(lines.get(0).getAllSubLines().get(1));
+ final LineMapping lineToAdd = (LineMapping) SiriusCopier.Helper.copy(lines.get(0).getAllSubLines().get(1));
assertEquals("Bad line to copy", "Attribut2", lineToAdd.getName());
String commandName = "Add a new sub line mapping";
@@ -377,8 +375,7 @@ public class DCrossTableSynchronizerVSMWithEditorTest extends TableTestCase {
* Test the modification of sub line mapping in the VSM.
*
* @param surroundVSModificationByCloseAndOpen
- * true if the table must be close before VSM modification and
- * open after, false otherwise.
+ * true if the table must be close before VSM modification and open after, false otherwise.
*/
protected void testRefreshFeatureColumnOtherLevelSubLineMapping(boolean surroundVSModificationByCloseAndOpen) {
final TableDescription tableDescription = find(TABLE_DESCRIPTION_ID);
@@ -412,7 +409,7 @@ public class DCrossTableSynchronizerVSMWithEditorTest extends TableTestCase {
assertEquals("The number of sub sub line mapping is not correct", 3, lines.get(0).getAllSubLines().get(0).getAllSubLines().size());
// Add 1 sub line to the first sub line of the first line.
- final LineMapping lineToAdd = (LineMapping) EcoreUtil.copy(lines.get(0).getAllSubLines().get(0).getAllSubLines().get(0));
+ final LineMapping lineToAdd = (LineMapping) SiriusCopier.Helper.copy(lines.get(0).getAllSubLines().get(0).getAllSubLines().get(0));
session.getTransactionalEditingDomain().getCommandStack().execute(new SiriusCommand(session.getTransactionalEditingDomain()) {
protected void doExecute() {
lineToAdd.setName("SousAttribut4");
diff --git a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/table/unit/refresh/DTableSynchronizerVSMWithEditorTest.java b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/table/unit/refresh/DTableSynchronizerVSMWithEditorTest.java
index d5ce72daf8..f95da7d27c 100644
--- a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/table/unit/refresh/DTableSynchronizerVSMWithEditorTest.java
+++ b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/table/unit/refresh/DTableSynchronizerVSMWithEditorTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2015 THALES GLOBAL SERVICES and others.
+ * Copyright (c) 2010, 2018 THALES GLOBAL SERVICES and others.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -18,7 +18,7 @@ import java.util.List;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.sirius.common.tools.api.util.SiriusCopier;
import org.eclipse.sirius.ecore.extender.tool.api.ModelUtils;
import org.eclipse.sirius.table.metamodel.table.DTable;
import org.eclipse.sirius.table.metamodel.table.description.ColumnMapping;
@@ -145,8 +145,7 @@ public class DTableSynchronizerVSMWithEditorTest extends TableTestCase {
}
/**
- * Test the table synchronization after deletion of all the columns in the
- * VSM.
+ * Test the table synchronization after deletion of all the columns in the VSM.
*/
public void testRefreshAfterDeleteAllColumns() {
if ("gtk".equals(SWT.getPlatform())) {
@@ -245,7 +244,7 @@ public class DTableSynchronizerVSMWithEditorTest extends TableTestCase {
assertEquals("The number of columns mapping is not correct", 4, columns.size());
// Add 1 column.
- final FeatureColumnMapping columnToAdd = (FeatureColumnMapping) EcoreUtil.copy(columns.get(3));
+ final FeatureColumnMapping columnToAdd = (FeatureColumnMapping) SiriusCopier.Helper.copy(columns.get(3));
session.getTransactionalEditingDomain().getCommandStack().execute(new SiriusCommand(session.getTransactionalEditingDomain()) {
@@ -290,8 +289,7 @@ public class DTableSynchronizerVSMWithEditorTest extends TableTestCase {
* </UL>
*
* @param surroundVSModificationByCloseAndOpen
- * true if the table must be close before VSM modification and
- * open after, false otherwise.
+ * true if the table must be close before VSM modification and open after, false otherwise.
*/
protected void testRefreshFeatureColumnFirstLevelSubLineMapping(boolean surroundVSModificationByCloseAndOpen) {
final TableDescription tableDescription = find(TABLE_DESCRIPTION_ID);
@@ -323,7 +321,7 @@ public class DTableSynchronizerVSMWithEditorTest extends TableTestCase {
}
// Add 1 sub line mapping.
- final LineMapping lineToAdd = (LineMapping) EcoreUtil.copy(lines.get(0).getAllSubLines().get(1));
+ final LineMapping lineToAdd = (LineMapping) SiriusCopier.Helper.copy(lines.get(0).getAllSubLines().get(1));
assertEquals("Bad line to copy", "Attribut2", lineToAdd.getName());
String commandName = "Add a new sub line mapping";
@@ -441,8 +439,7 @@ public class DTableSynchronizerVSMWithEditorTest extends TableTestCase {
* Test the modification of sub line mapping in the VSM.
*
* @param surroundVSModificationByCloseAndOpen
- * true if the table must be close before VSM modification and
- * open after, false otherwise.
+ * true if the table must be close before VSM modification and open after, false otherwise.
*/
protected void testRefreshFeatureColumnOtherLevelSubLineMapping(boolean surroundVSModificationByCloseAndOpen) {
final TableDescription tableDescription = find(TABLE_DESCRIPTION_ID);
@@ -475,7 +472,7 @@ public class DTableSynchronizerVSMWithEditorTest extends TableTestCase {
assertEquals("The number of sub sub line mapping is not correct", 3, lines.get(0).getAllSubLines().get(0).getAllSubLines().size());
// Add 1 sub line to the first sub line of the first line.
- final LineMapping lineToAdd = (LineMapping) EcoreUtil.copy(lines.get(0).getAllSubLines().get(0).getAllSubLines().get(0));
+ final LineMapping lineToAdd = (LineMapping) SiriusCopier.Helper.copy(lines.get(0).getAllSubLines().get(0).getAllSubLines().get(0));
session.getTransactionalEditingDomain().getCommandStack().execute(new SiriusCommand(session.getTransactionalEditingDomain()) {
diff --git a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/table/unit/tools/NoVariableDuplicationTest.java b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/table/unit/tools/NoVariableDuplicationTest.java
index 25b286b4cc..d61ea015fd 100644
--- a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/table/unit/tools/NoVariableDuplicationTest.java
+++ b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/table/unit/tools/NoVariableDuplicationTest.java
@@ -1,7 +1,7 @@
/*******************************************************************************
- * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2018 THALES GLOBAL SERVICES.
* This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
+ * are made available under theier instead of EcoreUtil.Copier in tests
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
@@ -14,6 +14,7 @@ package org.eclipse.sirius.tests.unit.table.unit.tools;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.sirius.common.tools.api.util.SiriusCopier;
import org.eclipse.sirius.table.business.internal.metamodel.TableToolVariables;
import org.eclipse.sirius.table.metamodel.table.description.CreateCellTool;
import org.eclipse.sirius.table.metamodel.table.description.CreateColumnTool;
@@ -36,8 +37,7 @@ import junit.framework.TestCase;
public class NoVariableDuplicationTest extends TestCase {
/**
- * Test that the renaming and copy of createLineTool not duplicates
- * variables.
+ * Test that the renaming and copy of createLineTool not duplicates variables.
*/
public void testNoVariableDuplicationInCreateLineTool() {
// Create createLineTool
@@ -65,8 +65,7 @@ public class NoVariableDuplicationTest extends TestCase {
}
/**
- * Test that the renaming and copy of deleteLineTool not duplicates
- * variables.
+ * Test that the renaming and copy of deleteLineTool not duplicates variables.
*/
public void testNoVariableDuplicationInDeleteLineTool() {
// Create deleteLineTool
@@ -94,8 +93,7 @@ public class NoVariableDuplicationTest extends TestCase {
}
/**
- * Test that the renaming and copy of createCellTool not duplicates
- * variables.
+ * Test that the renaming and copy of createCellTool not duplicates variables.
*/
public void testNoVariableDuplicationInCreateCellTool() {
// Create createCellTool
@@ -123,8 +121,7 @@ public class NoVariableDuplicationTest extends TestCase {
}
/**
- * Test that the renaming and copy of createColumnTool not duplicates
- * variables.
+ * Test that the renaming and copy of createColumnTool not duplicates variables.
*/
public void testNoVariableDuplicationInCreateColumnTool() {
// Create createColumnTool
@@ -152,8 +149,7 @@ public class NoVariableDuplicationTest extends TestCase {
}
/**
- * Test that the renaming and copy of createCrossColumnTool not duplicates
- * variables.
+ * Test that the renaming and copy of createCrossColumnTool not duplicates variables.
*/
public void testNoVariableDuplicationInCreateCrossColumnTool() {
// Create createColumnTool
@@ -181,8 +177,7 @@ public class NoVariableDuplicationTest extends TestCase {
}
/**
- * Test that the renaming and copy of deleteColumnTool not duplicates
- * variables.
+ * Test that the renaming and copy of deleteColumnTool not duplicates variables.
*/
public void testNoVariableDuplicationInDeleteColumnTool() {
// Create deleteColumnTool
@@ -210,8 +205,7 @@ public class NoVariableDuplicationTest extends TestCase {
}
/**
- * Test that the renaming and copy of createLabelEditTool not duplicates
- * variables.
+ * Test that the renaming and copy of createLabelEditTool not duplicates variables.
*/
public void testNoVariableDuplicationInCreateLabelEditTool() {
// Create createLabelEditTool
@@ -242,7 +236,7 @@ public class NoVariableDuplicationTest extends TestCase {
private void checkNoModifOncopy(EObject tool) {
// Copy createLineTool
- EObject copy = EcoreUtil.copy(tool);
+ EObject copy = SiriusCopier.Helper.copy(tool);
assertTrue("The copy must be same that origin", EcoreUtil.equals(tool, copy));
}
diff --git a/plugins/org.eclipse.sirius.tests.tree/src/org/eclipse/sirius/tests/unit/tree/tools/NoVariableDuplicationTest.java b/plugins/org.eclipse.sirius.tests.tree/src/org/eclipse/sirius/tests/unit/tree/tools/NoVariableDuplicationTest.java
index 1388b34463..f6cd7f9d79 100644
--- a/plugins/org.eclipse.sirius.tests.tree/src/org/eclipse/sirius/tests/unit/tree/tools/NoVariableDuplicationTest.java
+++ b/plugins/org.eclipse.sirius.tests.tree/src/org/eclipse/sirius/tests/unit/tree/tools/NoVariableDuplicationTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 THALES GLOBAL SERVICES.
+ * Copyright (c) 2011, 2018 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -14,6 +14,7 @@ package org.eclipse.sirius.tests.unit.tree.tools;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.sirius.common.tools.api.util.SiriusCopier;
import org.eclipse.sirius.tree.business.internal.metamodel.TreeToolVariables;
import org.eclipse.sirius.tree.description.DescriptionFactory;
import org.eclipse.sirius.tree.description.TreeItemContainerDropTool;
@@ -33,8 +34,7 @@ import junit.framework.TestCase;
public class NoVariableDuplicationTest extends TestCase {
/**
- * Test that the renaming and copy of createTreeItemCreationTool not
- * duplicates variables.
+ * Test that the renaming and copy of createTreeItemCreationTool not duplicates variables.
*/
public void testNoVariableDuplicationInCreateTreeItemCreationTool() {
// Create TreeItemmCreationTool
@@ -62,8 +62,7 @@ public class NoVariableDuplicationTest extends TestCase {
}
/**
- * Test that the renaming and copy of treeItemDeletionTool not duplicates
- * variables.
+ * Test that the renaming and copy of treeItemDeletionTool not duplicates variables.
*/
public void testNoVariableDuplicationTreeItemDeletionTool() {
// Create treeItemDeletionTool
@@ -91,8 +90,7 @@ public class NoVariableDuplicationTest extends TestCase {
}
/**
- * Test that the renaming and copy of treeItemEditionTool not duplicates
- * variables.
+ * Test that the renaming and copy of treeItemEditionTool not duplicates variables.
*/
public void testNoVariableDuplicationInCreateTreeItemEditionTool() {
// Create treeItemEditionTool
@@ -123,8 +121,7 @@ public class NoVariableDuplicationTest extends TestCase {
}
/**
- * Test that the renaming and copy of treeItemDragTool not duplicates
- * variables.
+ * Test that the renaming and copy of treeItemDragTool not duplicates variables.
*/
public void testNoVariableDuplicationInCreateTreeItemDragTool() {
// Create treeItemDragTool
@@ -173,7 +170,7 @@ public class NoVariableDuplicationTest extends TestCase {
private void checkNoModifOncopy(EObject tool) {
// Copy createLineTool
- EObject copy = EcoreUtil.copy(tool);
+ EObject copy = SiriusCopier.Helper.copy(tool);
assertTrue("The copy must be same that origin", EcoreUtil.equals(tool, copy));
}

Back to the top