Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Langer2014-12-18 12:53:29 -0500
committerAxel RICHARD2014-12-19 09:54:58 -0500
commit5da79abd27094cb3b12757ba5f82e4378c9e9f3d (patch)
tree471a5fb0d12edc0b5c67d68b34466ab22c2fbbd4 /plugins/org.eclipse.emf.compare.uml2.tests
parent0c9a457cb9dfe7167b96e4bb109af8f6be5b4612 (diff)
downloadorg.eclipse.emf.compare-5da79abd27094cb3b12757ba5f82e4378c9e9f3d.tar.gz
org.eclipse.emf.compare-5da79abd27094cb3b12757ba5f82e4378c9e9f3d.tar.xz
org.eclipse.emf.compare-5da79abd27094cb3b12757ba5f82e4378c9e9f3d.zip
[455677] Fixes insertion index of opaque element body values additions
Instead of relying on the DiffUtil.findInsertionIndex, which finds the insertion index on a best effort basis and does not know about the connection between language and body values, we now ensure that we always merge the language value first and then select the insertion index for the body value based on the index of the already merged language value. Bug: 455677 Change-Id: Icf3ff278e9ec55f2fc9440f537459d73d7267bb6 Signed-off-by: Philip Langer <planger@eclipsesource.com>
Diffstat (limited to 'plugins/org.eclipse.emf.compare.uml2.tests')
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/opaque/OpaqueElementBodyChangeMergeTest.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/opaque/OpaqueElementBodyChangeMergeTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/opaque/OpaqueElementBodyChangeMergeTest.java
index 444da5f97..78c576dc1 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/opaque/OpaqueElementBodyChangeMergeTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/opaque/OpaqueElementBodyChangeMergeTest.java
@@ -473,6 +473,35 @@ public class OpaqueElementBodyChangeMergeTest extends AbstractUMLTest {
}
@Test
+ public void testA10UseCaseRtoL_RevertLeftDeletion() throws IOException {
+ Resource origin = input.getA10Origin();
+ Resource left = input.getA10Left();
+ Resource right = input.getA10Right();
+
+ Comparison comparison = compare(left, right, origin);
+ assertNoRealConflict(comparison);
+
+ revertLeftOpaqueElementBodyChanges(comparison);
+
+ EObject leftEObject = left.getEObject(OPAQUE_ACTION1_ID);
+ OpaqueAction leftOpaqueAction = (OpaqueAction)leftEObject;
+
+ String leftLanguageAt0 = leftOpaqueAction.getLanguages().get(0);
+ String leftBodyAt0 = leftOpaqueAction.getBodies().get(0);
+
+ assertEquals("JAVA", leftLanguageAt0);
+ assertEquals(EXPECTED_JAVA, leftBodyAt0);
+
+ String leftLanguageAt1 = leftOpaqueAction.getLanguages().get(1);
+ String leftBodyAt1 = leftOpaqueAction.getBodies().get(1);
+
+ assertEquals("OCL", leftLanguageAt1);
+ assertEquals(EXPECTED_OCL, leftBodyAt1);
+ }
+
+ // reverting addition and insertion index?
+
+ @Test
public void testA11UseCase() throws IOException {
Resource origin = input.getA11Origin();
Resource left = input.getA11Left();

Back to the top