Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorvlorenzo2012-07-26 13:33:01 +0000
committervlorenzo2012-07-26 13:33:01 +0000
commit0b366ce0845a40a607ad8d23d19c5e0b04626aad (patch)
treee3087e8700f5c173208d988834bff2d5d54b7464 /tests
parent3ac3bbda397f432dd74a3a2163b6a957a6fcb4b2 (diff)
downloadorg.eclipse.papyrus-0b366ce0845a40a607ad8d23d19c5e0b04626aad.tar.gz
org.eclipse.papyrus-0b366ce0845a40a607ad8d23d19c5e0b04626aad.tar.xz
org.eclipse.papyrus-0b366ce0845a40a607ad8d23d19c5e0b04626aad.zip
384490: [UML Compare] Comparison between stereotyped elements doesn't work in the nested Compare Editor
https://bugs.eclipse.org/bugs/show_bug.cgi?id=384490
Diffstat (limited to 'tests')
-rw-r--r--tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/resources/nested_one_resource/updateAttributeOneResource_1/model.di17
-rw-r--r--tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/resources/nested_one_resource/updateAttributeOneResource_1/model.notation37
-rw-r--r--tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/resources/nested_one_resource/updateAttributeOneResource_1/model.uml7
-rw-r--r--tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/src/org/eclipse/papyrus/uml/compare/diff/tests/AllTests.java7
-rw-r--r--tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/src/org/eclipse/papyrus/uml/compare/diff/tests/uml/nested/oneresource/AbstractNestedCompareOneResource.java41
-rw-r--r--tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/src/org/eclipse/papyrus/uml/compare/diff/tests/uml/nested/oneresource/AbstractNestedUpdateAttributeResourceLeftTest_1.java138
-rw-r--r--tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/src/org/eclipse/papyrus/uml/compare/diff/tests/uml/nested/oneresource/AbstractNestedUpdateAttributeResourceRightTest_1.java139
-rw-r--r--tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/src/org/eclipse/papyrus/uml/compare/diff/tests/uml/nested/oneresource/NestedUpdateAttributeLeftResourceTest_1_LeftToRight.java31
-rw-r--r--tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/src/org/eclipse/papyrus/uml/compare/diff/tests/uml/nested/oneresource/NestedUpdateAttributeLeftResourceTest_1_RightToLeft.java31
-rw-r--r--tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/src/org/eclipse/papyrus/uml/compare/diff/tests/uml/nested/oneresource/NestedUpdateAttributeRightResourceTest_1_LeftToRight.java31
-rw-r--r--tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/src/org/eclipse/papyrus/uml/compare/diff/tests/uml/nested/oneresource/NestedUpdateAttributeRightResourcetTest_1_RightToLeft.java31
11 files changed, 510 insertions, 0 deletions
diff --git a/tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/resources/nested_one_resource/updateAttributeOneResource_1/model.di b/tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/resources/nested_one_resource/updateAttributeOneResource_1/model.di
new file mode 100644
index 00000000000..55775d5a8e2
--- /dev/null
+++ b/tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/resources/nested_one_resource/updateAttributeOneResource_1/model.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="model.notation#_OxkJ0NbvEeGi_opGqFp2jg"/>
+ </availablePage>
+ </pageList>
+ <sashModel currentSelection="//@sashModel/@windows.0/@children.0">
+ <windows>
+ <children xsi:type="di:TabFolder">
+ <children>
+ <emfPageIdentifier href="model.notation#_OxkJ0NbvEeGi_opGqFp2jg"/>
+ </children>
+ </children>
+ </windows>
+ </sashModel>
+</di:SashWindowsMngr>
diff --git a/tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/resources/nested_one_resource/updateAttributeOneResource_1/model.notation b/tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/resources/nested_one_resource/updateAttributeOneResource_1/model.notation
new file mode 100644
index 00000000000..6e912b6471a
--- /dev/null
+++ b/tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/resources/nested_one_resource/updateAttributeOneResource_1/model.notation
@@ -0,0 +1,37 @@
+<?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/4.0.0/UML" xmi:id="_OxkJ0NbvEeGi_opGqFp2jg" type="PapyrusUMLClassDiagram" name="NewDiagram" measurementUnit="Pixel">
+ <children xmi:type="notation:Shape" xmi:id="_PqumcNbvEeGi_opGqFp2jg" type="2008" fontName="Segoe UI" lineColor="0">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_Pq0tENbvEeGi_opGqFp2jg" source="ShadowFigure">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_Pq1UINbvEeGi_opGqFp2jg" key="ShadowFigure_Value" value="false"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_Pq1UIdbvEeGi_opGqFp2jg" source="displayNameLabelIcon">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_Pq1UItbvEeGi_opGqFp2jg" key="displayNameLabelIcon_value" value="false"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_Pq1UI9bvEeGi_opGqFp2jg" source="QualifiedName">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_Pq1UJNbvEeGi_opGqFp2jg" key="QualifiedNameDepth" value="1000"/>
+ </eAnnotations>
+ <children xmi:type="notation:DecorationNode" xmi:id="_Pq3wYNbvEeGi_opGqFp2jg" type="5029"/>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_Pq6MoNbvEeGi_opGqFp2jg" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_Pq6ModbvEeGi_opGqFp2jg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_Pq6MotbvEeGi_opGqFp2jg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_Pq6Mo9bvEeGi_opGqFp2jg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Pq6zsNbvEeGi_opGqFp2jg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_Pq6zsdbvEeGi_opGqFp2jg" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_Pq6zstbvEeGi_opGqFp2jg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_Pq6zs9bvEeGi_opGqFp2jg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_Pq6ztNbvEeGi_opGqFp2jg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Pq6ztdbvEeGi_opGqFp2jg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_Pq6zttbvEeGi_opGqFp2jg" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_Pq6zt9bvEeGi_opGqFp2jg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_Pq6zuNbvEeGi_opGqFp2jg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_Pq6zudbvEeGi_opGqFp2jg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Pq6zutbvEeGi_opGqFp2jg"/>
+ </children>
+ <element xmi:type="uml:Class" href="model.uml#_PqeHwNbvEeGi_opGqFp2jg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PqumcdbvEeGi_opGqFp2jg" x="188" y="288"/>
+ </children>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_OxkJ0dbvEeGi_opGqFp2jg"/>
+ <element xmi:type="uml:Model" href="model.uml#_Oxf4YNbvEeGi_opGqFp2jg"/>
+</notation:Diagram>
diff --git a/tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/resources/nested_one_resource/updateAttributeOneResource_1/model.uml b/tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/resources/nested_one_resource/updateAttributeOneResource_1/model.uml
new file mode 100644
index 00000000000..eb04e19bd85
--- /dev/null
+++ b/tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/resources/nested_one_resource/updateAttributeOneResource_1/model.uml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Model xmi:version="20110701" xmlns:xmi="http://www.omg.org/spec/XMI/20110701" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML" xmi:id="_Oxf4YNbvEeGi_opGqFp2jg" name="Model">
+ <packageImport xmi:id="_Oxf4YdbvEeGi_opGqFp2jg">
+ <importedPackage xmi:type="uml:Model" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/>
+ </packageImport>
+ <packagedElement xmi:type="uml:Class" xmi:id="_PqeHwNbvEeGi_opGqFp2jg" name="Class1"/>
+</uml:Model>
diff --git a/tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/src/org/eclipse/papyrus/uml/compare/diff/tests/AllTests.java b/tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/src/org/eclipse/papyrus/uml/compare/diff/tests/AllTests.java
index fa0187a6185..cf02fdc2718 100644
--- a/tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/src/org/eclipse/papyrus/uml/compare/diff/tests/AllTests.java
+++ b/tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/src/org/eclipse/papyrus/uml/compare/diff/tests/AllTests.java
@@ -53,6 +53,9 @@ import org.eclipse.papyrus.uml.compare.diff.tests.standalone.UpdateReferenceTest
import org.eclipse.papyrus.uml.compare.diff.tests.standalone.UpdateReferenceTest_1_RightToLeft;
import org.eclipse.papyrus.uml.compare.diff.tests.standalone.UpdateReferenceTest_2_LeftToRight;
import org.eclipse.papyrus.uml.compare.diff.tests.standalone.UpdateReferenceTest_2_RightToLeft;
+import org.eclipse.papyrus.uml.compare.diff.tests.uml.nested.oneresource.NestedUpdateAttributeRightResourceTest_1_LeftToRight;
+import org.eclipse.papyrus.uml.compare.diff.tests.uml.nested.oneresource.NestedUpdateAttributeLeftResourceTest_1_RightToLeft;
+import org.eclipse.papyrus.uml.compare.diff.tests.uml.nested.oneresource.NestedUpdateAttributeRightResourcetTest_1_RightToLeft;
import org.eclipse.papyrus.uml.compare.diff.tests.uml.profile.nested.NestedStereotypeApplicationAdditionTest_1_LeftToRight;
import org.eclipse.papyrus.uml.compare.diff.tests.uml.profile.nested.NestedStereotypeApplicationAdditionTest_1_RightToLeft;
import org.eclipse.papyrus.uml.compare.diff.tests.uml.profile.nested.NestedStereotypeApplicationAdditionTest_2_LeftToRight;
@@ -118,6 +121,10 @@ NestedStereotypeApplicationRemovalTest_1_LeftToRight.class, NestedStereotypeAppl
NestedStereotypeApplicationRemovalTest_2_LeftToRight.class, NestedStereotypeApplicationRemovalTest_2_RightToLeft.class,
+NestedUpdateAttributeLeftResourceTest_1_RightToLeft.class, NestedUpdateAttributeLeftResourceTest_1_RightToLeft.class,
+
+NestedUpdateAttributeRightResourceTest_1_LeftToRight.class, NestedUpdateAttributeRightResourcetTest_1_RightToLeft.class,
+
AttributeChangeLeftTargetTest_1_LeftToRight.class, AttributeChangeLeftTargetTest_1_RightToLeft.class,
AttributeChangeRightTargetTest_1_LeftToRight.class, AttributeChangeRightTargetTest_1_RightToLeft.class,
diff --git a/tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/src/org/eclipse/papyrus/uml/compare/diff/tests/uml/nested/oneresource/AbstractNestedCompareOneResource.java b/tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/src/org/eclipse/papyrus/uml/compare/diff/tests/uml/nested/oneresource/AbstractNestedCompareOneResource.java
new file mode 100644
index 00000000000..fda4bc61c6a
--- /dev/null
+++ b/tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/src/org/eclipse/papyrus/uml/compare/diff/tests/uml/nested/oneresource/AbstractNestedCompareOneResource.java
@@ -0,0 +1,41 @@
+/*****************************************************************************
+ * Copyright (c) 2012 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:
+ * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.compare.diff.tests.uml.nested.oneresource;
+
+import java.io.IOException;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.papyrus.infra.core.resource.ModelMultiException;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.uml.compare.diff.tests.nested.AbstractNestedCompareTest;
+import org.eclipse.uml2.uml.Package;
+
+/**
+ *
+ * This class is used for tests which test the comparison between an element of the model
+ * and an element in memory
+ *
+ */
+public abstract class AbstractNestedCompareOneResource extends AbstractNestedCompareTest {
+
+ /** the root of the model used for the test */
+ protected static Package root;
+
+ private static final String FOLDER_PATH = "/resources/nested_one_resource/";
+
+ public static final void init_(final String modelPath, boolean leftToRight) throws CoreException, IOException, ServiceException, ModelMultiException {
+ AbstractNestedCompareTest.init(FOLDER_PATH, modelPath, leftToRight);
+ }
+
+}
diff --git a/tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/src/org/eclipse/papyrus/uml/compare/diff/tests/uml/nested/oneresource/AbstractNestedUpdateAttributeResourceLeftTest_1.java b/tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/src/org/eclipse/papyrus/uml/compare/diff/tests/uml/nested/oneresource/AbstractNestedUpdateAttributeResourceLeftTest_1.java
new file mode 100644
index 00000000000..1c4d4e2df95
--- /dev/null
+++ b/tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/src/org/eclipse/papyrus/uml/compare/diff/tests/uml/nested/oneresource/AbstractNestedUpdateAttributeResourceLeftTest_1.java
@@ -0,0 +1,138 @@
+/*****************************************************************************
+ * Copyright (c) 2012 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:
+ * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.compare.diff.tests.uml.nested.oneresource;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.emf.compare.diff.metamodel.DiffElement;
+import org.eclipse.emf.compare.diff.metamodel.UpdateAttribute;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.papyrus.infra.core.resource.ModelMultiException;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.uml.compare.diff.tests.AbstractCompareTest;
+import org.eclipse.papyrus.uml.compare.diff.tests.nested.AbstractNestedCompareTest;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.UMLFactory;
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ *
+ * This class allow to test only the correct construction of the DiffModel
+ *
+ */
+//TODO try to merge this test with NestedUpdateAttributeResource
+public abstract class AbstractNestedUpdateAttributeResourceLeftTest_1 extends AbstractNestedCompareOneResource {
+
+ private static final String MODEL_PATH = "updateAttributeOneResource_1/"; //$NON-NLS-1$
+
+ public static void init_(boolean leftToRight) throws ModelMultiException, CoreException, IOException, ServiceException {
+ AbstractNestedCompareOneResource.init_(MODEL_PATH, leftToRight);
+ Class myClass = UMLFactory.eINSTANCE.createClass();
+ AbstractCompareTest.leftElement = AbstractNestedCompareTest.root.getOwnedMembers().get(0); //$NON-NLS-1$
+ AbstractCompareTest.rightElement = myClass;
+ Assert.assertNotNull(leftElement.eResource());
+ Assert.assertNull(rightElement.eResource());
+ }
+
+ @Test
+ public void testDifferences() throws InterruptedException {
+ super.testDifferences();
+ }
+
+ public void testLastDiffElements(List<DiffElement> diffElements) {
+ Assert.assertTrue(NLS.bind("The number of DiffElement is not correct : we would like {0} DiffElement, and we found {1}", new Object[]{ 1, diffElements.size() }), diffElements.size() == 1);
+ final DiffElement diffElement = diffElements.get(0);
+ Assert.assertTrue(NLS.bind("The last DiffElement is not a {0}", UpdateAttribute.class), diffElement instanceof UpdateAttribute);
+ }
+
+ @Ignore("not yet implemented")
+ @Test
+ public void mergeTestAllExecutability() throws InterruptedException {
+ super.mergeTestAllExecutability();
+ }
+
+ @Ignore("not yet implemented")
+ @Override
+ @Test
+ public void testCommandExecution() throws InterruptedException, IOException {
+ super.testCommandExecution();
+ }
+
+ @Ignore("not yet implemented")
+ @Override
+ @Test
+ public void testModificationOnDiFile() {
+ super.testModificationOnDiFile(false);
+ }
+
+ @Ignore("not yet implemented")
+ @Override
+ @Test
+ public void testModificationOnNotationFile() {
+ super.testModificationOnNotationFile(false);
+ }
+
+ @Ignore("not yet implemented")
+ @Override
+ @Test
+ public void testModificationOnUMLFile() {
+ super.testModificationOnUMLFile(true);
+ }
+
+ @Ignore("not yet implemented")
+ @Override
+ @Test
+ public void saveTest() throws IOException {
+ super.saveTest();
+ }
+
+ @Ignore("not yet implemented")
+ @Override
+ @Test
+ public void testResult() throws InterruptedException {
+ super.testResult();
+ }
+
+ @Ignore("not yet implemented")
+ @Override
+ @Test
+ public void testXMIID() {
+ //nothing to do
+ }
+
+ @Ignore("not yet implemented")
+ @Override
+ @Test
+ public void testUndo() throws IOException, InterruptedException {
+ super.testUndo();
+ }
+
+ @Ignore("not yet implemented")
+ @Override
+ @Test
+ public void testRedo() throws IOException, InterruptedException {
+ super.testRedo();
+ }
+
+ @Ignore("not yet implemented")
+ @Test
+ public void testOneDiffCommandExecution() throws IOException, InterruptedException {
+ super.testOneDiffCommandExecution();
+ }
+
+}
diff --git a/tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/src/org/eclipse/papyrus/uml/compare/diff/tests/uml/nested/oneresource/AbstractNestedUpdateAttributeResourceRightTest_1.java b/tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/src/org/eclipse/papyrus/uml/compare/diff/tests/uml/nested/oneresource/AbstractNestedUpdateAttributeResourceRightTest_1.java
new file mode 100644
index 00000000000..493a60205c2
--- /dev/null
+++ b/tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/src/org/eclipse/papyrus/uml/compare/diff/tests/uml/nested/oneresource/AbstractNestedUpdateAttributeResourceRightTest_1.java
@@ -0,0 +1,139 @@
+/*****************************************************************************
+ * Copyright (c) 2012 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:
+ * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.compare.diff.tests.uml.nested.oneresource;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.emf.compare.diff.metamodel.DiffElement;
+import org.eclipse.emf.compare.diff.metamodel.UpdateAttribute;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.papyrus.infra.core.resource.ModelMultiException;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.uml.compare.diff.tests.AbstractCompareTest;
+import org.eclipse.papyrus.uml.compare.diff.tests.nested.AbstractNestedCompareTest;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.UMLFactory;
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ *
+ * This class allow to test only the correct construction of the DiffModel
+ *
+ */
+//TODO : try to merge this test with NestedUpdateAttributeResource
+public abstract class AbstractNestedUpdateAttributeResourceRightTest_1 extends AbstractNestedCompareOneResource {
+
+ private static final String MODEL_PATH = "updateAttributeOneResource_1/"; //$NON-NLS-1$
+
+ public static void init_(boolean leftToRight) throws ModelMultiException, CoreException, IOException, ServiceException {
+ AbstractNestedCompareOneResource.init_(MODEL_PATH, leftToRight);
+ Class myClass = UMLFactory.eINSTANCE.createClass();
+ myClass.setName("Class2");
+ AbstractCompareTest.rightElement = AbstractNestedCompareTest.root.getOwnedMembers().get(0); //$NON-NLS-1$
+ AbstractCompareTest.leftElement = myClass;
+ Assert.assertNull(leftElement.eResource());
+ Assert.assertNotNull(rightElement.eResource());
+ }
+
+ @Test
+ public void testDifferences() throws InterruptedException {
+ super.testDifferences();
+ }
+
+ public void testLastDiffElements(List<DiffElement> diffElements) {
+ Assert.assertTrue(NLS.bind("The number of DiffElement is not correct : we would like {0} DiffElement, and we found {1}", new Object[]{ 1, diffElements.size() }), diffElements.size() == 1);
+ final DiffElement diffElement = diffElements.get(0);
+ Assert.assertTrue(NLS.bind("The last DiffElement is not a {0}", UpdateAttribute.class), diffElement instanceof UpdateAttribute);
+ }
+
+ @Ignore("not yet implemented")
+ @Test
+ public void mergeTestAllExecutability() throws InterruptedException {
+ super.mergeTestAllExecutability();
+ }
+
+ @Ignore("not yet implemented")
+ @Override
+ @Test
+ public void testCommandExecution() throws InterruptedException, IOException {
+ super.testCommandExecution();
+ }
+
+ @Ignore("not yet implemented")
+ @Override
+ @Test
+ public void testModificationOnDiFile() {
+ super.testModificationOnDiFile(false);
+ }
+
+ @Ignore("not yet implemented")
+ @Override
+ @Test
+ public void testModificationOnNotationFile() {
+ super.testModificationOnNotationFile(false);
+ }
+
+ @Ignore("not yet implemented")
+ @Override
+ @Test
+ public void testModificationOnUMLFile() {
+ super.testModificationOnUMLFile(true);
+ }
+
+ @Ignore("not yet implemented")
+ @Override
+ @Test
+ public void saveTest() throws IOException {
+ super.saveTest();
+ }
+
+ @Ignore("not yet implemented")
+ @Override
+ @Test
+ public void testResult() throws InterruptedException {
+ super.testResult();
+ }
+
+ @Ignore("not yet implemented")
+ @Override
+ @Test
+ public void testXMIID() {
+ //nothing to do
+ }
+
+ @Ignore("not yet implemented")
+ @Override
+ @Test
+ public void testUndo() throws IOException, InterruptedException {
+ super.testUndo();
+ }
+
+ @Ignore("not yet implemented")
+ @Override
+ @Test
+ public void testRedo() throws IOException, InterruptedException {
+ super.testRedo();
+ }
+
+ @Ignore("not yet implemented")
+ @Test
+ public void testOneDiffCommandExecution() throws IOException, InterruptedException {
+ super.testOneDiffCommandExecution();
+ }
+
+}
diff --git a/tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/src/org/eclipse/papyrus/uml/compare/diff/tests/uml/nested/oneresource/NestedUpdateAttributeLeftResourceTest_1_LeftToRight.java b/tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/src/org/eclipse/papyrus/uml/compare/diff/tests/uml/nested/oneresource/NestedUpdateAttributeLeftResourceTest_1_LeftToRight.java
new file mode 100644
index 00000000000..da0578f4ebc
--- /dev/null
+++ b/tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/src/org/eclipse/papyrus/uml/compare/diff/tests/uml/nested/oneresource/NestedUpdateAttributeLeftResourceTest_1_LeftToRight.java
@@ -0,0 +1,31 @@
+/*****************************************************************************
+ * Copyright (c) 2012 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:
+ * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.compare.diff.tests.uml.nested.oneresource;
+
+import java.io.IOException;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.papyrus.infra.core.resource.ModelMultiException;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.junit.BeforeClass;
+
+
+public class NestedUpdateAttributeLeftResourceTest_1_LeftToRight extends AbstractNestedUpdateAttributeResourceLeftTest_1 {
+
+ @BeforeClass
+ public static void init() throws CoreException, IOException, ModelMultiException, ServiceException {
+ AbstractNestedUpdateAttributeResourceLeftTest_1.init_(true);
+ }
+
+}
diff --git a/tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/src/org/eclipse/papyrus/uml/compare/diff/tests/uml/nested/oneresource/NestedUpdateAttributeLeftResourceTest_1_RightToLeft.java b/tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/src/org/eclipse/papyrus/uml/compare/diff/tests/uml/nested/oneresource/NestedUpdateAttributeLeftResourceTest_1_RightToLeft.java
new file mode 100644
index 00000000000..dd331e37ec8
--- /dev/null
+++ b/tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/src/org/eclipse/papyrus/uml/compare/diff/tests/uml/nested/oneresource/NestedUpdateAttributeLeftResourceTest_1_RightToLeft.java
@@ -0,0 +1,31 @@
+/*****************************************************************************
+ * Copyright (c) 2012 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:
+ * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.compare.diff.tests.uml.nested.oneresource;
+
+import java.io.IOException;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.papyrus.infra.core.resource.ModelMultiException;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.junit.BeforeClass;
+
+
+public class NestedUpdateAttributeLeftResourceTest_1_RightToLeft extends AbstractNestedUpdateAttributeResourceLeftTest_1 {
+
+ @BeforeClass
+ public static void init() throws CoreException, IOException, ModelMultiException, ServiceException {
+ AbstractNestedUpdateAttributeResourceLeftTest_1.init_(false);
+ }
+
+}
diff --git a/tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/src/org/eclipse/papyrus/uml/compare/diff/tests/uml/nested/oneresource/NestedUpdateAttributeRightResourceTest_1_LeftToRight.java b/tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/src/org/eclipse/papyrus/uml/compare/diff/tests/uml/nested/oneresource/NestedUpdateAttributeRightResourceTest_1_LeftToRight.java
new file mode 100644
index 00000000000..778dcfaec1d
--- /dev/null
+++ b/tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/src/org/eclipse/papyrus/uml/compare/diff/tests/uml/nested/oneresource/NestedUpdateAttributeRightResourceTest_1_LeftToRight.java
@@ -0,0 +1,31 @@
+/*****************************************************************************
+ * Copyright (c) 2012 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:
+ * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.compare.diff.tests.uml.nested.oneresource;
+
+import java.io.IOException;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.papyrus.infra.core.resource.ModelMultiException;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.junit.BeforeClass;
+
+
+public class NestedUpdateAttributeRightResourceTest_1_LeftToRight extends AbstractNestedUpdateAttributeResourceRightTest_1 {
+
+ @BeforeClass
+ public static void init() throws CoreException, IOException, ModelMultiException, ServiceException {
+ AbstractNestedUpdateAttributeResourceRightTest_1.init_(true);
+ }
+
+}
diff --git a/tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/src/org/eclipse/papyrus/uml/compare/diff/tests/uml/nested/oneresource/NestedUpdateAttributeRightResourcetTest_1_RightToLeft.java b/tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/src/org/eclipse/papyrus/uml/compare/diff/tests/uml/nested/oneresource/NestedUpdateAttributeRightResourcetTest_1_RightToLeft.java
new file mode 100644
index 00000000000..9b1ddd0c163
--- /dev/null
+++ b/tests/junit/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.diff.tests/src/org/eclipse/papyrus/uml/compare/diff/tests/uml/nested/oneresource/NestedUpdateAttributeRightResourcetTest_1_RightToLeft.java
@@ -0,0 +1,31 @@
+/*****************************************************************************
+ * Copyright (c) 2012 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:
+ * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.compare.diff.tests.uml.nested.oneresource;
+
+import java.io.IOException;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.papyrus.infra.core.resource.ModelMultiException;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.junit.BeforeClass;
+
+
+public class NestedUpdateAttributeRightResourcetTest_1_RightToLeft extends AbstractNestedUpdateAttributeResourceRightTest_1 {
+
+ @BeforeClass
+ public static void init() throws CoreException, IOException, ModelMultiException, ServiceException {
+ AbstractNestedUpdateAttributeResourceRightTest_1.init_(false);
+ }
+
+}

Back to the top