Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests')
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/conflict/ConflictDetectionTest.java18
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/conflict/data/ConflictInputData.java12
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/conflict/data/i/conflict_i_left.nodes10
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/conflict/data/i/conflict_i_origin.nodes14
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/conflict/data/i/conflict_i_right.nodes13
5 files changed, 67 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/conflict/ConflictDetectionTest.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/conflict/ConflictDetectionTest.java
index 0a851f0e4..b99f6ae2a 100644
--- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/conflict/ConflictDetectionTest.java
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/conflict/ConflictDetectionTest.java
@@ -1963,6 +1963,24 @@ public class ConflictDetectionTest {
}
@Test
+ public void testIUseCase() throws IOException {
+ final Resource left = input.getILeft();
+ final Resource origin = input.getIOrigin();
+ final Resource right = input.getIRight();
+
+ final Comparison comparison = EMFCompare.compare(left, right, origin);
+
+ final List<Diff> differences = comparison.getDifferences();
+ final List<Conflict> conflicts = comparison.getConflicts();
+
+ assertSame(Integer.valueOf(5), Integer.valueOf(differences.size()));
+ assertSame(Integer.valueOf(1), Integer.valueOf(conflicts.size()));
+
+ Conflict soleConflict = conflicts.get(0);
+ assertSame(ConflictKind.PSEUDO, soleConflict.getKind());
+ }
+
+ @Test
public void testComplexUseCase() throws IOException {
final Resource left = input.getComplexLeft();
final Resource origin = input.getComplexOrigin();
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/conflict/data/ConflictInputData.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/conflict/data/ConflictInputData.java
index 56cb1f184..69ffc79ee 100644
--- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/conflict/data/ConflictInputData.java
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/conflict/data/ConflictInputData.java
@@ -574,6 +574,18 @@ public class ConflictInputData extends AbstractInputData {
return loadFromClassloader("h2/conflict_h2_right.nodes");
}
+ public Resource getILeft() throws IOException {
+ return loadFromClassloader("i/conflict_i_left.nodes");
+ }
+
+ public Resource getIOrigin() throws IOException {
+ return loadFromClassloader("i/conflict_i_origin.nodes");
+ }
+
+ public Resource getIRight() throws IOException {
+ return loadFromClassloader("i/conflict_i_right.nodes");
+ }
+
public Resource getComplexLeft() throws IOException {
return loadFromClassloader("complex/conflict_complex_left.nodes");
}
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/conflict/data/i/conflict_i_left.nodes b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/conflict/data/i/conflict_i_left.nodes
new file mode 100644
index 000000000..7c1599908
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/conflict/data/i/conflict_i_left.nodes
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="ASCII"?>
+<nodes:Node
+ xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:nodes="http://www.eclipse.org/emf/compare/tests/nodes"
+ xmi:id="_rqDnEJRfEeGwLqrAWz-_6w"
+ name="P">
+
+</nodes:Node>
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/conflict/data/i/conflict_i_origin.nodes b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/conflict/data/i/conflict_i_origin.nodes
new file mode 100644
index 000000000..0e617e3c4
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/conflict/data/i/conflict_i_origin.nodes
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="ASCII"?>
+<nodes:Node
+ xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:nodes="http://www.eclipse.org/emf/compare/tests/nodes"
+ xmi:id="_rqDnEJRfEeGwLqrAWz-_6w"
+ name="P">
+ <containmentRef1 xmi:id="_Np10YJRiEeGwLqrAWz-_6w" name="C">
+ <containmentRef1 xmi:id="_Np11YJRiEeGwLqrAWz-_7w" name="A1"/>
+ <containmentRef1 xmi:id="_Np12YJRiEeGwLqrAWz-_8w" name="A2"/>
+ <containmentRef1 xmi:id="_Np13YJRiEeGwLqrAWz-_9w" name="A3"/>
+ </containmentRef1>
+</nodes:Node>
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/conflict/data/i/conflict_i_right.nodes b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/conflict/data/i/conflict_i_right.nodes
new file mode 100644
index 000000000..cd1e0b567
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/conflict/data/i/conflict_i_right.nodes
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="ASCII"?>
+<nodes:Node
+ xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:nodes="http://www.eclipse.org/emf/compare/tests/nodes"
+ xmi:id="_rqDnEJRfEeGwLqrAWz-_6w"
+ name="P">
+ <containmentRef1 xmi:id="_Np10YJRiEeGwLqrAWz-_6w" name="C">
+ <containmentRef1 xmi:id="_Np11YJRiEeGwLqrAWz-_7w" name="A1"/>
+ <containmentRef1 xmi:id="_Np12YJRiEeGwLqrAWz-_8w" name="A2"/>
+ </containmentRef1>
+</nodes:Node>

Back to the top