Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlgoubet2012-03-13 04:27:27 -0400
committerlgoubet2012-03-13 04:27:27 -0400
commit226e2c8b79b1561bff6e2306156c0d783414b9a9 (patch)
tree68be61379f64240103c9f12cde30820f23d20508 /plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse
parent4ad0bf880ad603195da65847ac3c870acc148952 (diff)
downloadorg.eclipse.emf.compare-226e2c8b79b1561bff6e2306156c0d783414b9a9.tar.gz
org.eclipse.emf.compare-226e2c8b79b1561bff6e2306156c0d783414b9a9.tar.xz
org.eclipse.emf.compare-226e2c8b79b1561bff6e2306156c0d783414b9a9.zip
Introduce the new versions of the metamodel and tests for the EMF Compare core.
Diffstat (limited to 'plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse')
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/suite/CompareTestSuite.java53
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/AbstractCompareTest.java246
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/AttributeChangeTest.java552
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/CompareAdapterFactoryTest.java163
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/CompareFactoryTest.java307
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/CompareSwitchTest.java137
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/ComparisonTest.java154
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/ConflictTest.java68
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/DiffTest.java448
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/DifferenceKindTest.java58
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/DifferenceSourceTest.java58
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/EquivalenceTest.java68
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/MatchResourceTest.java154
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/MatchTest.java285
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/ReferenceChangeTest.java566
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/ResourceAttachmentChangeTest.java507
16 files changed, 3824 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/suite/CompareTestSuite.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/suite/CompareTestSuite.java
new file mode 100644
index 000000000..1c24929e6
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/suite/CompareTestSuite.java
@@ -0,0 +1,53 @@
+package org.eclipse.emf.compare.tests.suite;
+
+import junit.framework.JUnit4TestAdapter;
+import junit.framework.Test;
+import junit.textui.TestRunner;
+
+import org.eclipse.emf.compare.tests.unit.AttributeChangeTest;
+import org.eclipse.emf.compare.tests.unit.CompareAdapterFactoryTest;
+import org.eclipse.emf.compare.tests.unit.CompareFactoryTest;
+import org.eclipse.emf.compare.tests.unit.CompareSwitchTest;
+import org.eclipse.emf.compare.tests.unit.ComparisonTest;
+import org.eclipse.emf.compare.tests.unit.ConflictTest;
+import org.eclipse.emf.compare.tests.unit.DiffTest;
+import org.eclipse.emf.compare.tests.unit.DifferenceKindTest;
+import org.eclipse.emf.compare.tests.unit.DifferenceSourceTest;
+import org.eclipse.emf.compare.tests.unit.EquivalenceTest;
+import org.eclipse.emf.compare.tests.unit.MatchResourceTest;
+import org.eclipse.emf.compare.tests.unit.MatchTest;
+import org.eclipse.emf.compare.tests.unit.ReferenceChangeTest;
+import org.eclipse.emf.compare.tests.unit.ResourceAttachmentChangeTest;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+/**
+ * This test suite allows clients to launch all tests generated for package compare at once.
+ *
+ * @generated
+ */
+@RunWith(Suite.class)
+@SuiteClasses({ComparisonTest.class, MatchResourceTest.class, MatchTest.class, DiffTest.class,
+ ResourceAttachmentChangeTest.class, ReferenceChangeTest.class, AttributeChangeTest.class,
+ ConflictTest.class, EquivalenceTest.class, DifferenceKindTest.class, DifferenceSourceTest.class,
+ CompareAdapterFactoryTest.class, CompareFactoryTest.class, CompareSwitchTest.class, })
+public class CompareTestSuite {
+ /**
+ * Standalone launcher for package compare's tests.
+ *
+ * @generated
+ */
+ public static void main(String[] args) {
+ TestRunner.run(suite());
+ }
+
+ /**
+ * This will return a suite populated with all generated tests for package compare.
+ *
+ * @generated
+ */
+ public static Test suite() {
+ return new JUnit4TestAdapter(CompareTestSuite.class);
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/AbstractCompareTest.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/AbstractCompareTest.java
new file mode 100644
index 000000000..045de7e8a
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/AbstractCompareTest.java
@@ -0,0 +1,246 @@
+package org.eclipse.emf.compare.tests.unit;
+
+import java.util.Calendar;
+
+import junit.framework.TestCase;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.impl.AdapterImpl;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.EcorePackage;
+
+/**
+ * This class defines utility methods and will be used as the superclass of all {@link TestCase} for
+ * "class-related" tests.
+ *
+ * @generated
+ */
+@SuppressWarnings("nls")
+public class AbstractCompareTest {
+ /**
+ * Will hold <code>true</code> if the mock adapter has been notified of a changes.
+ *
+ * @generated
+ */
+ protected boolean notified;
+
+ /**
+ * This will return a boolean that is distinct from the given <code>feature</code>'s default value.
+ * Namely, <code>true</code> if the default is <code>false</code>, <code>false</code> otherwise.
+ *
+ * @param feature
+ * Feature which default value is to be considered.
+ * @return <code>true</code> if the default is <code>false</code>, <code>false</code> otherwise.
+ * @generated
+ */
+ protected boolean getBooleanDistinctFromDefault(EStructuralFeature feature) {
+ return !((Boolean)feature.getDefaultValue()).booleanValue();
+ }
+
+ /**
+ * This will return an int that is distinct from the given <code>feature</code>'s default value. Namely,
+ * <code>-1</code> if the default is <code>0</code>, <code>0</code> otherwise.
+ *
+ * @param feature
+ * Feature which default value is to be considered.
+ * @return <code>-1</code> if the default is <code>0</code>, <code>0</code> otherwise.
+ * @generated
+ */
+ protected int getIntDistinctFromDefault(EStructuralFeature feature) {
+ final int defaultValue = ((Integer)feature.getDefaultValue()).intValue();
+ return defaultValue == 0 ? -1 : 0;
+ }
+
+ /**
+ * This will return a byte that is distinct from the given <code>feature</code>'s default value. Namely,
+ * <code>-1</code> if the default is <code>0</code>, <code>0</code> otherwise.
+ *
+ * @param feature
+ * Feature which default value is to be considered.
+ * @return <code>-1</code> if the default is <code>0</code>, <code>0</code> otherwise.
+ * @generated
+ */
+ protected byte getByteDistinctFromDefault(EStructuralFeature feature) {
+ final byte defaultValue = ((Byte)feature.getDefaultValue()).byteValue();
+ return defaultValue == 0 ? (byte)-1 : 0;
+ }
+
+ /**
+ * This will return a char that is distinct from the given <code>feature</code>'s default value. Namely,
+ * <code>'b'</code> if the default is <code>'a'</code>, <code>'a'</code> otherwise.
+ *
+ * @param feature
+ * Feature which default value is to be considered.
+ * @return <code>'b'</code> if the default is <code>'a'</code>, <code>'a'</code> otherwise.
+ * @generated
+ */
+ protected char getCharDistinctFromDefault(EStructuralFeature feature) {
+ final char defaultValue = ((Character)feature.getDefaultValue()).charValue();
+ return defaultValue == 'a' ? 'b' : 'a';
+ }
+
+ /**
+ * This will return a double that is distinct from the given <code>feature</code>'s default value. Namely,
+ * <code>-1d</code> if the default is <code>0d</code>, <code>0d</code> otherwise.
+ *
+ * @param feature
+ * Feature which default value is to be considered.
+ * @return <code>-1d</code> if the default is <code>0d</code>, <code>0d</code> otherwise.
+ * @generated
+ */
+ protected double getDoubleDistinctFromDefault(EStructuralFeature feature) {
+ final double defaultValue = ((Double)feature.getDefaultValue()).doubleValue();
+ return defaultValue == 0d ? -1d : 0d;
+ }
+
+ /**
+ * This will return a float that is distinct from the given <code>feature</code>'s default value. Namely,
+ * <code>-1f</code> if the default is <code>0f</code>, <code>0f</code> otherwise.
+ *
+ * @param feature
+ * Feature which default value is to be considered.
+ * @return <code>-1f</code> if the default is <code>0f</code>, <code>0f</code> otherwise.
+ * @generated
+ */
+ protected float getFloatDistinctFromDefault(EStructuralFeature feature) {
+ final float defaultValue = ((Float)feature.getDefaultValue()).floatValue();
+ return defaultValue == 0f ? -1f : 0f;
+ }
+
+ /**
+ * This will return a long that is distinct from the given <code>feature</code>'s default value. Namely,
+ * <code>-1L</code> if the default is <code>0L</code>, <code>0L</code> otherwise.
+ *
+ * @param feature
+ * Feature which default value is to be considered.
+ * @return <code>-1L</code> if the default is <code>0L</code>, <code>0L</code> otherwise.
+ * @generated
+ */
+ protected long getLongDistinctFromDefault(EStructuralFeature feature) {
+ final long defaultValue = ((Long)feature.getDefaultValue()).longValue();
+ return defaultValue == 0L ? -1L : 0L;
+ }
+
+ /**
+ * This will return a short that is distinct from the given <code>feature</code>'s default value. Namely,
+ * <code>-1</code> if the default is <code>0</code>, <code>0</code> otherwise.
+ *
+ * @param feature
+ * Feature which default value is to be considered.
+ * @return <code>-1</code> if the default is <code>0</code>, <code>0</code> otherwise.
+ * @generated
+ */
+ protected short getShortDistinctFromDefault(EStructuralFeature feature) {
+ final short defaultValue = ((Short)feature.getDefaultValue()).shortValue();
+ return defaultValue == 0 ? (short)-1 : 0;
+ }
+
+ /**
+ * This will return an {@link Object} that is distinct from the given <code>feature</code>'s default
+ * value, yet having the same type.
+ * <table>
+ * <tr>
+ * <td>Type</td>
+ * <td>Returned value</td>
+ * </tr>
+ * <tr>
+ * <td>EBoolean_OBJECT</td>
+ * <td>{@link Boolean#FALSE} if default is {@link Boolean#TRUE}, {@link Boolean#TRUE} otherwise</td>
+ * </tr>
+ * <tr>
+ * <td>EINTEGER_OBJECT</td>
+ * <td><code>-1</code> if default is <code>0</code>, <code>0</code> otherwise</td>
+ * </tr>
+ * <tr>
+ * <td>EBYTE_OBJECT</td>
+ * <td><code>-1</code> if default is <code>0</code>, <code>0</code> otherwise</td>
+ * </tr>
+ * <tr>
+ * <td>ECHARACTER_OBJECT</td>
+ * <td><code>'b'</code> if default is <code>'a'</code>, <code>'a'</code> otherwise</td>
+ * </tr>
+ * <tr>
+ * <td>EDOUBLE_OBJECT</td>
+ * <td><code>-1d</code> if default is <code>0d</code>, <code>0d</code> otherwise</td>
+ * </tr>
+ * <tr>
+ * <td>EFLOAT_OBJECT</td>
+ * <td><code>-1f</code> if default is <code>0f</code>, <code>0f</code> otherwise</td>
+ * </tr>
+ * <tr>
+ * <td>ELONG_OBJECT</td>
+ * <td><code>-1L</code> if default is <code>0L</code>, <code>0L</code> otherwise</td>
+ * </tr>
+ * <tr>
+ * <td>ESHORT_OBJECT</td>
+ * <td><code>-1</code> if default is <code>0</code>, <code>0</code> otherwise</td>
+ * </tr>
+ * <tr>
+ * <td>ESTRING</td>
+ * <td><code>"notdefault"</code> if default is <code>""</code>, <code>""</code> otherwise</td>
+ * </tr>
+ * <tr>
+ * <td>EDATE</td>
+ * <td>Returns the current date</td>
+ * </tr>
+ * <tr>
+ * <td>EJAVA_OBJECT</td>
+ * <td>Returns a new Object</td>
+ * </tr>
+ * </table>
+ *
+ * @param feature
+ * Feature which default value is to be considered.
+ * @return An {@link Object} that is distinct from the given <code>feature</code>'s default value.
+ * @generated
+ */
+ protected Object getValueDistinctFromDefault(EStructuralFeature feature) {
+ final Object defaultValue = feature.getDefaultValue();
+ if (feature.getEType() == EcorePackage.Literals.EBOOLEAN_OBJECT) {
+ return defaultValue == Boolean.TRUE ? Boolean.FALSE : Boolean.TRUE;
+ } else if (feature.getEType() == EcorePackage.Literals.EINTEGER_OBJECT) {
+ return defaultValue == Integer.valueOf(0) ? Integer.valueOf(-1) : Integer.valueOf(0);
+ } else if (feature.getEType() == EcorePackage.Literals.EBYTE_OBJECT) {
+ return defaultValue == Byte.valueOf("0") ? Byte.valueOf("-1") : Byte.valueOf("0");
+ } else if (feature.getEType() == EcorePackage.Literals.ECHARACTER_OBJECT) {
+ return defaultValue == Character.valueOf('a') ? Character.valueOf('b') : Character.valueOf('a');
+ } else if (feature.getEType() == EcorePackage.Literals.EDOUBLE_OBJECT) {
+ return defaultValue == Double.valueOf(0) ? Double.valueOf(-1) : Double.valueOf(0);
+ } else if (feature.getEType() == EcorePackage.Literals.EFLOAT_OBJECT) {
+ return defaultValue == Float.valueOf(0) ? Float.valueOf(-1) : Float.valueOf(0);
+ } else if (feature.getEType() == EcorePackage.Literals.ELONG_OBJECT) {
+ return defaultValue == Long.valueOf(0) ? Long.valueOf(-1) : Long.valueOf(0);
+ } else if (feature.getEType() == EcorePackage.Literals.ESHORT_OBJECT) {
+ return defaultValue == Short.valueOf((short)0) ? Short.valueOf((short)-1) : Short
+ .valueOf((short)0);
+ } else if (feature.getEType() == EcorePackage.Literals.ESTRING) {
+ return "".equals(defaultValue) ? "notdefault" : "";
+ } else if (feature.getEType() == EcorePackage.Literals.EDATE) {
+ return Calendar.getInstance().getTime();
+ } else if (feature.getEType() == EcorePackage.Literals.EJAVA_OBJECT) {
+ return new Object();
+ } else {
+ throw new RuntimeException();
+ }
+ }
+
+ /**
+ * This basic implementation of an {@link org.eclipse.emf.common.notify.Adapter} will simply switch a
+ * boolean to true when it is notified of a change.
+ *
+ * @generated
+ */
+ protected class MockEAdapter extends AdapterImpl {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.common.notify.impl.AdapterImpl#notifyChanged(org.eclipse.emf.common.notify.Notification)
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification msg) {
+ super.notifyChanged(msg);
+ notified = true;
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/AttributeChangeTest.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/AttributeChangeTest.java
new file mode 100644
index 000000000..f1346290a
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/AttributeChangeTest.java
@@ -0,0 +1,552 @@
+package org.eclipse.emf.compare.tests.unit;
+
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertFalse;
+import static junit.framework.Assert.assertNull;
+import static junit.framework.Assert.assertSame;
+import static junit.framework.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.compare.AttributeChange;
+import org.eclipse.emf.compare.CompareFactory;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.junit.Test;
+
+/**
+ * Tests the behavior of the {@link AttributeChange} class.
+ *
+ * @generated
+ */
+public class AttributeChangeTest extends AbstractCompareTest {
+ /**
+ * Tests the behavior of reference <code>requires</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testRequires() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_Requires();
+ AttributeChange attributeChange = CompareFactory.eINSTANCE.createAttributeChange();
+ attributeChange.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Diff requiresValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createDiff();
+ List<org.eclipse.emf.compare.Diff> listRequires = new ArrayList<org.eclipse.emf.compare.Diff>(1);
+ listRequires.add(requiresValue);
+
+ assertFalse(attributeChange.eIsSet(feature));
+ assertTrue(attributeChange.getRequires().isEmpty());
+
+ attributeChange.getRequires().add(requiresValue);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(attributeChange.getRequires().contains(requiresValue));
+ assertSame(attributeChange.getRequires(), attributeChange.eGet(feature));
+ assertSame(attributeChange.getRequires(), attributeChange.eGet(feature, false));
+ assertTrue(attributeChange.eIsSet(feature));
+ assertTrue(requiresValue.getRequiredBy().contains(attributeChange));
+
+ attributeChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(attributeChange.getRequires().isEmpty());
+ assertSame(attributeChange.getRequires(), attributeChange.eGet(feature));
+ assertSame(attributeChange.getRequires(), attributeChange.eGet(feature, false));
+ assertFalse(attributeChange.eIsSet(feature));
+ assertFalse(requiresValue.getRequiredBy().contains(attributeChange));
+
+ attributeChange.eSet(feature, listRequires);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(attributeChange.getRequires().contains(requiresValue));
+ assertSame(attributeChange.getRequires(), attributeChange.eGet(feature));
+ assertSame(attributeChange.getRequires(), attributeChange.eGet(feature, false));
+ assertTrue(attributeChange.eIsSet(feature));
+ assertTrue(requiresValue.getRequiredBy().contains(attributeChange));
+ }
+
+ /**
+ * Tests the behavior of reference <code>requiredBy</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testRequiredBy() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_RequiredBy();
+ AttributeChange attributeChange = CompareFactory.eINSTANCE.createAttributeChange();
+ attributeChange.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Diff requiredByValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createDiff();
+ List<org.eclipse.emf.compare.Diff> listRequiredBy = new ArrayList<org.eclipse.emf.compare.Diff>(1);
+ listRequiredBy.add(requiredByValue);
+
+ assertFalse(attributeChange.eIsSet(feature));
+ assertTrue(attributeChange.getRequiredBy().isEmpty());
+
+ attributeChange.getRequiredBy().add(requiredByValue);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(attributeChange.getRequiredBy().contains(requiredByValue));
+ assertSame(attributeChange.getRequiredBy(), attributeChange.eGet(feature));
+ assertSame(attributeChange.getRequiredBy(), attributeChange.eGet(feature, false));
+ assertTrue(attributeChange.eIsSet(feature));
+ assertTrue(requiredByValue.getRequires().contains(attributeChange));
+
+ attributeChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(attributeChange.getRequiredBy().isEmpty());
+ assertSame(attributeChange.getRequiredBy(), attributeChange.eGet(feature));
+ assertSame(attributeChange.getRequiredBy(), attributeChange.eGet(feature, false));
+ assertFalse(attributeChange.eIsSet(feature));
+ assertFalse(requiredByValue.getRequires().contains(attributeChange));
+
+ attributeChange.eSet(feature, listRequiredBy);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(attributeChange.getRequiredBy().contains(requiredByValue));
+ assertSame(attributeChange.getRequiredBy(), attributeChange.eGet(feature));
+ assertSame(attributeChange.getRequiredBy(), attributeChange.eGet(feature, false));
+ assertTrue(attributeChange.eIsSet(feature));
+ assertTrue(requiredByValue.getRequires().contains(attributeChange));
+ }
+
+ /**
+ * Tests the behavior of reference <code>refines</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testRefines() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_Refines();
+ AttributeChange attributeChange = CompareFactory.eINSTANCE.createAttributeChange();
+ attributeChange.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Diff refinesValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createDiff();
+ List<org.eclipse.emf.compare.Diff> listRefines = new ArrayList<org.eclipse.emf.compare.Diff>(1);
+ listRefines.add(refinesValue);
+
+ assertFalse(attributeChange.eIsSet(feature));
+ assertTrue(attributeChange.getRefines().isEmpty());
+
+ attributeChange.getRefines().add(refinesValue);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(attributeChange.getRefines().contains(refinesValue));
+ assertSame(attributeChange.getRefines(), attributeChange.eGet(feature));
+ assertSame(attributeChange.getRefines(), attributeChange.eGet(feature, false));
+ assertTrue(attributeChange.eIsSet(feature));
+ assertTrue(refinesValue.getRefinedBy().contains(attributeChange));
+
+ attributeChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(attributeChange.getRefines().isEmpty());
+ assertSame(attributeChange.getRefines(), attributeChange.eGet(feature));
+ assertSame(attributeChange.getRefines(), attributeChange.eGet(feature, false));
+ assertFalse(attributeChange.eIsSet(feature));
+ assertFalse(refinesValue.getRefinedBy().contains(attributeChange));
+
+ attributeChange.eSet(feature, listRefines);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(attributeChange.getRefines().contains(refinesValue));
+ assertSame(attributeChange.getRefines(), attributeChange.eGet(feature));
+ assertSame(attributeChange.getRefines(), attributeChange.eGet(feature, false));
+ assertTrue(attributeChange.eIsSet(feature));
+ assertTrue(refinesValue.getRefinedBy().contains(attributeChange));
+ }
+
+ /**
+ * Tests the behavior of reference <code>refinedBy</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testRefinedBy() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_RefinedBy();
+ AttributeChange attributeChange = CompareFactory.eINSTANCE.createAttributeChange();
+ attributeChange.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Diff refinedByValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createDiff();
+ List<org.eclipse.emf.compare.Diff> listRefinedBy = new ArrayList<org.eclipse.emf.compare.Diff>(1);
+ listRefinedBy.add(refinedByValue);
+
+ assertFalse(attributeChange.eIsSet(feature));
+ assertTrue(attributeChange.getRefinedBy().isEmpty());
+
+ attributeChange.getRefinedBy().add(refinedByValue);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(attributeChange.getRefinedBy().contains(refinedByValue));
+ assertSame(attributeChange.getRefinedBy(), attributeChange.eGet(feature));
+ assertSame(attributeChange.getRefinedBy(), attributeChange.eGet(feature, false));
+ assertTrue(attributeChange.eIsSet(feature));
+ assertTrue(refinedByValue.getRefines().contains(attributeChange));
+
+ attributeChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(attributeChange.getRefinedBy().isEmpty());
+ assertSame(attributeChange.getRefinedBy(), attributeChange.eGet(feature));
+ assertSame(attributeChange.getRefinedBy(), attributeChange.eGet(feature, false));
+ assertFalse(attributeChange.eIsSet(feature));
+ assertFalse(refinedByValue.getRefines().contains(attributeChange));
+
+ attributeChange.eSet(feature, listRefinedBy);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(attributeChange.getRefinedBy().contains(refinedByValue));
+ assertSame(attributeChange.getRefinedBy(), attributeChange.eGet(feature));
+ assertSame(attributeChange.getRefinedBy(), attributeChange.eGet(feature, false));
+ assertTrue(attributeChange.eIsSet(feature));
+ assertTrue(refinedByValue.getRefines().contains(attributeChange));
+ }
+
+ /**
+ * Tests the behavior of reference <code>match</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testMatch() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_Match();
+ AttributeChange attributeChange = CompareFactory.eINSTANCE.createAttributeChange();
+ attributeChange.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Match matchValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createMatch();
+
+ assertFalse(attributeChange.eIsSet(feature));
+ assertNull(attributeChange.getMatch());
+
+ attributeChange.setMatch(matchValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(matchValue, attributeChange.getMatch());
+ assertSame(attributeChange.getMatch(), attributeChange.eGet(feature));
+ assertSame(attributeChange.getMatch(), attributeChange.eGet(feature, false));
+ assertTrue(attributeChange.eIsSet(feature));
+ assertTrue(matchValue.getDifferences().contains(attributeChange));
+
+ attributeChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertNull(attributeChange.getMatch());
+ assertSame(attributeChange.getMatch(), attributeChange.eGet(feature));
+ assertSame(attributeChange.getMatch(), attributeChange.eGet(feature, false));
+ assertFalse(attributeChange.eIsSet(feature));
+ assertFalse(matchValue.getDifferences().contains(attributeChange));
+
+ attributeChange.setMatch(matchValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(matchValue, attributeChange.getMatch());
+ assertSame(attributeChange.getMatch(), attributeChange.eGet(feature));
+ assertSame(attributeChange.getMatch(), attributeChange.eGet(feature, false));
+ assertTrue(attributeChange.eIsSet(feature));
+ assertTrue(matchValue.getDifferences().contains(attributeChange));
+
+ attributeChange.eSet(feature, matchValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(matchValue, attributeChange.getMatch());
+ assertSame(attributeChange.getMatch(), attributeChange.eGet(feature));
+ assertSame(attributeChange.getMatch(), attributeChange.eGet(feature, false));
+ assertTrue(attributeChange.eIsSet(feature));
+ assertTrue(matchValue.getDifferences().contains(attributeChange));
+
+ attributeChange.setMatch(null);
+ assertTrue(notified);
+ notified = false;
+ assertNull(attributeChange.getMatch());
+ assertSame(feature.getDefaultValue(), attributeChange.getMatch());
+ assertSame(attributeChange.getMatch(), attributeChange.eGet(feature));
+ assertSame(attributeChange.getMatch(), attributeChange.eGet(feature, false));
+ assertFalse(attributeChange.eIsSet(feature));
+ assertFalse(matchValue.getDifferences().contains(attributeChange));
+ }
+
+ /**
+ * Tests the behavior of reference <code>equivalentDiffs</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testEquivalentDiffs() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE
+ .getDiff_EquivalentDiffs();
+ AttributeChange attributeChange = CompareFactory.eINSTANCE.createAttributeChange();
+ attributeChange.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Equivalence equivalentDiffsValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createEquivalence();
+
+ assertFalse(attributeChange.eIsSet(feature));
+ assertNull(attributeChange.getEquivalentDiffs());
+
+ attributeChange.setEquivalentDiffs(equivalentDiffsValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(equivalentDiffsValue, attributeChange.getEquivalentDiffs());
+ assertSame(attributeChange.getEquivalentDiffs(), attributeChange.eGet(feature));
+ assertSame(attributeChange.getEquivalentDiffs(), attributeChange.eGet(feature, false));
+ assertTrue(attributeChange.eIsSet(feature));
+ assertTrue(equivalentDiffsValue.getDifferences().contains(attributeChange));
+
+ attributeChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertNull(attributeChange.getEquivalentDiffs());
+ assertSame(attributeChange.getEquivalentDiffs(), attributeChange.eGet(feature));
+ assertSame(attributeChange.getEquivalentDiffs(), attributeChange.eGet(feature, false));
+ assertFalse(attributeChange.eIsSet(feature));
+ assertFalse(equivalentDiffsValue.getDifferences().contains(attributeChange));
+
+ attributeChange.setEquivalentDiffs(equivalentDiffsValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(equivalentDiffsValue, attributeChange.getEquivalentDiffs());
+ assertSame(attributeChange.getEquivalentDiffs(), attributeChange.eGet(feature));
+ assertSame(attributeChange.getEquivalentDiffs(), attributeChange.eGet(feature, false));
+ assertTrue(attributeChange.eIsSet(feature));
+ assertTrue(equivalentDiffsValue.getDifferences().contains(attributeChange));
+
+ attributeChange.eSet(feature, equivalentDiffsValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(equivalentDiffsValue, attributeChange.getEquivalentDiffs());
+ assertSame(attributeChange.getEquivalentDiffs(), attributeChange.eGet(feature));
+ assertSame(attributeChange.getEquivalentDiffs(), attributeChange.eGet(feature, false));
+ assertTrue(attributeChange.eIsSet(feature));
+ assertTrue(equivalentDiffsValue.getDifferences().contains(attributeChange));
+
+ attributeChange.setEquivalentDiffs(null);
+ assertTrue(notified);
+ notified = false;
+ assertNull(attributeChange.getEquivalentDiffs());
+ assertSame(feature.getDefaultValue(), attributeChange.getEquivalentDiffs());
+ assertSame(attributeChange.getEquivalentDiffs(), attributeChange.eGet(feature));
+ assertSame(attributeChange.getEquivalentDiffs(), attributeChange.eGet(feature, false));
+ assertFalse(attributeChange.eIsSet(feature));
+ assertFalse(equivalentDiffsValue.getDifferences().contains(attributeChange));
+ }
+
+ /**
+ * Tests the behavior of reference <code>conflict</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testConflict() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_Conflict();
+ AttributeChange attributeChange = CompareFactory.eINSTANCE.createAttributeChange();
+ attributeChange.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Conflict conflictValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createConflict();
+
+ assertFalse(attributeChange.eIsSet(feature));
+ assertNull(attributeChange.getConflict());
+
+ attributeChange.setConflict(conflictValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(conflictValue, attributeChange.getConflict());
+ assertSame(attributeChange.getConflict(), attributeChange.eGet(feature));
+ assertSame(attributeChange.getConflict(), attributeChange.eGet(feature, false));
+ assertTrue(attributeChange.eIsSet(feature));
+ assertTrue(conflictValue.getDifferences().contains(attributeChange));
+
+ attributeChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertNull(attributeChange.getConflict());
+ assertSame(attributeChange.getConflict(), attributeChange.eGet(feature));
+ assertSame(attributeChange.getConflict(), attributeChange.eGet(feature, false));
+ assertFalse(attributeChange.eIsSet(feature));
+ assertFalse(conflictValue.getDifferences().contains(attributeChange));
+
+ attributeChange.setConflict(conflictValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(conflictValue, attributeChange.getConflict());
+ assertSame(attributeChange.getConflict(), attributeChange.eGet(feature));
+ assertSame(attributeChange.getConflict(), attributeChange.eGet(feature, false));
+ assertTrue(attributeChange.eIsSet(feature));
+ assertTrue(conflictValue.getDifferences().contains(attributeChange));
+
+ attributeChange.eSet(feature, conflictValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(conflictValue, attributeChange.getConflict());
+ assertSame(attributeChange.getConflict(), attributeChange.eGet(feature));
+ assertSame(attributeChange.getConflict(), attributeChange.eGet(feature, false));
+ assertTrue(attributeChange.eIsSet(feature));
+ assertTrue(conflictValue.getDifferences().contains(attributeChange));
+
+ attributeChange.setConflict(null);
+ assertTrue(notified);
+ notified = false;
+ assertNull(attributeChange.getConflict());
+ assertSame(feature.getDefaultValue(), attributeChange.getConflict());
+ assertSame(attributeChange.getConflict(), attributeChange.eGet(feature));
+ assertSame(attributeChange.getConflict(), attributeChange.eGet(feature, false));
+ assertFalse(attributeChange.eIsSet(feature));
+ assertFalse(conflictValue.getDifferences().contains(attributeChange));
+ }
+
+ /**
+ * Tests the behavior of reference <code>attribute</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testAttribute() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE
+ .getAttributeChange_Attribute();
+ AttributeChange attributeChange = CompareFactory.eINSTANCE.createAttributeChange();
+ attributeChange.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.ecore.EAttribute attributeValue = org.eclipse.emf.ecore.EcoreFactory.eINSTANCE
+ .createEAttribute();
+
+ assertFalse(attributeChange.eIsSet(feature));
+ assertNull(attributeChange.getAttribute());
+
+ attributeChange.setAttribute(attributeValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(attributeValue, attributeChange.getAttribute());
+ assertSame(attributeChange.getAttribute(), attributeChange.eGet(feature));
+ assertSame(attributeChange.getAttribute(), attributeChange.eGet(feature, false));
+ assertTrue(attributeChange.eIsSet(feature));
+
+ attributeChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertNull(attributeChange.getAttribute());
+ assertSame(attributeChange.getAttribute(), attributeChange.eGet(feature));
+ assertSame(attributeChange.getAttribute(), attributeChange.eGet(feature, false));
+ assertFalse(attributeChange.eIsSet(feature));
+
+ attributeChange.setAttribute(attributeValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(attributeValue, attributeChange.getAttribute());
+ assertSame(attributeChange.getAttribute(), attributeChange.eGet(feature));
+ assertSame(attributeChange.getAttribute(), attributeChange.eGet(feature, false));
+ assertTrue(attributeChange.eIsSet(feature));
+
+ attributeChange.eSet(feature, attributeValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(attributeValue, attributeChange.getAttribute());
+ assertSame(attributeChange.getAttribute(), attributeChange.eGet(feature));
+ assertSame(attributeChange.getAttribute(), attributeChange.eGet(feature, false));
+ assertTrue(attributeChange.eIsSet(feature));
+
+ attributeChange.setAttribute(null);
+ assertTrue(notified);
+ notified = false;
+ assertNull(attributeChange.getAttribute());
+ assertSame(feature.getDefaultValue(), attributeChange.getAttribute());
+ assertSame(attributeChange.getAttribute(), attributeChange.eGet(feature));
+ assertSame(attributeChange.getAttribute(), attributeChange.eGet(feature, false));
+ assertFalse(attributeChange.eIsSet(feature));
+ }
+
+ /**
+ * Tests the behavior of attribute <code>kind</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testKind() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_Kind();
+ AttributeChange attributeChange = CompareFactory.eINSTANCE.createAttributeChange();
+ attributeChange.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.DifferenceKind kindValue = (org.eclipse.emf.compare.DifferenceKind)feature
+ .getDefaultValue();
+ for (org.eclipse.emf.compare.DifferenceKind aDifferenceKind : org.eclipse.emf.compare.DifferenceKind.VALUES) {
+ if (kindValue.getValue() != aDifferenceKind.getValue()) {
+ kindValue = aDifferenceKind;
+ break;
+ }
+ }
+
+ assertFalse(attributeChange.eIsSet(feature));
+ assertEquals(feature.getDefaultValue(), attributeChange.getKind());
+
+ attributeChange.setKind(kindValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(kindValue, attributeChange.getKind());
+ assertEquals(attributeChange.getKind(), attributeChange.eGet(feature));
+ assertTrue(attributeChange.eIsSet(feature));
+
+ attributeChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), attributeChange.getKind());
+ assertEquals(attributeChange.getKind(), attributeChange.eGet(feature));
+ assertFalse(attributeChange.eIsSet(feature));
+
+ attributeChange.eSet(feature, kindValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(kindValue, attributeChange.getKind());
+ assertEquals(attributeChange.getKind(), attributeChange.eGet(feature));
+ assertTrue(attributeChange.eIsSet(feature));
+
+ attributeChange.setKind(null);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), attributeChange.getKind());
+ assertEquals(attributeChange.getKind(), attributeChange.eGet(feature));
+ assertFalse(attributeChange.eIsSet(feature));
+ }
+
+ /**
+ * Tests the behavior of attribute <code>value</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testValue() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE
+ .getAttributeChange_Value();
+ AttributeChange attributeChange = CompareFactory.eINSTANCE.createAttributeChange();
+ attributeChange.eAdapters().add(new MockEAdapter());
+ java.lang.Object valueValue = getValueDistinctFromDefault(feature);
+
+ assertFalse(attributeChange.eIsSet(feature));
+ assertEquals(feature.getDefaultValue(), attributeChange.getValue());
+
+ attributeChange.setValue(valueValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(valueValue, attributeChange.getValue());
+ assertEquals(attributeChange.getValue(), attributeChange.eGet(feature));
+ assertTrue(attributeChange.eIsSet(feature));
+
+ attributeChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), attributeChange.getValue());
+ assertEquals(attributeChange.getValue(), attributeChange.eGet(feature));
+ assertFalse(attributeChange.eIsSet(feature));
+
+ attributeChange.eSet(feature, valueValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(valueValue, attributeChange.getValue());
+ assertEquals(attributeChange.getValue(), attributeChange.eGet(feature));
+ assertTrue(attributeChange.eIsSet(feature));
+
+ attributeChange.setValue(null);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), attributeChange.getValue());
+ assertEquals(attributeChange.getValue(), attributeChange.eGet(feature));
+ assertFalse(attributeChange.eIsSet(feature));
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/CompareAdapterFactoryTest.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/CompareAdapterFactoryTest.java
new file mode 100644
index 000000000..09d397ad3
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/CompareAdapterFactoryTest.java
@@ -0,0 +1,163 @@
+package org.eclipse.emf.compare.tests.unit;
+
+import static junit.framework.Assert.assertFalse;
+import static junit.framework.Assert.assertNull;
+import static junit.framework.Assert.assertTrue;
+
+import org.eclipse.emf.compare.AttributeChange;
+import org.eclipse.emf.compare.CompareFactory;
+import org.eclipse.emf.compare.ComparePackage;
+import org.eclipse.emf.compare.Comparison;
+import org.eclipse.emf.compare.Conflict;
+import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.compare.Equivalence;
+import org.eclipse.emf.compare.Match;
+import org.eclipse.emf.compare.MatchResource;
+import org.eclipse.emf.compare.ReferenceChange;
+import org.eclipse.emf.compare.ResourceAttachmentChange;
+import org.eclipse.emf.compare.util.CompareAdapterFactory;
+import org.junit.Test;
+
+/*
+ * TODO This is but a skeleton for the tests of CompareAdapterFactory.
+ * Set as "generated NOT" and override each test if you overrode the default generated
+ * behavior.
+ */
+/**
+ * Tests the behavior of the {@link CompareAdapterFactory generated adapter factory} for package compare.
+ *
+ * @generated
+ */
+public class CompareAdapterFactoryTest {
+ /**
+ * Ensures that creating adapters for {@link Comparison} can be done through the AdapterFactory.
+ *
+ * @generated
+ */
+ @Test
+ public void testCreateComparisonAdapter() {
+ CompareAdapterFactory adapterFactory = new CompareAdapterFactory();
+ assertNull(adapterFactory.createComparisonAdapter());
+ assertNull(adapterFactory.createAdapter(CompareFactory.eINSTANCE.createComparison()));
+ }
+
+ /**
+ * Ensures that creating adapters for {@link MatchResource} can be done through the AdapterFactory.
+ *
+ * @generated
+ */
+ @Test
+ public void testCreateMatchResourceAdapter() {
+ CompareAdapterFactory adapterFactory = new CompareAdapterFactory();
+ assertNull(adapterFactory.createMatchResourceAdapter());
+ assertNull(adapterFactory.createAdapter(CompareFactory.eINSTANCE.createMatchResource()));
+ }
+
+ /**
+ * Ensures that creating adapters for {@link Match} can be done through the AdapterFactory.
+ *
+ * @generated
+ */
+ @Test
+ public void testCreateMatchAdapter() {
+ CompareAdapterFactory adapterFactory = new CompareAdapterFactory();
+ assertNull(adapterFactory.createMatchAdapter());
+ assertNull(adapterFactory.createAdapter(CompareFactory.eINSTANCE.createMatch()));
+ }
+
+ /**
+ * Ensures that creating adapters for {@link Diff} can be done through the AdapterFactory.
+ *
+ * @generated
+ */
+ @Test
+ public void testCreateDiffAdapter() {
+ CompareAdapterFactory adapterFactory = new CompareAdapterFactory();
+ assertNull(adapterFactory.createDiffAdapter());
+ assertNull(adapterFactory.createAdapter(CompareFactory.eINSTANCE.createDiff()));
+ }
+
+ /**
+ * Ensures that creating adapters for {@link ResourceAttachmentChange} can be done through the
+ * AdapterFactory.
+ *
+ * @generated
+ */
+ @Test
+ public void testCreateResourceAttachmentChangeAdapter() {
+ CompareAdapterFactory adapterFactory = new CompareAdapterFactory();
+ assertNull(adapterFactory.createResourceAttachmentChangeAdapter());
+ assertNull(adapterFactory.createAdapter(CompareFactory.eINSTANCE.createResourceAttachmentChange()));
+ }
+
+ /**
+ * Ensures that creating adapters for {@link ReferenceChange} can be done through the AdapterFactory.
+ *
+ * @generated
+ */
+ @Test
+ public void testCreateReferenceChangeAdapter() {
+ CompareAdapterFactory adapterFactory = new CompareAdapterFactory();
+ assertNull(adapterFactory.createReferenceChangeAdapter());
+ assertNull(adapterFactory.createAdapter(CompareFactory.eINSTANCE.createReferenceChange()));
+ }
+
+ /**
+ * Ensures that creating adapters for {@link AttributeChange} can be done through the AdapterFactory.
+ *
+ * @generated
+ */
+ @Test
+ public void testCreateAttributeChangeAdapter() {
+ CompareAdapterFactory adapterFactory = new CompareAdapterFactory();
+ assertNull(adapterFactory.createAttributeChangeAdapter());
+ assertNull(adapterFactory.createAdapter(CompareFactory.eINSTANCE.createAttributeChange()));
+ }
+
+ /**
+ * Ensures that creating adapters for {@link Conflict} can be done through the AdapterFactory.
+ *
+ * @generated
+ */
+ @Test
+ public void testCreateConflictAdapter() {
+ CompareAdapterFactory adapterFactory = new CompareAdapterFactory();
+ assertNull(adapterFactory.createConflictAdapter());
+ assertNull(adapterFactory.createAdapter(CompareFactory.eINSTANCE.createConflict()));
+ }
+
+ /**
+ * Ensures that creating adapters for {@link Equivalence} can be done through the AdapterFactory.
+ *
+ * @generated
+ */
+ @Test
+ public void testCreateEquivalenceAdapter() {
+ CompareAdapterFactory adapterFactory = new CompareAdapterFactory();
+ assertNull(adapterFactory.createEquivalenceAdapter());
+ assertNull(adapterFactory.createAdapter(CompareFactory.eINSTANCE.createEquivalence()));
+ }
+
+ /**
+ * Ensures that the AdapterFactory knows all classes of package compare.
+ *
+ * @generated
+ */
+ @Test
+ public void testIsFactoryForType() {
+ CompareAdapterFactory adapterFactory = new CompareAdapterFactory();
+ assertTrue(adapterFactory.isFactoryForType(CompareFactory.eINSTANCE.createComparison()));
+ assertTrue(adapterFactory.isFactoryForType(CompareFactory.eINSTANCE.createMatchResource()));
+ assertTrue(adapterFactory.isFactoryForType(CompareFactory.eINSTANCE.createMatch()));
+ assertTrue(adapterFactory.isFactoryForType(CompareFactory.eINSTANCE.createDiff()));
+ assertTrue(adapterFactory.isFactoryForType(CompareFactory.eINSTANCE.createResourceAttachmentChange()));
+ assertTrue(adapterFactory.isFactoryForType(CompareFactory.eINSTANCE.createReferenceChange()));
+ assertTrue(adapterFactory.isFactoryForType(CompareFactory.eINSTANCE.createAttributeChange()));
+ assertTrue(adapterFactory.isFactoryForType(CompareFactory.eINSTANCE.createConflict()));
+ assertTrue(adapterFactory.isFactoryForType(CompareFactory.eINSTANCE.createEquivalence()));
+ assertTrue(adapterFactory.isFactoryForType(ComparePackage.eINSTANCE));
+ org.eclipse.emf.ecore.EClass eClass = org.eclipse.emf.ecore.EcoreFactory.eINSTANCE.createEClass();
+ assertFalse(adapterFactory.isFactoryForType(eClass));
+ assertFalse(adapterFactory.isFactoryForType(new Object()));
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/CompareFactoryTest.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/CompareFactoryTest.java
new file mode 100644
index 000000000..26415e3f9
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/CompareFactoryTest.java
@@ -0,0 +1,307 @@
+package org.eclipse.emf.compare.tests.unit;
+
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertNotNull;
+import static junit.framework.Assert.assertSame;
+import static junit.framework.Assert.assertTrue;
+import static junit.framework.Assert.fail;
+
+import org.eclipse.emf.compare.AttributeChange;
+import org.eclipse.emf.compare.CompareFactory;
+import org.eclipse.emf.compare.ComparePackage;
+import org.eclipse.emf.compare.Comparison;
+import org.eclipse.emf.compare.Conflict;
+import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.compare.DifferenceKind;
+import org.eclipse.emf.compare.DifferenceSource;
+import org.eclipse.emf.compare.Equivalence;
+import org.eclipse.emf.compare.Match;
+import org.eclipse.emf.compare.MatchResource;
+import org.eclipse.emf.compare.ReferenceChange;
+import org.eclipse.emf.compare.ResourceAttachmentChange;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EcoreFactory;
+import org.eclipse.emf.ecore.impl.EClassifierImpl;
+import org.junit.Test;
+
+/**
+ * Tests the behavior of the {@link CompareFactory generated factory} for package compare.
+ *
+ * @generated
+ */
+@SuppressWarnings("nls")
+public class CompareFactoryTest {
+ /**
+ * Ensures that creating {@link Comparison} can be done through the factory.
+ *
+ * @generated
+ */
+ @Test
+ public void testCreateComparison() {
+ Object result = CompareFactory.eINSTANCE.createComparison();
+ assertNotNull(result);
+ assertTrue(result instanceof Comparison);
+
+ result = CompareFactory.eINSTANCE.create(ComparePackage.Literals.COMPARISON);
+ assertNotNull(result);
+ assertTrue(result instanceof Comparison);
+ }
+
+ /**
+ * Ensures that creating {@link MatchResource} can be done through the factory.
+ *
+ * @generated
+ */
+ @Test
+ public void testCreateMatchResource() {
+ Object result = CompareFactory.eINSTANCE.createMatchResource();
+ assertNotNull(result);
+ assertTrue(result instanceof MatchResource);
+
+ result = CompareFactory.eINSTANCE.create(ComparePackage.Literals.MATCH_RESOURCE);
+ assertNotNull(result);
+ assertTrue(result instanceof MatchResource);
+ }
+
+ /**
+ * Ensures that creating {@link Match} can be done through the factory.
+ *
+ * @generated
+ */
+ @Test
+ public void testCreateMatch() {
+ Object result = CompareFactory.eINSTANCE.createMatch();
+ assertNotNull(result);
+ assertTrue(result instanceof Match);
+
+ result = CompareFactory.eINSTANCE.create(ComparePackage.Literals.MATCH);
+ assertNotNull(result);
+ assertTrue(result instanceof Match);
+ }
+
+ /**
+ * Ensures that creating {@link Diff} can be done through the factory.
+ *
+ * @generated
+ */
+ @Test
+ public void testCreateDiff() {
+ Object result = CompareFactory.eINSTANCE.createDiff();
+ assertNotNull(result);
+ assertTrue(result instanceof Diff);
+
+ result = CompareFactory.eINSTANCE.create(ComparePackage.Literals.DIFF);
+ assertNotNull(result);
+ assertTrue(result instanceof Diff);
+ }
+
+ /**
+ * Ensures that creating {@link ResourceAttachmentChange} can be done through the factory.
+ *
+ * @generated
+ */
+ @Test
+ public void testCreateResourceAttachmentChange() {
+ Object result = CompareFactory.eINSTANCE.createResourceAttachmentChange();
+ assertNotNull(result);
+ assertTrue(result instanceof ResourceAttachmentChange);
+
+ result = CompareFactory.eINSTANCE.create(ComparePackage.Literals.RESOURCE_ATTACHMENT_CHANGE);
+ assertNotNull(result);
+ assertTrue(result instanceof ResourceAttachmentChange);
+ }
+
+ /**
+ * Ensures that creating {@link ReferenceChange} can be done through the factory.
+ *
+ * @generated
+ */
+ @Test
+ public void testCreateReferenceChange() {
+ Object result = CompareFactory.eINSTANCE.createReferenceChange();
+ assertNotNull(result);
+ assertTrue(result instanceof ReferenceChange);
+
+ result = CompareFactory.eINSTANCE.create(ComparePackage.Literals.REFERENCE_CHANGE);
+ assertNotNull(result);
+ assertTrue(result instanceof ReferenceChange);
+ }
+
+ /**
+ * Ensures that creating {@link AttributeChange} can be done through the factory.
+ *
+ * @generated
+ */
+ @Test
+ public void testCreateAttributeChange() {
+ Object result = CompareFactory.eINSTANCE.createAttributeChange();
+ assertNotNull(result);
+ assertTrue(result instanceof AttributeChange);
+
+ result = CompareFactory.eINSTANCE.create(ComparePackage.Literals.ATTRIBUTE_CHANGE);
+ assertNotNull(result);
+ assertTrue(result instanceof AttributeChange);
+ }
+
+ /**
+ * Ensures that creating {@link Conflict} can be done through the factory.
+ *
+ * @generated
+ */
+ @Test
+ public void testCreateConflict() {
+ Object result = CompareFactory.eINSTANCE.createConflict();
+ assertNotNull(result);
+ assertTrue(result instanceof Conflict);
+
+ result = CompareFactory.eINSTANCE.create(ComparePackage.Literals.CONFLICT);
+ assertNotNull(result);
+ assertTrue(result instanceof Conflict);
+ }
+
+ /**
+ * Ensures that creating {@link Equivalence} can be done through the factory.
+ *
+ * @generated
+ */
+ @Test
+ public void testCreateEquivalence() {
+ Object result = CompareFactory.eINSTANCE.createEquivalence();
+ assertNotNull(result);
+ assertTrue(result instanceof Equivalence);
+
+ result = CompareFactory.eINSTANCE.create(ComparePackage.Literals.EQUIVALENCE);
+ assertNotNull(result);
+ assertTrue(result instanceof Equivalence);
+ }
+
+ /**
+ * Ensures that trying to create an {@link EClass} from another package yields the expected exception.
+ *
+ * @generated
+ */
+ @Test
+ public void testCreateUnknownEClass() {
+ try {
+ EClass eClass = EcoreFactory.eINSTANCE.createEClass();
+ ((EClassifierImpl)eClass).setClassifierID(-1);
+ CompareFactory.eINSTANCE.create(eClass);
+ fail("Expected IllegalArgumentException hasn't been thrown");
+ } catch (IllegalArgumentException e) {
+ // Expected behavior
+ }
+ }
+
+ /**
+ * Ensures that converting {@link DifferenceKind} to String can be done through the factory.
+ *
+ * @generated
+ */
+ @Test
+ public void testConvertDifferenceKindToString() {
+ for (DifferenceKind value : DifferenceKind.VALUES) {
+ Object result = CompareFactory.eINSTANCE.convertToString(ComparePackage.Literals.DIFFERENCE_KIND,
+ value);
+ assertNotNull(result);
+ assertEquals(value.toString(), result);
+ }
+ }
+
+ /**
+ * Ensures that converting {@link DifferenceSource} to String can be done through the factory.
+ *
+ * @generated
+ */
+ @Test
+ public void testConvertDifferenceSourceToString() {
+ for (DifferenceSource value : DifferenceSource.VALUES) {
+ Object result = CompareFactory.eINSTANCE.convertToString(
+ ComparePackage.Literals.DIFFERENCE_SOURCE, value);
+ assertNotNull(result);
+ assertEquals(value.toString(), result);
+ }
+ }
+
+ /**
+ * Ensures that trying to convert an {@link EEnum} from another package to String yields the expected
+ * exception.
+ *
+ * @generated
+ */
+ @Test
+ public void testConvertUnknownEEnumToString() {
+ try {
+ EEnum eEnum = EcoreFactory.eINSTANCE.createEEnum();
+ ((EClassifierImpl)eEnum).setClassifierID(-1);
+ CompareFactory.eINSTANCE.convertToString(eEnum, eEnum);
+ fail("Expected IllegalArgumentException hasn't been thrown");
+ } catch (IllegalArgumentException e) {
+ // Expected behavior
+ }
+ }
+
+ /**
+ * Ensures that creating {@link DifferenceKind} from String can be done through the factory.
+ *
+ * @generated
+ */
+ @Test
+ public void testCreateDifferenceKindFromString() {
+ for (DifferenceKind value : DifferenceKind.VALUES) {
+ Object result = CompareFactory.eINSTANCE.createFromString(
+ ComparePackage.Literals.DIFFERENCE_KIND, value.getLiteral());
+ assertNotNull(result);
+ assertSame(value, result);
+
+ try {
+ CompareFactory.eINSTANCE.createFromString(ComparePackage.Literals.DIFFERENCE_KIND,
+ "ThisShouldntBeAKnownEEnumLiteral");
+ fail("Expected IllegalArgumentException hasn't been thrown");
+ } catch (IllegalArgumentException e) {
+ // Expected behavior
+ }
+ }
+ }
+
+ /**
+ * Ensures that creating {@link DifferenceSource} from String can be done through the factory.
+ *
+ * @generated
+ */
+ @Test
+ public void testCreateDifferenceSourceFromString() {
+ for (DifferenceSource value : DifferenceSource.VALUES) {
+ Object result = CompareFactory.eINSTANCE.createFromString(
+ ComparePackage.Literals.DIFFERENCE_SOURCE, value.getLiteral());
+ assertNotNull(result);
+ assertSame(value, result);
+
+ try {
+ CompareFactory.eINSTANCE.createFromString(ComparePackage.Literals.DIFFERENCE_SOURCE,
+ "ThisShouldntBeAKnownEEnumLiteral");
+ fail("Expected IllegalArgumentException hasn't been thrown");
+ } catch (IllegalArgumentException e) {
+ // Expected behavior
+ }
+ }
+ }
+
+ /**
+ * Ensures that trying to create an {@link EEnum} from another package from String yields the expected
+ * exception.
+ *
+ * @generated
+ */
+ @Test
+ public void testCreateUnknownEEnumFromString() {
+ try {
+ EEnum eEnum = EcoreFactory.eINSTANCE.createEEnum();
+ ((EClassifierImpl)eEnum).setClassifierID(-1);
+ CompareFactory.eINSTANCE.createFromString(eEnum, "ThisShouldntBeAKnownEEnumLiteral");
+ fail("Expected IllegalArgumentException hasn't been thrown");
+ } catch (IllegalArgumentException e) {
+ // Expected behavior
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/CompareSwitchTest.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/CompareSwitchTest.java
new file mode 100644
index 000000000..9b7fc1ba5
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/CompareSwitchTest.java
@@ -0,0 +1,137 @@
+package org.eclipse.emf.compare.tests.unit;
+
+import static junit.framework.Assert.assertNull;
+
+import org.eclipse.emf.compare.AttributeChange;
+import org.eclipse.emf.compare.CompareFactory;
+import org.eclipse.emf.compare.Comparison;
+import org.eclipse.emf.compare.Conflict;
+import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.compare.Equivalence;
+import org.eclipse.emf.compare.Match;
+import org.eclipse.emf.compare.MatchResource;
+import org.eclipse.emf.compare.ReferenceChange;
+import org.eclipse.emf.compare.ResourceAttachmentChange;
+import org.eclipse.emf.compare.util.CompareSwitch;
+import org.junit.Test;
+
+/*
+ * TODO This is but a skeleton for the tests of CompareSwitch.
+ * Set as "generated NOT" and override each test if you overrode the default generated
+ * behavior.
+ */
+/**
+ * Tests the behavior of the {@link CompareSwitch generated switch} for package compare.
+ *
+ * @generated
+ */
+public class CompareSwitchTest {
+ /**
+ * Ensures that the generated switch knows {@link Comparison}.
+ *
+ * @generated
+ */
+ @Test
+ public void testCaseComparison() {
+ CompareSwitch<?> compareswitch = new CompareSwitch<Object>();
+ assertNull(compareswitch.caseComparison(CompareFactory.eINSTANCE.createComparison()));
+ assertNull(compareswitch.doSwitch(CompareFactory.eINSTANCE.createComparison()));
+ }
+
+ /**
+ * Ensures that the generated switch knows {@link MatchResource}.
+ *
+ * @generated
+ */
+ @Test
+ public void testCaseMatchResource() {
+ CompareSwitch<?> compareswitch = new CompareSwitch<Object>();
+ assertNull(compareswitch.caseMatchResource(CompareFactory.eINSTANCE.createMatchResource()));
+ assertNull(compareswitch.doSwitch(CompareFactory.eINSTANCE.createMatchResource()));
+ }
+
+ /**
+ * Ensures that the generated switch knows {@link Match}.
+ *
+ * @generated
+ */
+ @Test
+ public void testCaseMatch() {
+ CompareSwitch<?> compareswitch = new CompareSwitch<Object>();
+ assertNull(compareswitch.caseMatch(CompareFactory.eINSTANCE.createMatch()));
+ assertNull(compareswitch.doSwitch(CompareFactory.eINSTANCE.createMatch()));
+ }
+
+ /**
+ * Ensures that the generated switch knows {@link Diff}.
+ *
+ * @generated
+ */
+ @Test
+ public void testCaseDiff() {
+ CompareSwitch<?> compareswitch = new CompareSwitch<Object>();
+ assertNull(compareswitch.caseDiff(CompareFactory.eINSTANCE.createDiff()));
+ assertNull(compareswitch.doSwitch(CompareFactory.eINSTANCE.createDiff()));
+ }
+
+ /**
+ * Ensures that the generated switch knows {@link ResourceAttachmentChange}.
+ *
+ * @generated
+ */
+ @Test
+ public void testCaseResourceAttachmentChange() {
+ CompareSwitch<?> compareswitch = new CompareSwitch<Object>();
+ assertNull(compareswitch.caseResourceAttachmentChange(CompareFactory.eINSTANCE
+ .createResourceAttachmentChange()));
+ assertNull(compareswitch.doSwitch(CompareFactory.eINSTANCE.createResourceAttachmentChange()));
+ }
+
+ /**
+ * Ensures that the generated switch knows {@link ReferenceChange}.
+ *
+ * @generated
+ */
+ @Test
+ public void testCaseReferenceChange() {
+ CompareSwitch<?> compareswitch = new CompareSwitch<Object>();
+ assertNull(compareswitch.caseReferenceChange(CompareFactory.eINSTANCE.createReferenceChange()));
+ assertNull(compareswitch.doSwitch(CompareFactory.eINSTANCE.createReferenceChange()));
+ }
+
+ /**
+ * Ensures that the generated switch knows {@link AttributeChange}.
+ *
+ * @generated
+ */
+ @Test
+ public void testCaseAttributeChange() {
+ CompareSwitch<?> compareswitch = new CompareSwitch<Object>();
+ assertNull(compareswitch.caseAttributeChange(CompareFactory.eINSTANCE.createAttributeChange()));
+ assertNull(compareswitch.doSwitch(CompareFactory.eINSTANCE.createAttributeChange()));
+ }
+
+ /**
+ * Ensures that the generated switch knows {@link Conflict}.
+ *
+ * @generated
+ */
+ @Test
+ public void testCaseConflict() {
+ CompareSwitch<?> compareswitch = new CompareSwitch<Object>();
+ assertNull(compareswitch.caseConflict(CompareFactory.eINSTANCE.createConflict()));
+ assertNull(compareswitch.doSwitch(CompareFactory.eINSTANCE.createConflict()));
+ }
+
+ /**
+ * Ensures that the generated switch knows {@link Equivalence}.
+ *
+ * @generated
+ */
+ @Test
+ public void testCaseEquivalence() {
+ CompareSwitch<?> compareswitch = new CompareSwitch<Object>();
+ assertNull(compareswitch.caseEquivalence(CompareFactory.eINSTANCE.createEquivalence()));
+ assertNull(compareswitch.doSwitch(CompareFactory.eINSTANCE.createEquivalence()));
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/ComparisonTest.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/ComparisonTest.java
new file mode 100644
index 000000000..5b087a4b1
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/ComparisonTest.java
@@ -0,0 +1,154 @@
+package org.eclipse.emf.compare.tests.unit;
+
+import static junit.framework.Assert.assertFalse;
+import static junit.framework.Assert.assertSame;
+import static junit.framework.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.compare.CompareFactory;
+import org.eclipse.emf.compare.Comparison;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.junit.Test;
+
+/**
+ * Tests the behavior of the {@link Comparison} class.
+ *
+ * @generated
+ */
+public class ComparisonTest extends AbstractCompareTest {
+ /**
+ * Tests the behavior of reference <code>matchedResources</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testMatchedResources() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE
+ .getComparison_MatchedResources();
+ Comparison comparison = CompareFactory.eINSTANCE.createComparison();
+ comparison.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.MatchResource matchedResourcesValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createMatchResource();
+ List<org.eclipse.emf.compare.MatchResource> listMatchedResources = new ArrayList<org.eclipse.emf.compare.MatchResource>(
+ 1);
+ listMatchedResources.add(matchedResourcesValue);
+
+ assertFalse(comparison.eIsSet(feature));
+ assertTrue(comparison.getMatchedResources().isEmpty());
+
+ comparison.getMatchedResources().add(matchedResourcesValue);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(comparison.getMatchedResources().contains(matchedResourcesValue));
+ assertSame(comparison.getMatchedResources(), comparison.eGet(feature));
+ assertSame(comparison.getMatchedResources(), comparison.eGet(feature, false));
+ assertTrue(comparison.eIsSet(feature));
+
+ comparison.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(comparison.getMatchedResources().isEmpty());
+ assertSame(comparison.getMatchedResources(), comparison.eGet(feature));
+ assertSame(comparison.getMatchedResources(), comparison.eGet(feature, false));
+ assertFalse(comparison.eIsSet(feature));
+
+ comparison.eSet(feature, listMatchedResources);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(comparison.getMatchedResources().contains(matchedResourcesValue));
+ assertSame(comparison.getMatchedResources(), comparison.eGet(feature));
+ assertSame(comparison.getMatchedResources(), comparison.eGet(feature, false));
+ assertTrue(comparison.eIsSet(feature));
+ }
+
+ /**
+ * Tests the behavior of reference <code>matches</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testMatches() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getComparison_Matches();
+ Comparison comparison = CompareFactory.eINSTANCE.createComparison();
+ comparison.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Match matchesValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createMatch();
+ List<org.eclipse.emf.compare.Match> listMatches = new ArrayList<org.eclipse.emf.compare.Match>(1);
+ listMatches.add(matchesValue);
+
+ assertFalse(comparison.eIsSet(feature));
+ assertTrue(comparison.getMatches().isEmpty());
+
+ comparison.getMatches().add(matchesValue);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(comparison.getMatches().contains(matchesValue));
+ assertSame(comparison.getMatches(), comparison.eGet(feature));
+ assertSame(comparison.getMatches(), comparison.eGet(feature, false));
+ assertTrue(comparison.eIsSet(feature));
+
+ comparison.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(comparison.getMatches().isEmpty());
+ assertSame(comparison.getMatches(), comparison.eGet(feature));
+ assertSame(comparison.getMatches(), comparison.eGet(feature, false));
+ assertFalse(comparison.eIsSet(feature));
+
+ comparison.eSet(feature, listMatches);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(comparison.getMatches().contains(matchesValue));
+ assertSame(comparison.getMatches(), comparison.eGet(feature));
+ assertSame(comparison.getMatches(), comparison.eGet(feature, false));
+ assertTrue(comparison.eIsSet(feature));
+ }
+
+ /**
+ * Tests the behavior of reference <code>conflicts</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testConflicts() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE
+ .getComparison_Conflicts();
+ Comparison comparison = CompareFactory.eINSTANCE.createComparison();
+ comparison.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Conflict conflictsValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createConflict();
+ List<org.eclipse.emf.compare.Conflict> listConflicts = new ArrayList<org.eclipse.emf.compare.Conflict>(
+ 1);
+ listConflicts.add(conflictsValue);
+
+ assertFalse(comparison.eIsSet(feature));
+ assertTrue(comparison.getConflicts().isEmpty());
+
+ comparison.getConflicts().add(conflictsValue);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(comparison.getConflicts().contains(conflictsValue));
+ assertSame(comparison.getConflicts(), comparison.eGet(feature));
+ assertSame(comparison.getConflicts(), comparison.eGet(feature, false));
+ assertTrue(comparison.eIsSet(feature));
+
+ comparison.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(comparison.getConflicts().isEmpty());
+ assertSame(comparison.getConflicts(), comparison.eGet(feature));
+ assertSame(comparison.getConflicts(), comparison.eGet(feature, false));
+ assertFalse(comparison.eIsSet(feature));
+
+ comparison.eSet(feature, listConflicts);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(comparison.getConflicts().contains(conflictsValue));
+ assertSame(comparison.getConflicts(), comparison.eGet(feature));
+ assertSame(comparison.getConflicts(), comparison.eGet(feature, false));
+ assertTrue(comparison.eIsSet(feature));
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/ConflictTest.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/ConflictTest.java
new file mode 100644
index 000000000..37fca7a35
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/ConflictTest.java
@@ -0,0 +1,68 @@
+package org.eclipse.emf.compare.tests.unit;
+
+import static junit.framework.Assert.assertFalse;
+import static junit.framework.Assert.assertSame;
+import static junit.framework.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.compare.CompareFactory;
+import org.eclipse.emf.compare.Conflict;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.junit.Test;
+
+/**
+ * Tests the behavior of the {@link Conflict} class.
+ *
+ * @generated
+ */
+public class ConflictTest extends AbstractCompareTest {
+ /**
+ * Tests the behavior of reference <code>differences</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testDifferences() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE
+ .getConflict_Differences();
+ Conflict conflict = CompareFactory.eINSTANCE.createConflict();
+ conflict.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Diff differencesValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createDiff();
+ List<org.eclipse.emf.compare.Diff> listDifferences = new ArrayList<org.eclipse.emf.compare.Diff>(1);
+ listDifferences.add(differencesValue);
+
+ assertFalse(conflict.eIsSet(feature));
+ assertTrue(conflict.getDifferences().isEmpty());
+
+ conflict.getDifferences().add(differencesValue);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(conflict.getDifferences().contains(differencesValue));
+ assertSame(conflict.getDifferences(), conflict.eGet(feature));
+ assertSame(conflict.getDifferences(), conflict.eGet(feature, false));
+ assertTrue(conflict.eIsSet(feature));
+ assertTrue(differencesValue.getConflict() == conflict);
+
+ conflict.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(conflict.getDifferences().isEmpty());
+ assertSame(conflict.getDifferences(), conflict.eGet(feature));
+ assertSame(conflict.getDifferences(), conflict.eGet(feature, false));
+ assertFalse(conflict.eIsSet(feature));
+ assertFalse(differencesValue.getConflict() == conflict);
+
+ conflict.eSet(feature, listDifferences);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(conflict.getDifferences().contains(differencesValue));
+ assertSame(conflict.getDifferences(), conflict.eGet(feature));
+ assertSame(conflict.getDifferences(), conflict.eGet(feature, false));
+ assertTrue(conflict.eIsSet(feature));
+ assertTrue(differencesValue.getConflict() == conflict);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/DiffTest.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/DiffTest.java
new file mode 100644
index 000000000..1ae6e6ae5
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/DiffTest.java
@@ -0,0 +1,448 @@
+package org.eclipse.emf.compare.tests.unit;
+
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertFalse;
+import static junit.framework.Assert.assertNull;
+import static junit.framework.Assert.assertSame;
+import static junit.framework.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.compare.CompareFactory;
+import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.junit.Test;
+
+/**
+ * Tests the behavior of the {@link Diff} class.
+ *
+ * @generated
+ */
+public class DiffTest extends AbstractCompareTest {
+ /**
+ * Tests the behavior of reference <code>requires</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testRequires() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_Requires();
+ Diff diff = CompareFactory.eINSTANCE.createDiff();
+ diff.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Diff requiresValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createDiff();
+ List<org.eclipse.emf.compare.Diff> listRequires = new ArrayList<org.eclipse.emf.compare.Diff>(1);
+ listRequires.add(requiresValue);
+
+ assertFalse(diff.eIsSet(feature));
+ assertTrue(diff.getRequires().isEmpty());
+
+ diff.getRequires().add(requiresValue);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(diff.getRequires().contains(requiresValue));
+ assertSame(diff.getRequires(), diff.eGet(feature));
+ assertSame(diff.getRequires(), diff.eGet(feature, false));
+ assertTrue(diff.eIsSet(feature));
+ assertTrue(requiresValue.getRequiredBy().contains(diff));
+
+ diff.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(diff.getRequires().isEmpty());
+ assertSame(diff.getRequires(), diff.eGet(feature));
+ assertSame(diff.getRequires(), diff.eGet(feature, false));
+ assertFalse(diff.eIsSet(feature));
+ assertFalse(requiresValue.getRequiredBy().contains(diff));
+
+ diff.eSet(feature, listRequires);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(diff.getRequires().contains(requiresValue));
+ assertSame(diff.getRequires(), diff.eGet(feature));
+ assertSame(diff.getRequires(), diff.eGet(feature, false));
+ assertTrue(diff.eIsSet(feature));
+ assertTrue(requiresValue.getRequiredBy().contains(diff));
+ }
+
+ /**
+ * Tests the behavior of reference <code>requiredBy</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testRequiredBy() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_RequiredBy();
+ Diff diff = CompareFactory.eINSTANCE.createDiff();
+ diff.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Diff requiredByValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createDiff();
+ List<org.eclipse.emf.compare.Diff> listRequiredBy = new ArrayList<org.eclipse.emf.compare.Diff>(1);
+ listRequiredBy.add(requiredByValue);
+
+ assertFalse(diff.eIsSet(feature));
+ assertTrue(diff.getRequiredBy().isEmpty());
+
+ diff.getRequiredBy().add(requiredByValue);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(diff.getRequiredBy().contains(requiredByValue));
+ assertSame(diff.getRequiredBy(), diff.eGet(feature));
+ assertSame(diff.getRequiredBy(), diff.eGet(feature, false));
+ assertTrue(diff.eIsSet(feature));
+ assertTrue(requiredByValue.getRequires().contains(diff));
+
+ diff.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(diff.getRequiredBy().isEmpty());
+ assertSame(diff.getRequiredBy(), diff.eGet(feature));
+ assertSame(diff.getRequiredBy(), diff.eGet(feature, false));
+ assertFalse(diff.eIsSet(feature));
+ assertFalse(requiredByValue.getRequires().contains(diff));
+
+ diff.eSet(feature, listRequiredBy);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(diff.getRequiredBy().contains(requiredByValue));
+ assertSame(diff.getRequiredBy(), diff.eGet(feature));
+ assertSame(diff.getRequiredBy(), diff.eGet(feature, false));
+ assertTrue(diff.eIsSet(feature));
+ assertTrue(requiredByValue.getRequires().contains(diff));
+ }
+
+ /**
+ * Tests the behavior of reference <code>refines</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testRefines() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_Refines();
+ Diff diff = CompareFactory.eINSTANCE.createDiff();
+ diff.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Diff refinesValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createDiff();
+ List<org.eclipse.emf.compare.Diff> listRefines = new ArrayList<org.eclipse.emf.compare.Diff>(1);
+ listRefines.add(refinesValue);
+
+ assertFalse(diff.eIsSet(feature));
+ assertTrue(diff.getRefines().isEmpty());
+
+ diff.getRefines().add(refinesValue);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(diff.getRefines().contains(refinesValue));
+ assertSame(diff.getRefines(), diff.eGet(feature));
+ assertSame(diff.getRefines(), diff.eGet(feature, false));
+ assertTrue(diff.eIsSet(feature));
+ assertTrue(refinesValue.getRefinedBy().contains(diff));
+
+ diff.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(diff.getRefines().isEmpty());
+ assertSame(diff.getRefines(), diff.eGet(feature));
+ assertSame(diff.getRefines(), diff.eGet(feature, false));
+ assertFalse(diff.eIsSet(feature));
+ assertFalse(refinesValue.getRefinedBy().contains(diff));
+
+ diff.eSet(feature, listRefines);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(diff.getRefines().contains(refinesValue));
+ assertSame(diff.getRefines(), diff.eGet(feature));
+ assertSame(diff.getRefines(), diff.eGet(feature, false));
+ assertTrue(diff.eIsSet(feature));
+ assertTrue(refinesValue.getRefinedBy().contains(diff));
+ }
+
+ /**
+ * Tests the behavior of reference <code>refinedBy</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testRefinedBy() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_RefinedBy();
+ Diff diff = CompareFactory.eINSTANCE.createDiff();
+ diff.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Diff refinedByValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createDiff();
+ List<org.eclipse.emf.compare.Diff> listRefinedBy = new ArrayList<org.eclipse.emf.compare.Diff>(1);
+ listRefinedBy.add(refinedByValue);
+
+ assertFalse(diff.eIsSet(feature));
+ assertTrue(diff.getRefinedBy().isEmpty());
+
+ diff.getRefinedBy().add(refinedByValue);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(diff.getRefinedBy().contains(refinedByValue));
+ assertSame(diff.getRefinedBy(), diff.eGet(feature));
+ assertSame(diff.getRefinedBy(), diff.eGet(feature, false));
+ assertTrue(diff.eIsSet(feature));
+ assertTrue(refinedByValue.getRefines().contains(diff));
+
+ diff.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(diff.getRefinedBy().isEmpty());
+ assertSame(diff.getRefinedBy(), diff.eGet(feature));
+ assertSame(diff.getRefinedBy(), diff.eGet(feature, false));
+ assertFalse(diff.eIsSet(feature));
+ assertFalse(refinedByValue.getRefines().contains(diff));
+
+ diff.eSet(feature, listRefinedBy);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(diff.getRefinedBy().contains(refinedByValue));
+ assertSame(diff.getRefinedBy(), diff.eGet(feature));
+ assertSame(diff.getRefinedBy(), diff.eGet(feature, false));
+ assertTrue(diff.eIsSet(feature));
+ assertTrue(refinedByValue.getRefines().contains(diff));
+ }
+
+ /**
+ * Tests the behavior of reference <code>match</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testMatch() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_Match();
+ Diff diff = CompareFactory.eINSTANCE.createDiff();
+ diff.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Match matchValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createMatch();
+
+ assertFalse(diff.eIsSet(feature));
+ assertNull(diff.getMatch());
+
+ diff.setMatch(matchValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(matchValue, diff.getMatch());
+ assertSame(diff.getMatch(), diff.eGet(feature));
+ assertSame(diff.getMatch(), diff.eGet(feature, false));
+ assertTrue(diff.eIsSet(feature));
+ assertTrue(matchValue.getDifferences().contains(diff));
+
+ diff.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertNull(diff.getMatch());
+ assertSame(diff.getMatch(), diff.eGet(feature));
+ assertSame(diff.getMatch(), diff.eGet(feature, false));
+ assertFalse(diff.eIsSet(feature));
+ assertFalse(matchValue.getDifferences().contains(diff));
+
+ diff.setMatch(matchValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(matchValue, diff.getMatch());
+ assertSame(diff.getMatch(), diff.eGet(feature));
+ assertSame(diff.getMatch(), diff.eGet(feature, false));
+ assertTrue(diff.eIsSet(feature));
+ assertTrue(matchValue.getDifferences().contains(diff));
+
+ diff.eSet(feature, matchValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(matchValue, diff.getMatch());
+ assertSame(diff.getMatch(), diff.eGet(feature));
+ assertSame(diff.getMatch(), diff.eGet(feature, false));
+ assertTrue(diff.eIsSet(feature));
+ assertTrue(matchValue.getDifferences().contains(diff));
+
+ diff.setMatch(null);
+ assertTrue(notified);
+ notified = false;
+ assertNull(diff.getMatch());
+ assertSame(feature.getDefaultValue(), diff.getMatch());
+ assertSame(diff.getMatch(), diff.eGet(feature));
+ assertSame(diff.getMatch(), diff.eGet(feature, false));
+ assertFalse(diff.eIsSet(feature));
+ assertFalse(matchValue.getDifferences().contains(diff));
+ }
+
+ /**
+ * Tests the behavior of reference <code>equivalentDiffs</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testEquivalentDiffs() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE
+ .getDiff_EquivalentDiffs();
+ Diff diff = CompareFactory.eINSTANCE.createDiff();
+ diff.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Equivalence equivalentDiffsValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createEquivalence();
+
+ assertFalse(diff.eIsSet(feature));
+ assertNull(diff.getEquivalentDiffs());
+
+ diff.setEquivalentDiffs(equivalentDiffsValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(equivalentDiffsValue, diff.getEquivalentDiffs());
+ assertSame(diff.getEquivalentDiffs(), diff.eGet(feature));
+ assertSame(diff.getEquivalentDiffs(), diff.eGet(feature, false));
+ assertTrue(diff.eIsSet(feature));
+ assertTrue(equivalentDiffsValue.getDifferences().contains(diff));
+
+ diff.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertNull(diff.getEquivalentDiffs());
+ assertSame(diff.getEquivalentDiffs(), diff.eGet(feature));
+ assertSame(diff.getEquivalentDiffs(), diff.eGet(feature, false));
+ assertFalse(diff.eIsSet(feature));
+ assertFalse(equivalentDiffsValue.getDifferences().contains(diff));
+
+ diff.setEquivalentDiffs(equivalentDiffsValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(equivalentDiffsValue, diff.getEquivalentDiffs());
+ assertSame(diff.getEquivalentDiffs(), diff.eGet(feature));
+ assertSame(diff.getEquivalentDiffs(), diff.eGet(feature, false));
+ assertTrue(diff.eIsSet(feature));
+ assertTrue(equivalentDiffsValue.getDifferences().contains(diff));
+
+ diff.eSet(feature, equivalentDiffsValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(equivalentDiffsValue, diff.getEquivalentDiffs());
+ assertSame(diff.getEquivalentDiffs(), diff.eGet(feature));
+ assertSame(diff.getEquivalentDiffs(), diff.eGet(feature, false));
+ assertTrue(diff.eIsSet(feature));
+ assertTrue(equivalentDiffsValue.getDifferences().contains(diff));
+
+ diff.setEquivalentDiffs(null);
+ assertTrue(notified);
+ notified = false;
+ assertNull(diff.getEquivalentDiffs());
+ assertSame(feature.getDefaultValue(), diff.getEquivalentDiffs());
+ assertSame(diff.getEquivalentDiffs(), diff.eGet(feature));
+ assertSame(diff.getEquivalentDiffs(), diff.eGet(feature, false));
+ assertFalse(diff.eIsSet(feature));
+ assertFalse(equivalentDiffsValue.getDifferences().contains(diff));
+ }
+
+ /**
+ * Tests the behavior of reference <code>conflict</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testConflict() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_Conflict();
+ Diff diff = CompareFactory.eINSTANCE.createDiff();
+ diff.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Conflict conflictValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createConflict();
+
+ assertFalse(diff.eIsSet(feature));
+ assertNull(diff.getConflict());
+
+ diff.setConflict(conflictValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(conflictValue, diff.getConflict());
+ assertSame(diff.getConflict(), diff.eGet(feature));
+ assertSame(diff.getConflict(), diff.eGet(feature, false));
+ assertTrue(diff.eIsSet(feature));
+ assertTrue(conflictValue.getDifferences().contains(diff));
+
+ diff.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertNull(diff.getConflict());
+ assertSame(diff.getConflict(), diff.eGet(feature));
+ assertSame(diff.getConflict(), diff.eGet(feature, false));
+ assertFalse(diff.eIsSet(feature));
+ assertFalse(conflictValue.getDifferences().contains(diff));
+
+ diff.setConflict(conflictValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(conflictValue, diff.getConflict());
+ assertSame(diff.getConflict(), diff.eGet(feature));
+ assertSame(diff.getConflict(), diff.eGet(feature, false));
+ assertTrue(diff.eIsSet(feature));
+ assertTrue(conflictValue.getDifferences().contains(diff));
+
+ diff.eSet(feature, conflictValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(conflictValue, diff.getConflict());
+ assertSame(diff.getConflict(), diff.eGet(feature));
+ assertSame(diff.getConflict(), diff.eGet(feature, false));
+ assertTrue(diff.eIsSet(feature));
+ assertTrue(conflictValue.getDifferences().contains(diff));
+
+ diff.setConflict(null);
+ assertTrue(notified);
+ notified = false;
+ assertNull(diff.getConflict());
+ assertSame(feature.getDefaultValue(), diff.getConflict());
+ assertSame(diff.getConflict(), diff.eGet(feature));
+ assertSame(diff.getConflict(), diff.eGet(feature, false));
+ assertFalse(diff.eIsSet(feature));
+ assertFalse(conflictValue.getDifferences().contains(diff));
+ }
+
+ /**
+ * Tests the behavior of attribute <code>kind</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testKind() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_Kind();
+ Diff diff = CompareFactory.eINSTANCE.createDiff();
+ diff.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.DifferenceKind kindValue = (org.eclipse.emf.compare.DifferenceKind)feature
+ .getDefaultValue();
+ for (org.eclipse.emf.compare.DifferenceKind aDifferenceKind : org.eclipse.emf.compare.DifferenceKind.VALUES) {
+ if (kindValue.getValue() != aDifferenceKind.getValue()) {
+ kindValue = aDifferenceKind;
+ break;
+ }
+ }
+
+ assertFalse(diff.eIsSet(feature));
+ assertEquals(feature.getDefaultValue(), diff.getKind());
+
+ diff.setKind(kindValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(kindValue, diff.getKind());
+ assertEquals(diff.getKind(), diff.eGet(feature));
+ assertTrue(diff.eIsSet(feature));
+
+ diff.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), diff.getKind());
+ assertEquals(diff.getKind(), diff.eGet(feature));
+ assertFalse(diff.eIsSet(feature));
+
+ diff.eSet(feature, kindValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(kindValue, diff.getKind());
+ assertEquals(diff.getKind(), diff.eGet(feature));
+ assertTrue(diff.eIsSet(feature));
+
+ diff.setKind(null);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), diff.getKind());
+ assertEquals(diff.getKind(), diff.eGet(feature));
+ assertFalse(diff.eIsSet(feature));
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/DifferenceKindTest.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/DifferenceKindTest.java
new file mode 100644
index 000000000..4d7530781
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/DifferenceKindTest.java
@@ -0,0 +1,58 @@
+package org.eclipse.emf.compare.tests.unit;
+
+import static junit.framework.Assert.assertNull;
+import static junit.framework.Assert.assertSame;
+
+import org.eclipse.emf.compare.DifferenceKind;
+import org.junit.Test;
+
+/**
+ * Tests the behavior of the {@link DifferenceKind} enumeration.
+ *
+ * @generated
+ */
+@SuppressWarnings("nls")
+public class DifferenceKindTest {
+ /**
+ * Tests the behavior of the {@link DifferenceKind#get(int)} method.
+ *
+ * @generated
+ */
+ @Test
+ public void testGetInt() {
+ int highestValue = -1;
+ for (DifferenceKind value : DifferenceKind.VALUES) {
+ assertSame(DifferenceKind.get(value.getValue()), value);
+ if (value.getValue() > highestValue) {
+ highestValue = value.getValue();
+ }
+ }
+ assertNull(DifferenceKind.get(++highestValue));
+ }
+
+ /**
+ * Tests the behavior of the {@link DifferenceKind#get(java.lang.String)} method.
+ *
+ * @generated
+ */
+ @Test
+ public void testGetString() {
+ for (DifferenceKind value : DifferenceKind.VALUES) {
+ assertSame(DifferenceKind.get(value.getLiteral()), value);
+ }
+ assertNull(DifferenceKind.get("ThisIsNotAValueOfTheTestedEnum"));
+ }
+
+ /**
+ * Tests the behavior of the {@link DifferenceKind#getByName(java.lang.String)} method.
+ *
+ * @generated
+ */
+ @Test
+ public void testGetByName() {
+ for (DifferenceKind value : DifferenceKind.VALUES) {
+ assertSame(DifferenceKind.getByName(value.getName()), value);
+ }
+ assertNull(DifferenceKind.getByName("ThisIsNotTheNameOfAValueFromTheTestedEnum"));
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/DifferenceSourceTest.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/DifferenceSourceTest.java
new file mode 100644
index 000000000..2a71deef6
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/DifferenceSourceTest.java
@@ -0,0 +1,58 @@
+package org.eclipse.emf.compare.tests.unit;
+
+import static junit.framework.Assert.assertNull;
+import static junit.framework.Assert.assertSame;
+
+import org.eclipse.emf.compare.DifferenceSource;
+import org.junit.Test;
+
+/**
+ * Tests the behavior of the {@link DifferenceSource} enumeration.
+ *
+ * @generated
+ */
+@SuppressWarnings("nls")
+public class DifferenceSourceTest {
+ /**
+ * Tests the behavior of the {@link DifferenceSource#get(int)} method.
+ *
+ * @generated
+ */
+ @Test
+ public void testGetInt() {
+ int highestValue = -1;
+ for (DifferenceSource value : DifferenceSource.VALUES) {
+ assertSame(DifferenceSource.get(value.getValue()), value);
+ if (value.getValue() > highestValue) {
+ highestValue = value.getValue();
+ }
+ }
+ assertNull(DifferenceSource.get(++highestValue));
+ }
+
+ /**
+ * Tests the behavior of the {@link DifferenceSource#get(java.lang.String)} method.
+ *
+ * @generated
+ */
+ @Test
+ public void testGetString() {
+ for (DifferenceSource value : DifferenceSource.VALUES) {
+ assertSame(DifferenceSource.get(value.getLiteral()), value);
+ }
+ assertNull(DifferenceSource.get("ThisIsNotAValueOfTheTestedEnum"));
+ }
+
+ /**
+ * Tests the behavior of the {@link DifferenceSource#getByName(java.lang.String)} method.
+ *
+ * @generated
+ */
+ @Test
+ public void testGetByName() {
+ for (DifferenceSource value : DifferenceSource.VALUES) {
+ assertSame(DifferenceSource.getByName(value.getName()), value);
+ }
+ assertNull(DifferenceSource.getByName("ThisIsNotTheNameOfAValueFromTheTestedEnum"));
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/EquivalenceTest.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/EquivalenceTest.java
new file mode 100644
index 000000000..aeae30b2d
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/EquivalenceTest.java
@@ -0,0 +1,68 @@
+package org.eclipse.emf.compare.tests.unit;
+
+import static junit.framework.Assert.assertFalse;
+import static junit.framework.Assert.assertSame;
+import static junit.framework.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.compare.CompareFactory;
+import org.eclipse.emf.compare.Equivalence;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.junit.Test;
+
+/**
+ * Tests the behavior of the {@link Equivalence} class.
+ *
+ * @generated
+ */
+public class EquivalenceTest extends AbstractCompareTest {
+ /**
+ * Tests the behavior of reference <code>differences</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testDifferences() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE
+ .getEquivalence_Differences();
+ Equivalence equivalence = CompareFactory.eINSTANCE.createEquivalence();
+ equivalence.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Diff differencesValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createDiff();
+ List<org.eclipse.emf.compare.Diff> listDifferences = new ArrayList<org.eclipse.emf.compare.Diff>(1);
+ listDifferences.add(differencesValue);
+
+ assertFalse(equivalence.eIsSet(feature));
+ assertTrue(equivalence.getDifferences().isEmpty());
+
+ equivalence.getDifferences().add(differencesValue);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(equivalence.getDifferences().contains(differencesValue));
+ assertSame(equivalence.getDifferences(), equivalence.eGet(feature));
+ assertSame(equivalence.getDifferences(), equivalence.eGet(feature, false));
+ assertTrue(equivalence.eIsSet(feature));
+ assertTrue(differencesValue.getEquivalentDiffs() == equivalence);
+
+ equivalence.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(equivalence.getDifferences().isEmpty());
+ assertSame(equivalence.getDifferences(), equivalence.eGet(feature));
+ assertSame(equivalence.getDifferences(), equivalence.eGet(feature, false));
+ assertFalse(equivalence.eIsSet(feature));
+ assertFalse(differencesValue.getEquivalentDiffs() == equivalence);
+
+ equivalence.eSet(feature, listDifferences);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(equivalence.getDifferences().contains(differencesValue));
+ assertSame(equivalence.getDifferences(), equivalence.eGet(feature));
+ assertSame(equivalence.getDifferences(), equivalence.eGet(feature, false));
+ assertTrue(equivalence.eIsSet(feature));
+ assertTrue(differencesValue.getEquivalentDiffs() == equivalence);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/MatchResourceTest.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/MatchResourceTest.java
new file mode 100644
index 000000000..83514e4f7
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/MatchResourceTest.java
@@ -0,0 +1,154 @@
+package org.eclipse.emf.compare.tests.unit;
+
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertFalse;
+import static junit.framework.Assert.assertTrue;
+
+import org.eclipse.emf.compare.CompareFactory;
+import org.eclipse.emf.compare.MatchResource;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.junit.Test;
+
+/**
+ * Tests the behavior of the {@link MatchResource} class.
+ *
+ * @generated
+ */
+public class MatchResourceTest extends AbstractCompareTest {
+
+ /**
+ * Tests the behavior of attribute <code>leftURI</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testLeftURI() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE
+ .getMatchResource_LeftURI();
+ MatchResource matchResource = CompareFactory.eINSTANCE.createMatchResource();
+ matchResource.eAdapters().add(new MockEAdapter());
+ java.lang.String leftURIValue = (java.lang.String)getValueDistinctFromDefault(feature);
+
+ assertFalse(matchResource.eIsSet(feature));
+ assertEquals(feature.getDefaultValue(), matchResource.getLeftURI());
+
+ matchResource.setLeftURI(leftURIValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(leftURIValue, matchResource.getLeftURI());
+ assertEquals(matchResource.getLeftURI(), matchResource.eGet(feature));
+ assertTrue(matchResource.eIsSet(feature));
+
+ matchResource.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), matchResource.getLeftURI());
+ assertEquals(matchResource.getLeftURI(), matchResource.eGet(feature));
+ assertFalse(matchResource.eIsSet(feature));
+
+ matchResource.eSet(feature, leftURIValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(leftURIValue, matchResource.getLeftURI());
+ assertEquals(matchResource.getLeftURI(), matchResource.eGet(feature));
+ assertTrue(matchResource.eIsSet(feature));
+
+ matchResource.setLeftURI(null);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), matchResource.getLeftURI());
+ assertEquals(matchResource.getLeftURI(), matchResource.eGet(feature));
+ assertFalse(matchResource.eIsSet(feature));
+ }
+
+ /**
+ * Tests the behavior of attribute <code>rightURI</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testRightURI() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE
+ .getMatchResource_RightURI();
+ MatchResource matchResource = CompareFactory.eINSTANCE.createMatchResource();
+ matchResource.eAdapters().add(new MockEAdapter());
+ java.lang.String rightURIValue = (java.lang.String)getValueDistinctFromDefault(feature);
+
+ assertFalse(matchResource.eIsSet(feature));
+ assertEquals(feature.getDefaultValue(), matchResource.getRightURI());
+
+ matchResource.setRightURI(rightURIValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(rightURIValue, matchResource.getRightURI());
+ assertEquals(matchResource.getRightURI(), matchResource.eGet(feature));
+ assertTrue(matchResource.eIsSet(feature));
+
+ matchResource.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), matchResource.getRightURI());
+ assertEquals(matchResource.getRightURI(), matchResource.eGet(feature));
+ assertFalse(matchResource.eIsSet(feature));
+
+ matchResource.eSet(feature, rightURIValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(rightURIValue, matchResource.getRightURI());
+ assertEquals(matchResource.getRightURI(), matchResource.eGet(feature));
+ assertTrue(matchResource.eIsSet(feature));
+
+ matchResource.setRightURI(null);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), matchResource.getRightURI());
+ assertEquals(matchResource.getRightURI(), matchResource.eGet(feature));
+ assertFalse(matchResource.eIsSet(feature));
+ }
+
+ /**
+ * Tests the behavior of attribute <code>originURI</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testOriginURI() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE
+ .getMatchResource_OriginURI();
+ MatchResource matchResource = CompareFactory.eINSTANCE.createMatchResource();
+ matchResource.eAdapters().add(new MockEAdapter());
+ java.lang.String originURIValue = (java.lang.String)getValueDistinctFromDefault(feature);
+
+ assertFalse(matchResource.eIsSet(feature));
+ assertEquals(feature.getDefaultValue(), matchResource.getOriginURI());
+
+ matchResource.setOriginURI(originURIValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(originURIValue, matchResource.getOriginURI());
+ assertEquals(matchResource.getOriginURI(), matchResource.eGet(feature));
+ assertTrue(matchResource.eIsSet(feature));
+
+ matchResource.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), matchResource.getOriginURI());
+ assertEquals(matchResource.getOriginURI(), matchResource.eGet(feature));
+ assertFalse(matchResource.eIsSet(feature));
+
+ matchResource.eSet(feature, originURIValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(originURIValue, matchResource.getOriginURI());
+ assertEquals(matchResource.getOriginURI(), matchResource.eGet(feature));
+ assertTrue(matchResource.eIsSet(feature));
+
+ matchResource.setOriginURI(null);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), matchResource.getOriginURI());
+ assertEquals(matchResource.getOriginURI(), matchResource.eGet(feature));
+ assertFalse(matchResource.eIsSet(feature));
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/MatchTest.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/MatchTest.java
new file mode 100644
index 000000000..49d75a729
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/MatchTest.java
@@ -0,0 +1,285 @@
+package org.eclipse.emf.compare.tests.unit;
+
+import static junit.framework.Assert.assertFalse;
+import static junit.framework.Assert.assertNull;
+import static junit.framework.Assert.assertSame;
+import static junit.framework.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.compare.CompareFactory;
+import org.eclipse.emf.compare.Match;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.junit.Test;
+
+/**
+ * Tests the behavior of the {@link Match} class.
+ *
+ * @generated
+ */
+public class MatchTest extends AbstractCompareTest {
+ /**
+ * Tests the behavior of reference <code>subMatches</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testSubMatches() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getMatch_SubMatches();
+ Match match = CompareFactory.eINSTANCE.createMatch();
+ match.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Match subMatchesValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createMatch();
+ List<org.eclipse.emf.compare.Match> listSubMatches = new ArrayList<org.eclipse.emf.compare.Match>(1);
+ listSubMatches.add(subMatchesValue);
+
+ assertFalse(match.eIsSet(feature));
+ assertTrue(match.getSubMatches().isEmpty());
+
+ match.getSubMatches().add(subMatchesValue);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(match.getSubMatches().contains(subMatchesValue));
+ assertSame(match.getSubMatches(), match.eGet(feature));
+ assertSame(match.getSubMatches(), match.eGet(feature, false));
+ assertTrue(match.eIsSet(feature));
+
+ match.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(match.getSubMatches().isEmpty());
+ assertSame(match.getSubMatches(), match.eGet(feature));
+ assertSame(match.getSubMatches(), match.eGet(feature, false));
+ assertFalse(match.eIsSet(feature));
+
+ match.eSet(feature, listSubMatches);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(match.getSubMatches().contains(subMatchesValue));
+ assertSame(match.getSubMatches(), match.eGet(feature));
+ assertSame(match.getSubMatches(), match.eGet(feature, false));
+ assertTrue(match.eIsSet(feature));
+ }
+
+ /**
+ * Tests the behavior of reference <code>differences</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testDifferences() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getMatch_Differences();
+ Match match = CompareFactory.eINSTANCE.createMatch();
+ match.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Diff differencesValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createDiff();
+ List<org.eclipse.emf.compare.Diff> listDifferences = new ArrayList<org.eclipse.emf.compare.Diff>(1);
+ listDifferences.add(differencesValue);
+
+ assertFalse(match.eIsSet(feature));
+ assertTrue(match.getDifferences().isEmpty());
+
+ match.getDifferences().add(differencesValue);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(match.getDifferences().contains(differencesValue));
+ assertSame(match.getDifferences(), match.eGet(feature));
+ assertSame(match.getDifferences(), match.eGet(feature, false));
+ assertTrue(match.eIsSet(feature));
+ assertTrue(differencesValue.getMatch() == match);
+
+ match.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(match.getDifferences().isEmpty());
+ assertSame(match.getDifferences(), match.eGet(feature));
+ assertSame(match.getDifferences(), match.eGet(feature, false));
+ assertFalse(match.eIsSet(feature));
+ assertFalse(differencesValue.getMatch() == match);
+
+ match.eSet(feature, listDifferences);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(match.getDifferences().contains(differencesValue));
+ assertSame(match.getDifferences(), match.eGet(feature));
+ assertSame(match.getDifferences(), match.eGet(feature, false));
+ assertTrue(match.eIsSet(feature));
+ assertTrue(differencesValue.getMatch() == match);
+ }
+
+ /**
+ * Tests the behavior of reference <code>left</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testLeft() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getMatch_Left();
+ Match match = CompareFactory.eINSTANCE.createMatch();
+ match.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.ecore.EObject leftValue = org.eclipse.emf.ecore.EcoreFactory.eINSTANCE
+ .createEObject();
+
+ assertFalse(match.eIsSet(feature));
+ assertNull(match.getLeft());
+
+ match.setLeft(leftValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(leftValue, match.getLeft());
+ assertSame(match.getLeft(), match.eGet(feature));
+ assertSame(match.getLeft(), match.eGet(feature, false));
+ assertTrue(match.eIsSet(feature));
+
+ match.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertNull(match.getLeft());
+ assertSame(match.getLeft(), match.eGet(feature));
+ assertSame(match.getLeft(), match.eGet(feature, false));
+ assertFalse(match.eIsSet(feature));
+
+ match.setLeft(leftValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(leftValue, match.getLeft());
+ assertSame(match.getLeft(), match.eGet(feature));
+ assertSame(match.getLeft(), match.eGet(feature, false));
+ assertTrue(match.eIsSet(feature));
+
+ match.eSet(feature, leftValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(leftValue, match.getLeft());
+ assertSame(match.getLeft(), match.eGet(feature));
+ assertSame(match.getLeft(), match.eGet(feature, false));
+ assertTrue(match.eIsSet(feature));
+
+ match.setLeft(null);
+ assertTrue(notified);
+ notified = false;
+ assertNull(match.getLeft());
+ assertSame(feature.getDefaultValue(), match.getLeft());
+ assertSame(match.getLeft(), match.eGet(feature));
+ assertSame(match.getLeft(), match.eGet(feature, false));
+ assertFalse(match.eIsSet(feature));
+ }
+
+ /**
+ * Tests the behavior of reference <code>right</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testRight() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getMatch_Right();
+ Match match = CompareFactory.eINSTANCE.createMatch();
+ match.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.ecore.EObject rightValue = org.eclipse.emf.ecore.EcoreFactory.eINSTANCE
+ .createEObject();
+
+ assertFalse(match.eIsSet(feature));
+ assertNull(match.getRight());
+
+ match.setRight(rightValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(rightValue, match.getRight());
+ assertSame(match.getRight(), match.eGet(feature));
+ assertSame(match.getRight(), match.eGet(feature, false));
+ assertTrue(match.eIsSet(feature));
+
+ match.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertNull(match.getRight());
+ assertSame(match.getRight(), match.eGet(feature));
+ assertSame(match.getRight(), match.eGet(feature, false));
+ assertFalse(match.eIsSet(feature));
+
+ match.setRight(rightValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(rightValue, match.getRight());
+ assertSame(match.getRight(), match.eGet(feature));
+ assertSame(match.getRight(), match.eGet(feature, false));
+ assertTrue(match.eIsSet(feature));
+
+ match.eSet(feature, rightValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(rightValue, match.getRight());
+ assertSame(match.getRight(), match.eGet(feature));
+ assertSame(match.getRight(), match.eGet(feature, false));
+ assertTrue(match.eIsSet(feature));
+
+ match.setRight(null);
+ assertTrue(notified);
+ notified = false;
+ assertNull(match.getRight());
+ assertSame(feature.getDefaultValue(), match.getRight());
+ assertSame(match.getRight(), match.eGet(feature));
+ assertSame(match.getRight(), match.eGet(feature, false));
+ assertFalse(match.eIsSet(feature));
+ }
+
+ /**
+ * Tests the behavior of reference <code>origin</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testOrigin() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getMatch_Origin();
+ Match match = CompareFactory.eINSTANCE.createMatch();
+ match.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.ecore.EObject originValue = org.eclipse.emf.ecore.EcoreFactory.eINSTANCE
+ .createEObject();
+
+ assertFalse(match.eIsSet(feature));
+ assertNull(match.getOrigin());
+
+ match.setOrigin(originValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(originValue, match.getOrigin());
+ assertSame(match.getOrigin(), match.eGet(feature));
+ assertSame(match.getOrigin(), match.eGet(feature, false));
+ assertTrue(match.eIsSet(feature));
+
+ match.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertNull(match.getOrigin());
+ assertSame(match.getOrigin(), match.eGet(feature));
+ assertSame(match.getOrigin(), match.eGet(feature, false));
+ assertFalse(match.eIsSet(feature));
+
+ match.setOrigin(originValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(originValue, match.getOrigin());
+ assertSame(match.getOrigin(), match.eGet(feature));
+ assertSame(match.getOrigin(), match.eGet(feature, false));
+ assertTrue(match.eIsSet(feature));
+
+ match.eSet(feature, originValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(originValue, match.getOrigin());
+ assertSame(match.getOrigin(), match.eGet(feature));
+ assertSame(match.getOrigin(), match.eGet(feature, false));
+ assertTrue(match.eIsSet(feature));
+
+ match.setOrigin(null);
+ assertTrue(notified);
+ notified = false;
+ assertNull(match.getOrigin());
+ assertSame(feature.getDefaultValue(), match.getOrigin());
+ assertSame(match.getOrigin(), match.eGet(feature));
+ assertSame(match.getOrigin(), match.eGet(feature, false));
+ assertFalse(match.eIsSet(feature));
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/ReferenceChangeTest.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/ReferenceChangeTest.java
new file mode 100644
index 000000000..cf5c20c03
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/ReferenceChangeTest.java
@@ -0,0 +1,566 @@
+package org.eclipse.emf.compare.tests.unit;
+
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertFalse;
+import static junit.framework.Assert.assertNull;
+import static junit.framework.Assert.assertSame;
+import static junit.framework.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.compare.CompareFactory;
+import org.eclipse.emf.compare.ReferenceChange;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.junit.Test;
+
+/**
+ * Tests the behavior of the {@link ReferenceChange} class.
+ *
+ * @generated
+ */
+public class ReferenceChangeTest extends AbstractCompareTest {
+ /**
+ * Tests the behavior of reference <code>requires</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testRequires() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_Requires();
+ ReferenceChange referenceChange = CompareFactory.eINSTANCE.createReferenceChange();
+ referenceChange.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Diff requiresValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createDiff();
+ List<org.eclipse.emf.compare.Diff> listRequires = new ArrayList<org.eclipse.emf.compare.Diff>(1);
+ listRequires.add(requiresValue);
+
+ assertFalse(referenceChange.eIsSet(feature));
+ assertTrue(referenceChange.getRequires().isEmpty());
+
+ referenceChange.getRequires().add(requiresValue);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(referenceChange.getRequires().contains(requiresValue));
+ assertSame(referenceChange.getRequires(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getRequires(), referenceChange.eGet(feature, false));
+ assertTrue(referenceChange.eIsSet(feature));
+ assertTrue(requiresValue.getRequiredBy().contains(referenceChange));
+
+ referenceChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(referenceChange.getRequires().isEmpty());
+ assertSame(referenceChange.getRequires(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getRequires(), referenceChange.eGet(feature, false));
+ assertFalse(referenceChange.eIsSet(feature));
+ assertFalse(requiresValue.getRequiredBy().contains(referenceChange));
+
+ referenceChange.eSet(feature, listRequires);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(referenceChange.getRequires().contains(requiresValue));
+ assertSame(referenceChange.getRequires(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getRequires(), referenceChange.eGet(feature, false));
+ assertTrue(referenceChange.eIsSet(feature));
+ assertTrue(requiresValue.getRequiredBy().contains(referenceChange));
+ }
+
+ /**
+ * Tests the behavior of reference <code>requiredBy</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testRequiredBy() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_RequiredBy();
+ ReferenceChange referenceChange = CompareFactory.eINSTANCE.createReferenceChange();
+ referenceChange.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Diff requiredByValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createDiff();
+ List<org.eclipse.emf.compare.Diff> listRequiredBy = new ArrayList<org.eclipse.emf.compare.Diff>(1);
+ listRequiredBy.add(requiredByValue);
+
+ assertFalse(referenceChange.eIsSet(feature));
+ assertTrue(referenceChange.getRequiredBy().isEmpty());
+
+ referenceChange.getRequiredBy().add(requiredByValue);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(referenceChange.getRequiredBy().contains(requiredByValue));
+ assertSame(referenceChange.getRequiredBy(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getRequiredBy(), referenceChange.eGet(feature, false));
+ assertTrue(referenceChange.eIsSet(feature));
+ assertTrue(requiredByValue.getRequires().contains(referenceChange));
+
+ referenceChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(referenceChange.getRequiredBy().isEmpty());
+ assertSame(referenceChange.getRequiredBy(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getRequiredBy(), referenceChange.eGet(feature, false));
+ assertFalse(referenceChange.eIsSet(feature));
+ assertFalse(requiredByValue.getRequires().contains(referenceChange));
+
+ referenceChange.eSet(feature, listRequiredBy);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(referenceChange.getRequiredBy().contains(requiredByValue));
+ assertSame(referenceChange.getRequiredBy(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getRequiredBy(), referenceChange.eGet(feature, false));
+ assertTrue(referenceChange.eIsSet(feature));
+ assertTrue(requiredByValue.getRequires().contains(referenceChange));
+ }
+
+ /**
+ * Tests the behavior of reference <code>refines</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testRefines() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_Refines();
+ ReferenceChange referenceChange = CompareFactory.eINSTANCE.createReferenceChange();
+ referenceChange.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Diff refinesValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createDiff();
+ List<org.eclipse.emf.compare.Diff> listRefines = new ArrayList<org.eclipse.emf.compare.Diff>(1);
+ listRefines.add(refinesValue);
+
+ assertFalse(referenceChange.eIsSet(feature));
+ assertTrue(referenceChange.getRefines().isEmpty());
+
+ referenceChange.getRefines().add(refinesValue);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(referenceChange.getRefines().contains(refinesValue));
+ assertSame(referenceChange.getRefines(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getRefines(), referenceChange.eGet(feature, false));
+ assertTrue(referenceChange.eIsSet(feature));
+ assertTrue(refinesValue.getRefinedBy().contains(referenceChange));
+
+ referenceChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(referenceChange.getRefines().isEmpty());
+ assertSame(referenceChange.getRefines(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getRefines(), referenceChange.eGet(feature, false));
+ assertFalse(referenceChange.eIsSet(feature));
+ assertFalse(refinesValue.getRefinedBy().contains(referenceChange));
+
+ referenceChange.eSet(feature, listRefines);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(referenceChange.getRefines().contains(refinesValue));
+ assertSame(referenceChange.getRefines(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getRefines(), referenceChange.eGet(feature, false));
+ assertTrue(referenceChange.eIsSet(feature));
+ assertTrue(refinesValue.getRefinedBy().contains(referenceChange));
+ }
+
+ /**
+ * Tests the behavior of reference <code>refinedBy</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testRefinedBy() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_RefinedBy();
+ ReferenceChange referenceChange = CompareFactory.eINSTANCE.createReferenceChange();
+ referenceChange.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Diff refinedByValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createDiff();
+ List<org.eclipse.emf.compare.Diff> listRefinedBy = new ArrayList<org.eclipse.emf.compare.Diff>(1);
+ listRefinedBy.add(refinedByValue);
+
+ assertFalse(referenceChange.eIsSet(feature));
+ assertTrue(referenceChange.getRefinedBy().isEmpty());
+
+ referenceChange.getRefinedBy().add(refinedByValue);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(referenceChange.getRefinedBy().contains(refinedByValue));
+ assertSame(referenceChange.getRefinedBy(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getRefinedBy(), referenceChange.eGet(feature, false));
+ assertTrue(referenceChange.eIsSet(feature));
+ assertTrue(refinedByValue.getRefines().contains(referenceChange));
+
+ referenceChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(referenceChange.getRefinedBy().isEmpty());
+ assertSame(referenceChange.getRefinedBy(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getRefinedBy(), referenceChange.eGet(feature, false));
+ assertFalse(referenceChange.eIsSet(feature));
+ assertFalse(refinedByValue.getRefines().contains(referenceChange));
+
+ referenceChange.eSet(feature, listRefinedBy);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(referenceChange.getRefinedBy().contains(refinedByValue));
+ assertSame(referenceChange.getRefinedBy(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getRefinedBy(), referenceChange.eGet(feature, false));
+ assertTrue(referenceChange.eIsSet(feature));
+ assertTrue(refinedByValue.getRefines().contains(referenceChange));
+ }
+
+ /**
+ * Tests the behavior of reference <code>match</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testMatch() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_Match();
+ ReferenceChange referenceChange = CompareFactory.eINSTANCE.createReferenceChange();
+ referenceChange.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Match matchValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createMatch();
+
+ assertFalse(referenceChange.eIsSet(feature));
+ assertNull(referenceChange.getMatch());
+
+ referenceChange.setMatch(matchValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(matchValue, referenceChange.getMatch());
+ assertSame(referenceChange.getMatch(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getMatch(), referenceChange.eGet(feature, false));
+ assertTrue(referenceChange.eIsSet(feature));
+ assertTrue(matchValue.getDifferences().contains(referenceChange));
+
+ referenceChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertNull(referenceChange.getMatch());
+ assertSame(referenceChange.getMatch(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getMatch(), referenceChange.eGet(feature, false));
+ assertFalse(referenceChange.eIsSet(feature));
+ assertFalse(matchValue.getDifferences().contains(referenceChange));
+
+ referenceChange.setMatch(matchValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(matchValue, referenceChange.getMatch());
+ assertSame(referenceChange.getMatch(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getMatch(), referenceChange.eGet(feature, false));
+ assertTrue(referenceChange.eIsSet(feature));
+ assertTrue(matchValue.getDifferences().contains(referenceChange));
+
+ referenceChange.eSet(feature, matchValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(matchValue, referenceChange.getMatch());
+ assertSame(referenceChange.getMatch(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getMatch(), referenceChange.eGet(feature, false));
+ assertTrue(referenceChange.eIsSet(feature));
+ assertTrue(matchValue.getDifferences().contains(referenceChange));
+
+ referenceChange.setMatch(null);
+ assertTrue(notified);
+ notified = false;
+ assertNull(referenceChange.getMatch());
+ assertSame(feature.getDefaultValue(), referenceChange.getMatch());
+ assertSame(referenceChange.getMatch(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getMatch(), referenceChange.eGet(feature, false));
+ assertFalse(referenceChange.eIsSet(feature));
+ assertFalse(matchValue.getDifferences().contains(referenceChange));
+ }
+
+ /**
+ * Tests the behavior of reference <code>equivalentDiffs</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testEquivalentDiffs() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE
+ .getDiff_EquivalentDiffs();
+ ReferenceChange referenceChange = CompareFactory.eINSTANCE.createReferenceChange();
+ referenceChange.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Equivalence equivalentDiffsValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createEquivalence();
+
+ assertFalse(referenceChange.eIsSet(feature));
+ assertNull(referenceChange.getEquivalentDiffs());
+
+ referenceChange.setEquivalentDiffs(equivalentDiffsValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(equivalentDiffsValue, referenceChange.getEquivalentDiffs());
+ assertSame(referenceChange.getEquivalentDiffs(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getEquivalentDiffs(), referenceChange.eGet(feature, false));
+ assertTrue(referenceChange.eIsSet(feature));
+ assertTrue(equivalentDiffsValue.getDifferences().contains(referenceChange));
+
+ referenceChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertNull(referenceChange.getEquivalentDiffs());
+ assertSame(referenceChange.getEquivalentDiffs(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getEquivalentDiffs(), referenceChange.eGet(feature, false));
+ assertFalse(referenceChange.eIsSet(feature));
+ assertFalse(equivalentDiffsValue.getDifferences().contains(referenceChange));
+
+ referenceChange.setEquivalentDiffs(equivalentDiffsValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(equivalentDiffsValue, referenceChange.getEquivalentDiffs());
+ assertSame(referenceChange.getEquivalentDiffs(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getEquivalentDiffs(), referenceChange.eGet(feature, false));
+ assertTrue(referenceChange.eIsSet(feature));
+ assertTrue(equivalentDiffsValue.getDifferences().contains(referenceChange));
+
+ referenceChange.eSet(feature, equivalentDiffsValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(equivalentDiffsValue, referenceChange.getEquivalentDiffs());
+ assertSame(referenceChange.getEquivalentDiffs(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getEquivalentDiffs(), referenceChange.eGet(feature, false));
+ assertTrue(referenceChange.eIsSet(feature));
+ assertTrue(equivalentDiffsValue.getDifferences().contains(referenceChange));
+
+ referenceChange.setEquivalentDiffs(null);
+ assertTrue(notified);
+ notified = false;
+ assertNull(referenceChange.getEquivalentDiffs());
+ assertSame(feature.getDefaultValue(), referenceChange.getEquivalentDiffs());
+ assertSame(referenceChange.getEquivalentDiffs(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getEquivalentDiffs(), referenceChange.eGet(feature, false));
+ assertFalse(referenceChange.eIsSet(feature));
+ assertFalse(equivalentDiffsValue.getDifferences().contains(referenceChange));
+ }
+
+ /**
+ * Tests the behavior of reference <code>conflict</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testConflict() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_Conflict();
+ ReferenceChange referenceChange = CompareFactory.eINSTANCE.createReferenceChange();
+ referenceChange.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Conflict conflictValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createConflict();
+
+ assertFalse(referenceChange.eIsSet(feature));
+ assertNull(referenceChange.getConflict());
+
+ referenceChange.setConflict(conflictValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(conflictValue, referenceChange.getConflict());
+ assertSame(referenceChange.getConflict(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getConflict(), referenceChange.eGet(feature, false));
+ assertTrue(referenceChange.eIsSet(feature));
+ assertTrue(conflictValue.getDifferences().contains(referenceChange));
+
+ referenceChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertNull(referenceChange.getConflict());
+ assertSame(referenceChange.getConflict(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getConflict(), referenceChange.eGet(feature, false));
+ assertFalse(referenceChange.eIsSet(feature));
+ assertFalse(conflictValue.getDifferences().contains(referenceChange));
+
+ referenceChange.setConflict(conflictValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(conflictValue, referenceChange.getConflict());
+ assertSame(referenceChange.getConflict(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getConflict(), referenceChange.eGet(feature, false));
+ assertTrue(referenceChange.eIsSet(feature));
+ assertTrue(conflictValue.getDifferences().contains(referenceChange));
+
+ referenceChange.eSet(feature, conflictValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(conflictValue, referenceChange.getConflict());
+ assertSame(referenceChange.getConflict(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getConflict(), referenceChange.eGet(feature, false));
+ assertTrue(referenceChange.eIsSet(feature));
+ assertTrue(conflictValue.getDifferences().contains(referenceChange));
+
+ referenceChange.setConflict(null);
+ assertTrue(notified);
+ notified = false;
+ assertNull(referenceChange.getConflict());
+ assertSame(feature.getDefaultValue(), referenceChange.getConflict());
+ assertSame(referenceChange.getConflict(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getConflict(), referenceChange.eGet(feature, false));
+ assertFalse(referenceChange.eIsSet(feature));
+ assertFalse(conflictValue.getDifferences().contains(referenceChange));
+ }
+
+ /**
+ * Tests the behavior of reference <code>reference</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testReference() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE
+ .getReferenceChange_Reference();
+ ReferenceChange referenceChange = CompareFactory.eINSTANCE.createReferenceChange();
+ referenceChange.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.ecore.EReference referenceValue = org.eclipse.emf.ecore.EcoreFactory.eINSTANCE
+ .createEReference();
+
+ assertFalse(referenceChange.eIsSet(feature));
+ assertNull(referenceChange.getReference());
+
+ referenceChange.setReference(referenceValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(referenceValue, referenceChange.getReference());
+ assertSame(referenceChange.getReference(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getReference(), referenceChange.eGet(feature, false));
+ assertTrue(referenceChange.eIsSet(feature));
+
+ referenceChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertNull(referenceChange.getReference());
+ assertSame(referenceChange.getReference(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getReference(), referenceChange.eGet(feature, false));
+ assertFalse(referenceChange.eIsSet(feature));
+
+ referenceChange.setReference(referenceValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(referenceValue, referenceChange.getReference());
+ assertSame(referenceChange.getReference(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getReference(), referenceChange.eGet(feature, false));
+ assertTrue(referenceChange.eIsSet(feature));
+
+ referenceChange.eSet(feature, referenceValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(referenceValue, referenceChange.getReference());
+ assertSame(referenceChange.getReference(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getReference(), referenceChange.eGet(feature, false));
+ assertTrue(referenceChange.eIsSet(feature));
+
+ referenceChange.setReference(null);
+ assertTrue(notified);
+ notified = false;
+ assertNull(referenceChange.getReference());
+ assertSame(feature.getDefaultValue(), referenceChange.getReference());
+ assertSame(referenceChange.getReference(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getReference(), referenceChange.eGet(feature, false));
+ assertFalse(referenceChange.eIsSet(feature));
+ }
+
+ /**
+ * Tests the behavior of reference <code>value</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testValue() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE
+ .getReferenceChange_Value();
+ ReferenceChange referenceChange = CompareFactory.eINSTANCE.createReferenceChange();
+ referenceChange.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.ecore.EObject valueValue = org.eclipse.emf.ecore.EcoreFactory.eINSTANCE
+ .createEObject();
+
+ assertFalse(referenceChange.eIsSet(feature));
+ assertNull(referenceChange.getValue());
+
+ referenceChange.setValue(valueValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(valueValue, referenceChange.getValue());
+ assertSame(referenceChange.getValue(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getValue(), referenceChange.eGet(feature, false));
+ assertTrue(referenceChange.eIsSet(feature));
+
+ referenceChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertNull(referenceChange.getValue());
+ assertSame(referenceChange.getValue(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getValue(), referenceChange.eGet(feature, false));
+ assertFalse(referenceChange.eIsSet(feature));
+
+ referenceChange.setValue(valueValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(valueValue, referenceChange.getValue());
+ assertSame(referenceChange.getValue(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getValue(), referenceChange.eGet(feature, false));
+ assertTrue(referenceChange.eIsSet(feature));
+
+ referenceChange.eSet(feature, valueValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(valueValue, referenceChange.getValue());
+ assertSame(referenceChange.getValue(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getValue(), referenceChange.eGet(feature, false));
+ assertTrue(referenceChange.eIsSet(feature));
+
+ referenceChange.setValue(null);
+ assertTrue(notified);
+ notified = false;
+ assertNull(referenceChange.getValue());
+ assertSame(feature.getDefaultValue(), referenceChange.getValue());
+ assertSame(referenceChange.getValue(), referenceChange.eGet(feature));
+ assertSame(referenceChange.getValue(), referenceChange.eGet(feature, false));
+ assertFalse(referenceChange.eIsSet(feature));
+ }
+
+ /**
+ * Tests the behavior of attribute <code>kind</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testKind() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_Kind();
+ ReferenceChange referenceChange = CompareFactory.eINSTANCE.createReferenceChange();
+ referenceChange.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.DifferenceKind kindValue = (org.eclipse.emf.compare.DifferenceKind)feature
+ .getDefaultValue();
+ for (org.eclipse.emf.compare.DifferenceKind aDifferenceKind : org.eclipse.emf.compare.DifferenceKind.VALUES) {
+ if (kindValue.getValue() != aDifferenceKind.getValue()) {
+ kindValue = aDifferenceKind;
+ break;
+ }
+ }
+
+ assertFalse(referenceChange.eIsSet(feature));
+ assertEquals(feature.getDefaultValue(), referenceChange.getKind());
+
+ referenceChange.setKind(kindValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(kindValue, referenceChange.getKind());
+ assertEquals(referenceChange.getKind(), referenceChange.eGet(feature));
+ assertTrue(referenceChange.eIsSet(feature));
+
+ referenceChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), referenceChange.getKind());
+ assertEquals(referenceChange.getKind(), referenceChange.eGet(feature));
+ assertFalse(referenceChange.eIsSet(feature));
+
+ referenceChange.eSet(feature, kindValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(kindValue, referenceChange.getKind());
+ assertEquals(referenceChange.getKind(), referenceChange.eGet(feature));
+ assertTrue(referenceChange.eIsSet(feature));
+
+ referenceChange.setKind(null);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), referenceChange.getKind());
+ assertEquals(referenceChange.getKind(), referenceChange.eGet(feature));
+ assertFalse(referenceChange.eIsSet(feature));
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/ResourceAttachmentChangeTest.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/ResourceAttachmentChangeTest.java
new file mode 100644
index 000000000..311d669d6
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/ResourceAttachmentChangeTest.java
@@ -0,0 +1,507 @@
+package org.eclipse.emf.compare.tests.unit;
+
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertFalse;
+import static junit.framework.Assert.assertNull;
+import static junit.framework.Assert.assertSame;
+import static junit.framework.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.compare.CompareFactory;
+import org.eclipse.emf.compare.ResourceAttachmentChange;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.junit.Test;
+
+/**
+ * Tests the behavior of the {@link ResourceAttachmentChange} class.
+ *
+ * @generated
+ */
+public class ResourceAttachmentChangeTest extends AbstractCompareTest {
+ /**
+ * Tests the behavior of reference <code>requires</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testRequires() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_Requires();
+ ResourceAttachmentChange resourceAttachmentChange = CompareFactory.eINSTANCE
+ .createResourceAttachmentChange();
+ resourceAttachmentChange.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Diff requiresValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createDiff();
+ List<org.eclipse.emf.compare.Diff> listRequires = new ArrayList<org.eclipse.emf.compare.Diff>(1);
+ listRequires.add(requiresValue);
+
+ assertFalse(resourceAttachmentChange.eIsSet(feature));
+ assertTrue(resourceAttachmentChange.getRequires().isEmpty());
+
+ resourceAttachmentChange.getRequires().add(requiresValue);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(resourceAttachmentChange.getRequires().contains(requiresValue));
+ assertSame(resourceAttachmentChange.getRequires(), resourceAttachmentChange.eGet(feature));
+ assertSame(resourceAttachmentChange.getRequires(), resourceAttachmentChange.eGet(feature, false));
+ assertTrue(resourceAttachmentChange.eIsSet(feature));
+ assertTrue(requiresValue.getRequiredBy().contains(resourceAttachmentChange));
+
+ resourceAttachmentChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(resourceAttachmentChange.getRequires().isEmpty());
+ assertSame(resourceAttachmentChange.getRequires(), resourceAttachmentChange.eGet(feature));
+ assertSame(resourceAttachmentChange.getRequires(), resourceAttachmentChange.eGet(feature, false));
+ assertFalse(resourceAttachmentChange.eIsSet(feature));
+ assertFalse(requiresValue.getRequiredBy().contains(resourceAttachmentChange));
+
+ resourceAttachmentChange.eSet(feature, listRequires);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(resourceAttachmentChange.getRequires().contains(requiresValue));
+ assertSame(resourceAttachmentChange.getRequires(), resourceAttachmentChange.eGet(feature));
+ assertSame(resourceAttachmentChange.getRequires(), resourceAttachmentChange.eGet(feature, false));
+ assertTrue(resourceAttachmentChange.eIsSet(feature));
+ assertTrue(requiresValue.getRequiredBy().contains(resourceAttachmentChange));
+ }
+
+ /**
+ * Tests the behavior of reference <code>requiredBy</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testRequiredBy() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_RequiredBy();
+ ResourceAttachmentChange resourceAttachmentChange = CompareFactory.eINSTANCE
+ .createResourceAttachmentChange();
+ resourceAttachmentChange.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Diff requiredByValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createDiff();
+ List<org.eclipse.emf.compare.Diff> listRequiredBy = new ArrayList<org.eclipse.emf.compare.Diff>(1);
+ listRequiredBy.add(requiredByValue);
+
+ assertFalse(resourceAttachmentChange.eIsSet(feature));
+ assertTrue(resourceAttachmentChange.getRequiredBy().isEmpty());
+
+ resourceAttachmentChange.getRequiredBy().add(requiredByValue);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(resourceAttachmentChange.getRequiredBy().contains(requiredByValue));
+ assertSame(resourceAttachmentChange.getRequiredBy(), resourceAttachmentChange.eGet(feature));
+ assertSame(resourceAttachmentChange.getRequiredBy(), resourceAttachmentChange.eGet(feature, false));
+ assertTrue(resourceAttachmentChange.eIsSet(feature));
+ assertTrue(requiredByValue.getRequires().contains(resourceAttachmentChange));
+
+ resourceAttachmentChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(resourceAttachmentChange.getRequiredBy().isEmpty());
+ assertSame(resourceAttachmentChange.getRequiredBy(), resourceAttachmentChange.eGet(feature));
+ assertSame(resourceAttachmentChange.getRequiredBy(), resourceAttachmentChange.eGet(feature, false));
+ assertFalse(resourceAttachmentChange.eIsSet(feature));
+ assertFalse(requiredByValue.getRequires().contains(resourceAttachmentChange));
+
+ resourceAttachmentChange.eSet(feature, listRequiredBy);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(resourceAttachmentChange.getRequiredBy().contains(requiredByValue));
+ assertSame(resourceAttachmentChange.getRequiredBy(), resourceAttachmentChange.eGet(feature));
+ assertSame(resourceAttachmentChange.getRequiredBy(), resourceAttachmentChange.eGet(feature, false));
+ assertTrue(resourceAttachmentChange.eIsSet(feature));
+ assertTrue(requiredByValue.getRequires().contains(resourceAttachmentChange));
+ }
+
+ /**
+ * Tests the behavior of reference <code>refines</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testRefines() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_Refines();
+ ResourceAttachmentChange resourceAttachmentChange = CompareFactory.eINSTANCE
+ .createResourceAttachmentChange();
+ resourceAttachmentChange.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Diff refinesValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createDiff();
+ List<org.eclipse.emf.compare.Diff> listRefines = new ArrayList<org.eclipse.emf.compare.Diff>(1);
+ listRefines.add(refinesValue);
+
+ assertFalse(resourceAttachmentChange.eIsSet(feature));
+ assertTrue(resourceAttachmentChange.getRefines().isEmpty());
+
+ resourceAttachmentChange.getRefines().add(refinesValue);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(resourceAttachmentChange.getRefines().contains(refinesValue));
+ assertSame(resourceAttachmentChange.getRefines(), resourceAttachmentChange.eGet(feature));
+ assertSame(resourceAttachmentChange.getRefines(), resourceAttachmentChange.eGet(feature, false));
+ assertTrue(resourceAttachmentChange.eIsSet(feature));
+ assertTrue(refinesValue.getRefinedBy().contains(resourceAttachmentChange));
+
+ resourceAttachmentChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(resourceAttachmentChange.getRefines().isEmpty());
+ assertSame(resourceAttachmentChange.getRefines(), resourceAttachmentChange.eGet(feature));
+ assertSame(resourceAttachmentChange.getRefines(), resourceAttachmentChange.eGet(feature, false));
+ assertFalse(resourceAttachmentChange.eIsSet(feature));
+ assertFalse(refinesValue.getRefinedBy().contains(resourceAttachmentChange));
+
+ resourceAttachmentChange.eSet(feature, listRefines);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(resourceAttachmentChange.getRefines().contains(refinesValue));
+ assertSame(resourceAttachmentChange.getRefines(), resourceAttachmentChange.eGet(feature));
+ assertSame(resourceAttachmentChange.getRefines(), resourceAttachmentChange.eGet(feature, false));
+ assertTrue(resourceAttachmentChange.eIsSet(feature));
+ assertTrue(refinesValue.getRefinedBy().contains(resourceAttachmentChange));
+ }
+
+ /**
+ * Tests the behavior of reference <code>refinedBy</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testRefinedBy() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_RefinedBy();
+ ResourceAttachmentChange resourceAttachmentChange = CompareFactory.eINSTANCE
+ .createResourceAttachmentChange();
+ resourceAttachmentChange.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Diff refinedByValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createDiff();
+ List<org.eclipse.emf.compare.Diff> listRefinedBy = new ArrayList<org.eclipse.emf.compare.Diff>(1);
+ listRefinedBy.add(refinedByValue);
+
+ assertFalse(resourceAttachmentChange.eIsSet(feature));
+ assertTrue(resourceAttachmentChange.getRefinedBy().isEmpty());
+
+ resourceAttachmentChange.getRefinedBy().add(refinedByValue);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(resourceAttachmentChange.getRefinedBy().contains(refinedByValue));
+ assertSame(resourceAttachmentChange.getRefinedBy(), resourceAttachmentChange.eGet(feature));
+ assertSame(resourceAttachmentChange.getRefinedBy(), resourceAttachmentChange.eGet(feature, false));
+ assertTrue(resourceAttachmentChange.eIsSet(feature));
+ assertTrue(refinedByValue.getRefines().contains(resourceAttachmentChange));
+
+ resourceAttachmentChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(resourceAttachmentChange.getRefinedBy().isEmpty());
+ assertSame(resourceAttachmentChange.getRefinedBy(), resourceAttachmentChange.eGet(feature));
+ assertSame(resourceAttachmentChange.getRefinedBy(), resourceAttachmentChange.eGet(feature, false));
+ assertFalse(resourceAttachmentChange.eIsSet(feature));
+ assertFalse(refinedByValue.getRefines().contains(resourceAttachmentChange));
+
+ resourceAttachmentChange.eSet(feature, listRefinedBy);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(resourceAttachmentChange.getRefinedBy().contains(refinedByValue));
+ assertSame(resourceAttachmentChange.getRefinedBy(), resourceAttachmentChange.eGet(feature));
+ assertSame(resourceAttachmentChange.getRefinedBy(), resourceAttachmentChange.eGet(feature, false));
+ assertTrue(resourceAttachmentChange.eIsSet(feature));
+ assertTrue(refinedByValue.getRefines().contains(resourceAttachmentChange));
+ }
+
+ /**
+ * Tests the behavior of reference <code>match</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testMatch() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_Match();
+ ResourceAttachmentChange resourceAttachmentChange = CompareFactory.eINSTANCE
+ .createResourceAttachmentChange();
+ resourceAttachmentChange.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Match matchValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createMatch();
+
+ assertFalse(resourceAttachmentChange.eIsSet(feature));
+ assertNull(resourceAttachmentChange.getMatch());
+
+ resourceAttachmentChange.setMatch(matchValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(matchValue, resourceAttachmentChange.getMatch());
+ assertSame(resourceAttachmentChange.getMatch(), resourceAttachmentChange.eGet(feature));
+ assertSame(resourceAttachmentChange.getMatch(), resourceAttachmentChange.eGet(feature, false));
+ assertTrue(resourceAttachmentChange.eIsSet(feature));
+ assertTrue(matchValue.getDifferences().contains(resourceAttachmentChange));
+
+ resourceAttachmentChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertNull(resourceAttachmentChange.getMatch());
+ assertSame(resourceAttachmentChange.getMatch(), resourceAttachmentChange.eGet(feature));
+ assertSame(resourceAttachmentChange.getMatch(), resourceAttachmentChange.eGet(feature, false));
+ assertFalse(resourceAttachmentChange.eIsSet(feature));
+ assertFalse(matchValue.getDifferences().contains(resourceAttachmentChange));
+
+ resourceAttachmentChange.setMatch(matchValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(matchValue, resourceAttachmentChange.getMatch());
+ assertSame(resourceAttachmentChange.getMatch(), resourceAttachmentChange.eGet(feature));
+ assertSame(resourceAttachmentChange.getMatch(), resourceAttachmentChange.eGet(feature, false));
+ assertTrue(resourceAttachmentChange.eIsSet(feature));
+ assertTrue(matchValue.getDifferences().contains(resourceAttachmentChange));
+
+ resourceAttachmentChange.eSet(feature, matchValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(matchValue, resourceAttachmentChange.getMatch());
+ assertSame(resourceAttachmentChange.getMatch(), resourceAttachmentChange.eGet(feature));
+ assertSame(resourceAttachmentChange.getMatch(), resourceAttachmentChange.eGet(feature, false));
+ assertTrue(resourceAttachmentChange.eIsSet(feature));
+ assertTrue(matchValue.getDifferences().contains(resourceAttachmentChange));
+
+ resourceAttachmentChange.setMatch(null);
+ assertTrue(notified);
+ notified = false;
+ assertNull(resourceAttachmentChange.getMatch());
+ assertSame(feature.getDefaultValue(), resourceAttachmentChange.getMatch());
+ assertSame(resourceAttachmentChange.getMatch(), resourceAttachmentChange.eGet(feature));
+ assertSame(resourceAttachmentChange.getMatch(), resourceAttachmentChange.eGet(feature, false));
+ assertFalse(resourceAttachmentChange.eIsSet(feature));
+ assertFalse(matchValue.getDifferences().contains(resourceAttachmentChange));
+ }
+
+ /**
+ * Tests the behavior of reference <code>equivalentDiffs</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testEquivalentDiffs() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE
+ .getDiff_EquivalentDiffs();
+ ResourceAttachmentChange resourceAttachmentChange = CompareFactory.eINSTANCE
+ .createResourceAttachmentChange();
+ resourceAttachmentChange.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Equivalence equivalentDiffsValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createEquivalence();
+
+ assertFalse(resourceAttachmentChange.eIsSet(feature));
+ assertNull(resourceAttachmentChange.getEquivalentDiffs());
+
+ resourceAttachmentChange.setEquivalentDiffs(equivalentDiffsValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(equivalentDiffsValue, resourceAttachmentChange.getEquivalentDiffs());
+ assertSame(resourceAttachmentChange.getEquivalentDiffs(), resourceAttachmentChange.eGet(feature));
+ assertSame(resourceAttachmentChange.getEquivalentDiffs(), resourceAttachmentChange.eGet(feature,
+ false));
+ assertTrue(resourceAttachmentChange.eIsSet(feature));
+ assertTrue(equivalentDiffsValue.getDifferences().contains(resourceAttachmentChange));
+
+ resourceAttachmentChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertNull(resourceAttachmentChange.getEquivalentDiffs());
+ assertSame(resourceAttachmentChange.getEquivalentDiffs(), resourceAttachmentChange.eGet(feature));
+ assertSame(resourceAttachmentChange.getEquivalentDiffs(), resourceAttachmentChange.eGet(feature,
+ false));
+ assertFalse(resourceAttachmentChange.eIsSet(feature));
+ assertFalse(equivalentDiffsValue.getDifferences().contains(resourceAttachmentChange));
+
+ resourceAttachmentChange.setEquivalentDiffs(equivalentDiffsValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(equivalentDiffsValue, resourceAttachmentChange.getEquivalentDiffs());
+ assertSame(resourceAttachmentChange.getEquivalentDiffs(), resourceAttachmentChange.eGet(feature));
+ assertSame(resourceAttachmentChange.getEquivalentDiffs(), resourceAttachmentChange.eGet(feature,
+ false));
+ assertTrue(resourceAttachmentChange.eIsSet(feature));
+ assertTrue(equivalentDiffsValue.getDifferences().contains(resourceAttachmentChange));
+
+ resourceAttachmentChange.eSet(feature, equivalentDiffsValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(equivalentDiffsValue, resourceAttachmentChange.getEquivalentDiffs());
+ assertSame(resourceAttachmentChange.getEquivalentDiffs(), resourceAttachmentChange.eGet(feature));
+ assertSame(resourceAttachmentChange.getEquivalentDiffs(), resourceAttachmentChange.eGet(feature,
+ false));
+ assertTrue(resourceAttachmentChange.eIsSet(feature));
+ assertTrue(equivalentDiffsValue.getDifferences().contains(resourceAttachmentChange));
+
+ resourceAttachmentChange.setEquivalentDiffs(null);
+ assertTrue(notified);
+ notified = false;
+ assertNull(resourceAttachmentChange.getEquivalentDiffs());
+ assertSame(feature.getDefaultValue(), resourceAttachmentChange.getEquivalentDiffs());
+ assertSame(resourceAttachmentChange.getEquivalentDiffs(), resourceAttachmentChange.eGet(feature));
+ assertSame(resourceAttachmentChange.getEquivalentDiffs(), resourceAttachmentChange.eGet(feature,
+ false));
+ assertFalse(resourceAttachmentChange.eIsSet(feature));
+ assertFalse(equivalentDiffsValue.getDifferences().contains(resourceAttachmentChange));
+ }
+
+ /**
+ * Tests the behavior of reference <code>conflict</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testConflict() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_Conflict();
+ ResourceAttachmentChange resourceAttachmentChange = CompareFactory.eINSTANCE
+ .createResourceAttachmentChange();
+ resourceAttachmentChange.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Conflict conflictValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createConflict();
+
+ assertFalse(resourceAttachmentChange.eIsSet(feature));
+ assertNull(resourceAttachmentChange.getConflict());
+
+ resourceAttachmentChange.setConflict(conflictValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(conflictValue, resourceAttachmentChange.getConflict());
+ assertSame(resourceAttachmentChange.getConflict(), resourceAttachmentChange.eGet(feature));
+ assertSame(resourceAttachmentChange.getConflict(), resourceAttachmentChange.eGet(feature, false));
+ assertTrue(resourceAttachmentChange.eIsSet(feature));
+ assertTrue(conflictValue.getDifferences().contains(resourceAttachmentChange));
+
+ resourceAttachmentChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertNull(resourceAttachmentChange.getConflict());
+ assertSame(resourceAttachmentChange.getConflict(), resourceAttachmentChange.eGet(feature));
+ assertSame(resourceAttachmentChange.getConflict(), resourceAttachmentChange.eGet(feature, false));
+ assertFalse(resourceAttachmentChange.eIsSet(feature));
+ assertFalse(conflictValue.getDifferences().contains(resourceAttachmentChange));
+
+ resourceAttachmentChange.setConflict(conflictValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(conflictValue, resourceAttachmentChange.getConflict());
+ assertSame(resourceAttachmentChange.getConflict(), resourceAttachmentChange.eGet(feature));
+ assertSame(resourceAttachmentChange.getConflict(), resourceAttachmentChange.eGet(feature, false));
+ assertTrue(resourceAttachmentChange.eIsSet(feature));
+ assertTrue(conflictValue.getDifferences().contains(resourceAttachmentChange));
+
+ resourceAttachmentChange.eSet(feature, conflictValue);
+ assertTrue(notified);
+ notified = false;
+ assertSame(conflictValue, resourceAttachmentChange.getConflict());
+ assertSame(resourceAttachmentChange.getConflict(), resourceAttachmentChange.eGet(feature));
+ assertSame(resourceAttachmentChange.getConflict(), resourceAttachmentChange.eGet(feature, false));
+ assertTrue(resourceAttachmentChange.eIsSet(feature));
+ assertTrue(conflictValue.getDifferences().contains(resourceAttachmentChange));
+
+ resourceAttachmentChange.setConflict(null);
+ assertTrue(notified);
+ notified = false;
+ assertNull(resourceAttachmentChange.getConflict());
+ assertSame(feature.getDefaultValue(), resourceAttachmentChange.getConflict());
+ assertSame(resourceAttachmentChange.getConflict(), resourceAttachmentChange.eGet(feature));
+ assertSame(resourceAttachmentChange.getConflict(), resourceAttachmentChange.eGet(feature, false));
+ assertFalse(resourceAttachmentChange.eIsSet(feature));
+ assertFalse(conflictValue.getDifferences().contains(resourceAttachmentChange));
+ }
+
+ /**
+ * Tests the behavior of attribute <code>kind</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testKind() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_Kind();
+ ResourceAttachmentChange resourceAttachmentChange = CompareFactory.eINSTANCE
+ .createResourceAttachmentChange();
+ resourceAttachmentChange.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.DifferenceKind kindValue = (org.eclipse.emf.compare.DifferenceKind)feature
+ .getDefaultValue();
+ for (org.eclipse.emf.compare.DifferenceKind aDifferenceKind : org.eclipse.emf.compare.DifferenceKind.VALUES) {
+ if (kindValue.getValue() != aDifferenceKind.getValue()) {
+ kindValue = aDifferenceKind;
+ break;
+ }
+ }
+
+ assertFalse(resourceAttachmentChange.eIsSet(feature));
+ assertEquals(feature.getDefaultValue(), resourceAttachmentChange.getKind());
+
+ resourceAttachmentChange.setKind(kindValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(kindValue, resourceAttachmentChange.getKind());
+ assertEquals(resourceAttachmentChange.getKind(), resourceAttachmentChange.eGet(feature));
+ assertTrue(resourceAttachmentChange.eIsSet(feature));
+
+ resourceAttachmentChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), resourceAttachmentChange.getKind());
+ assertEquals(resourceAttachmentChange.getKind(), resourceAttachmentChange.eGet(feature));
+ assertFalse(resourceAttachmentChange.eIsSet(feature));
+
+ resourceAttachmentChange.eSet(feature, kindValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(kindValue, resourceAttachmentChange.getKind());
+ assertEquals(resourceAttachmentChange.getKind(), resourceAttachmentChange.eGet(feature));
+ assertTrue(resourceAttachmentChange.eIsSet(feature));
+
+ resourceAttachmentChange.setKind(null);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), resourceAttachmentChange.getKind());
+ assertEquals(resourceAttachmentChange.getKind(), resourceAttachmentChange.eGet(feature));
+ assertFalse(resourceAttachmentChange.eIsSet(feature));
+ }
+
+ /**
+ * Tests the behavior of attribute <code>resourceURI</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testResourceURI() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE
+ .getResourceAttachmentChange_ResourceURI();
+ ResourceAttachmentChange resourceAttachmentChange = CompareFactory.eINSTANCE
+ .createResourceAttachmentChange();
+ resourceAttachmentChange.eAdapters().add(new MockEAdapter());
+ java.lang.String resourceURIValue = (java.lang.String)getValueDistinctFromDefault(feature);
+
+ assertFalse(resourceAttachmentChange.eIsSet(feature));
+ assertEquals(feature.getDefaultValue(), resourceAttachmentChange.getResourceURI());
+
+ resourceAttachmentChange.setResourceURI(resourceURIValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(resourceURIValue, resourceAttachmentChange.getResourceURI());
+ assertEquals(resourceAttachmentChange.getResourceURI(), resourceAttachmentChange.eGet(feature));
+ assertTrue(resourceAttachmentChange.eIsSet(feature));
+
+ resourceAttachmentChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), resourceAttachmentChange.getResourceURI());
+ assertEquals(resourceAttachmentChange.getResourceURI(), resourceAttachmentChange.eGet(feature));
+ assertFalse(resourceAttachmentChange.eIsSet(feature));
+
+ resourceAttachmentChange.eSet(feature, resourceURIValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(resourceURIValue, resourceAttachmentChange.getResourceURI());
+ assertEquals(resourceAttachmentChange.getResourceURI(), resourceAttachmentChange.eGet(feature));
+ assertTrue(resourceAttachmentChange.eIsSet(feature));
+
+ resourceAttachmentChange.setResourceURI(null);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), resourceAttachmentChange.getResourceURI());
+ assertEquals(resourceAttachmentChange.getResourceURI(), resourceAttachmentChange.eGet(feature));
+ assertFalse(resourceAttachmentChange.eIsSet(feature));
+ }
+
+}

Back to the top