Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikaël Barbero2012-11-09 11:15:47 +0000
committerMikaël Barbero2012-11-09 11:15:47 +0000
commiteccb588c645070a251c8b23a5968599f0cd8e887 (patch)
treed794130ea2f195e83d274fa6694cb1b1dc3dddc2 /plugins/org.eclipse.emf.compare.uml2.tests/src
parente517d0862abac093893db9f1c5805a90312bed0a (diff)
downloadorg.eclipse.emf.compare-eccb588c645070a251c8b23a5968599f0cd8e887.tar.gz
org.eclipse.emf.compare-eccb588c645070a251c8b23a5968599f0cd8e887.tar.xz
org.eclipse.emf.compare-eccb588c645070a251c8b23a5968599f0cd8e887.zip
add test for profile application, static and dynamic
Diffstat (limited to 'plugins/org.eclipse.emf.compare.uml2.tests/src')
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/ProfileTest.java75
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/data/a1/left.uml10
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/data/dynamic/DynamicProfileInputData.java17
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/data/dynamic/a1/left.uml10
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/data/dynamic/a1/right.uml4
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/data/static_/StaticProfileInputData.java (renamed from plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/data/ProfileInputData.java)4
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/data/static_/a1/left.uml10
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/data/static_/a1/right.uml (renamed from plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/data/a1/right.uml)0
8 files changed, 102 insertions, 28 deletions
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/ProfileTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/ProfileTest.java
index a52492f3f..2c94f4cde 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/ProfileTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/ProfileTest.java
@@ -23,7 +23,8 @@ import org.eclipse.emf.compare.scope.IComparisonScope;
import org.eclipse.emf.compare.tests.framework.AbstractInputData;
import org.eclipse.emf.compare.uml2.ProfileApplicationChange;
import org.eclipse.emf.compare.uml2.tests.AbstractTest;
-import org.eclipse.emf.compare.uml2.tests.profiles.data.ProfileInputData;
+import org.eclipse.emf.compare.uml2.tests.profiles.data.dynamic.DynamicProfileInputData;
+import org.eclipse.emf.compare.uml2.tests.profiles.data.static_.StaticProfileInputData;
import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
@@ -34,11 +35,13 @@ import org.junit.Test;
@SuppressWarnings("nls")
public class ProfileTest extends AbstractTest {
- private ProfileInputData input = new ProfileInputData();
+ private StaticProfileInputData staticInput = new StaticProfileInputData();
+
+ private DynamicProfileInputData dynamicInput = new DynamicProfileInputData();
@After
public void cleanup() {
- for (ResourceSet set : input.getSets()) {
+ for (ResourceSet set : staticInput.getSets()) {
for (Resource res : set.getResources()) {
res.unload();
}
@@ -47,9 +50,49 @@ public class ProfileTest extends AbstractTest {
}
@Test
- public void testA10UseCase() throws IOException {
- final Resource left = input.getA1Left();
- final Resource right = input.getA1Right();
+ public void testStaticA10UseCase() throws IOException {
+ final Resource left = staticInput.getA1Left();
+ final Resource right = staticInput.getA1Right();
+
+ final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
+ final Comparison comparison = getCompare().compare(scope);
+ testAB1(TestKind.ADD, comparison);
+ }
+
+ @Test
+ public void testStaticA11UseCase() throws IOException {
+ final Resource left = staticInput.getA1Left();
+ final Resource right = staticInput.getA1Right();
+
+ final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
+ final Comparison comparison = getCompare().compare(scope);
+ testAB1(TestKind.DELETE, comparison);
+ }
+
+ @Test
+ public void testStaticA10UseCase3way() throws IOException {
+ final Resource left = staticInput.getA1Left();
+ final Resource right = staticInput.getA1Right();
+
+ final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
+ final Comparison comparison = getCompare().compare(scope);
+ testAB1(TestKind.ADD, comparison);
+ }
+
+ @Test
+ public void testStaticA11UseCase3way() throws IOException {
+ final Resource left = staticInput.getA1Left();
+ final Resource right = staticInput.getA1Right();
+
+ final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
+ final Comparison comparison = getCompare().compare(scope);
+ testAB1(TestKind.DELETE, comparison);
+ }
+
+ @Test
+ public void testDynamicA10UseCase() throws IOException {
+ final Resource left = dynamicInput.getA1Left();
+ final Resource right = dynamicInput.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
final Comparison comparison = getCompare().compare(scope);
@@ -57,9 +100,9 @@ public class ProfileTest extends AbstractTest {
}
@Test
- public void testA11UseCase() throws IOException {
- final Resource left = input.getA1Left();
- final Resource right = input.getA1Right();
+ public void testDynamicA11UseCase() throws IOException {
+ final Resource left = dynamicInput.getA1Left();
+ final Resource right = dynamicInput.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
final Comparison comparison = getCompare().compare(scope);
@@ -67,9 +110,9 @@ public class ProfileTest extends AbstractTest {
}
@Test
- public void testA10UseCase3way() throws IOException {
- final Resource left = input.getA1Left();
- final Resource right = input.getA1Right();
+ public void testDynamicA10UseCase3way() throws IOException {
+ final Resource left = dynamicInput.getA1Left();
+ final Resource right = dynamicInput.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
final Comparison comparison = getCompare().compare(scope);
@@ -77,9 +120,9 @@ public class ProfileTest extends AbstractTest {
}
@Test
- public void testA11UseCase3way() throws IOException {
- final Resource left = input.getA1Left();
- final Resource right = input.getA1Right();
+ public void testDynamicA11UseCase3way() throws IOException {
+ final Resource left = dynamicInput.getA1Left();
+ final Resource right = dynamicInput.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
final Comparison comparison = getCompare().compare(scope);
@@ -195,7 +238,7 @@ public class ProfileTest extends AbstractTest {
@Override
protected AbstractInputData getInput() {
- return input;
+ return staticInput;
}
}
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/data/a1/left.uml b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/data/a1/left.uml
deleted file mode 100644
index 386cc4836..000000000
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/data/a1/left.uml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<uml:Model xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML" xmi:id="_m5rhMGUHEeC0XeUZ1BZPOA" name="aModel">
- <packagedElement xmi:type="uml:Package" xmi:id="_lOAhMNfUEeCgmr8B8wc0rg"/>
- <profileApplication xmi:id="_osVMIOJHEeGxC9WFcOwhug">
- <eAnnotations xmi:id="_osVzMOJHEeGxC9WFcOwhug" source="http://www.eclipse.org/uml2/4.0.0/UML">
- <references xmi:type="ecore:EPackage" href="pathmap://UML_PROFILES/Ecore.profile.uml#_z1OFcHjqEdy8S4Cr8Rc_NA"/>
- </eAnnotations>
- <appliedProfile href="pathmap://UML_PROFILES/Ecore.profile.uml#_0"/>
- </profileApplication>
-</uml:Model>
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/data/dynamic/DynamicProfileInputData.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/data/dynamic/DynamicProfileInputData.java
new file mode 100644
index 000000000..84ce63451
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/data/dynamic/DynamicProfileInputData.java
@@ -0,0 +1,17 @@
+package org.eclipse.emf.compare.uml2.tests.profiles.data.dynamic;
+
+import java.io.IOException;
+
+import org.eclipse.emf.compare.uml2.tests.ProfilesInputData;
+import org.eclipse.emf.ecore.resource.Resource;
+
+public class DynamicProfileInputData extends ProfilesInputData {
+
+ public Resource getA1Left() throws IOException {
+ return loadFromClassLoader("a1/left.uml");
+ }
+
+ public Resource getA1Right() throws IOException {
+ return loadFromClassLoader("a1/right.uml");
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/data/dynamic/a1/left.uml b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/data/dynamic/a1/left.uml
new file mode 100644
index 000000000..9894c400f
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/data/dynamic/a1/left.uml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Model xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML" xmi:id="_6rQaMGBlEeCwQ5tRW0zUZA" name="aModel">
+ <packagedElement xmi:type="uml:Class" xmi:id="_OEBOkPNPEeG0ipjyqWM1zA" name="Test"/>
+ <profileApplication xmi:id="_WsrGcPNPEeG0ipjyqWM1zA">
+ <eAnnotations xmi:id="_WsrGcfNPEeG0ipjyqWM1zA" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <references xmi:type="ecore:EPackage" href="pathmap://UML_COMPARE_TESTS_PROFILE/uml2.compare.testprofile.profile.uml#_DL_B8CjtEeKqNZFxtZ0S6g"/>
+ </eAnnotations>
+ <appliedProfile href="pathmap://UML_COMPARE_TESTS_PROFILE/uml2.compare.testprofile.profile.uml#_hZFTgIwkEeC_FYHMbTTxXw"/>
+ </profileApplication>
+</uml:Model>
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/data/dynamic/a1/right.uml b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/data/dynamic/a1/right.uml
new file mode 100644
index 000000000..62558c3b1
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/data/dynamic/a1/right.uml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Model xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML" xmi:id="_6rQaMGBlEeCwQ5tRW0zUZA" name="aModel">
+ <packagedElement xmi:type="uml:Class" xmi:id="_OEBOkPNPEeG0ipjyqWM1zA" name="Test"/>
+</uml:Model>
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/data/ProfileInputData.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/data/static_/StaticProfileInputData.java
index 9a6511afb..fe5217c89 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/data/ProfileInputData.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/data/static_/StaticProfileInputData.java
@@ -1,11 +1,11 @@
-package org.eclipse.emf.compare.uml2.tests.profiles.data;
+package org.eclipse.emf.compare.uml2.tests.profiles.data.static_;
import java.io.IOException;
import org.eclipse.emf.compare.uml2.tests.ProfilesInputData;
import org.eclipse.emf.ecore.resource.Resource;
-public class ProfileInputData extends ProfilesInputData {
+public class StaticProfileInputData extends ProfilesInputData {
public Resource getA1Left() throws IOException {
return loadFromClassLoader("a1/left.uml"); //$NON-NLS-1$
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/data/static_/a1/left.uml b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/data/static_/a1/left.uml
new file mode 100644
index 000000000..7fe7b3a81
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/data/static_/a1/left.uml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Model xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML" xmi:id="_m5rhMGUHEeC0XeUZ1BZPOA" name="aModel">
+ <packagedElement xmi:type="uml:Package" xmi:id="_lOAhMNfUEeCgmr8B8wc0rg"/>
+ <profileApplication xmi:id="_WsrGcPNPEeG0ipjyqWM1zA">
+ <eAnnotations xmi:id="_WsrGcfNPEeG0ipjyqWM1zA" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/emf/compare/uml2/1.0.0/testprofile#//uml2comparetestprofile"/>
+ </eAnnotations>
+ <appliedProfile href="pathmap://UML_COMPARE_TESTS_PROFILE/uml2.compare.testprofile.profile.uml#_hZFTgIwkEeC_FYHMbTTxXw"/>
+ </profileApplication>
+</uml:Model>
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/data/a1/right.uml b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/data/static_/a1/right.uml
index 85e206822..85e206822 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/data/a1/right.uml
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/data/static_/a1/right.uml

Back to the top