Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlgoubet2012-09-17 10:26:34 -0400
committerlgoubet2012-09-17 10:26:34 -0400
commit10d37226d1e8c6dbebf514c3fc7b73c5e5078c01 (patch)
tree6c2b65dd6a78de322f561e2254ef3dc746464f1c /plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse
parent50deaae4b7459c2ad711992360b68586166f370f (diff)
downloadorg.eclipse.emf.compare-10d37226d1e8c6dbebf514c3fc7b73c5e5078c01.tar.gz
org.eclipse.emf.compare-10d37226d1e8c6dbebf514c3fc7b73c5e5078c01.tar.xz
org.eclipse.emf.compare-10d37226d1e8c6dbebf514c3fc7b73c5e5078c01.zip
Update metamodel tests with the new concepts
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.java5
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/AbstractCompareTest.java9
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/AttributeChangeTest.java128
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/CompareFactoryTest.java78
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/ComparisonTest.java98
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/ConflictKindTest.java62
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/ConflictTest.java52
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/DiffTest.java128
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/DifferenceStateTest.java62
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/MatchResourceTest.java134
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/MatchTest.java18
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/ReferenceChangeTest.java128
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/ResourceAttachmentChangeTest.java130
13 files changed, 966 insertions, 66 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
index 78816ed04..81fcebf05 100644
--- 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
@@ -19,10 +19,12 @@ 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.ConflictKindTest;
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.DifferenceStateTest;
import org.eclipse.emf.compare.tests.unit.EquivalenceTest;
import org.eclipse.emf.compare.tests.unit.MatchResourceTest;
import org.eclipse.emf.compare.tests.unit.MatchTest;
@@ -41,7 +43,8 @@ import org.junit.runners.Suite.SuiteClasses;
@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, })
+ DifferenceStateTest.class, ConflictKindTest.class, CompareAdapterFactoryTest.class,
+ CompareFactoryTest.class, CompareSwitchTest.class, })
public class CompareTestSuite {
/**
* Standalone launcher for package compare's tests.
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
index 545878bd6..4fcd2674b 100644
--- 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
@@ -12,16 +12,15 @@ 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;
+import org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl;
/**
- * This class defines utility methods and will be used as the superclass of all {@link TestCase} for
- * "class-related" tests.
+ * This class defines utility methods and will be used as the superclass of all test cases for "class-related"
+ * tests.
*
* @generated
*/
@@ -229,6 +228,8 @@ public class AbstractCompareTest {
return Calendar.getInstance().getTime();
} else if (feature.getEType() == EcorePackage.Literals.EJAVA_OBJECT) {
return new Object();
+ } else if (feature.getEType() == EcorePackage.Literals.ERESOURCE) {
+ return new XMIResourceImpl();
} else {
throw new RuntimeException();
}
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
index 43b54e654..03daf89d3 100644
--- 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
@@ -278,7 +278,7 @@ public class AttributeChangeTest extends AbstractCompareTest {
}
/**
- * Tests the behavior of reference <code>equivalentDiffs</code>'s accessors.
+ * Tests the behavior of reference <code>equivalence</code>'s accessors.
*
* @generated
*/
@@ -287,20 +287,20 @@ public class AttributeChangeTest extends AbstractCompareTest {
EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_Equivalence();
AttributeChange attributeChange = CompareFactory.eINSTANCE.createAttributeChange();
attributeChange.eAdapters().add(new MockEAdapter());
- org.eclipse.emf.compare.Equivalence equivalentDiffsValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ org.eclipse.emf.compare.Equivalence equivalenceValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
.createEquivalence();
assertFalse(attributeChange.eIsSet(feature));
assertNull(attributeChange.getEquivalence());
- attributeChange.setEquivalence(equivalentDiffsValue);
+ attributeChange.setEquivalence(equivalenceValue);
assertTrue(notified);
notified = false;
- assertSame(equivalentDiffsValue, attributeChange.getEquivalence());
+ assertSame(equivalenceValue, attributeChange.getEquivalence());
assertSame(attributeChange.getEquivalence(), attributeChange.eGet(feature));
assertSame(attributeChange.getEquivalence(), attributeChange.eGet(feature, false));
assertTrue(attributeChange.eIsSet(feature));
- assertTrue(equivalentDiffsValue.getDifferences().contains(attributeChange));
+ assertTrue(equivalenceValue.getDifferences().contains(attributeChange));
attributeChange.eUnset(feature);
assertTrue(notified);
@@ -309,25 +309,25 @@ public class AttributeChangeTest extends AbstractCompareTest {
assertSame(attributeChange.getEquivalence(), attributeChange.eGet(feature));
assertSame(attributeChange.getEquivalence(), attributeChange.eGet(feature, false));
assertFalse(attributeChange.eIsSet(feature));
- assertFalse(equivalentDiffsValue.getDifferences().contains(attributeChange));
+ assertFalse(equivalenceValue.getDifferences().contains(attributeChange));
- attributeChange.setEquivalence(equivalentDiffsValue);
+ attributeChange.setEquivalence(equivalenceValue);
assertTrue(notified);
notified = false;
- assertSame(equivalentDiffsValue, attributeChange.getEquivalence());
+ assertSame(equivalenceValue, attributeChange.getEquivalence());
assertSame(attributeChange.getEquivalence(), attributeChange.eGet(feature));
assertSame(attributeChange.getEquivalence(), attributeChange.eGet(feature, false));
assertTrue(attributeChange.eIsSet(feature));
- assertTrue(equivalentDiffsValue.getDifferences().contains(attributeChange));
+ assertTrue(equivalenceValue.getDifferences().contains(attributeChange));
- attributeChange.eSet(feature, equivalentDiffsValue);
+ attributeChange.eSet(feature, equivalenceValue);
assertTrue(notified);
notified = false;
- assertSame(equivalentDiffsValue, attributeChange.getEquivalence());
+ assertSame(equivalenceValue, attributeChange.getEquivalence());
assertSame(attributeChange.getEquivalence(), attributeChange.eGet(feature));
assertSame(attributeChange.getEquivalence(), attributeChange.eGet(feature, false));
assertTrue(attributeChange.eIsSet(feature));
- assertTrue(equivalentDiffsValue.getDifferences().contains(attributeChange));
+ assertTrue(equivalenceValue.getDifferences().contains(attributeChange));
attributeChange.setEquivalence(null);
assertTrue(notified);
@@ -337,7 +337,7 @@ public class AttributeChangeTest extends AbstractCompareTest {
assertSame(attributeChange.getEquivalence(), attributeChange.eGet(feature));
assertSame(attributeChange.getEquivalence(), attributeChange.eGet(feature, false));
assertFalse(attributeChange.eIsSet(feature));
- assertFalse(equivalentDiffsValue.getDifferences().contains(attributeChange));
+ assertFalse(equivalenceValue.getDifferences().contains(attributeChange));
}
/**
@@ -514,6 +514,108 @@ public class AttributeChangeTest extends AbstractCompareTest {
}
/**
+ * Tests the behavior of attribute <code>source</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testSource() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_Source();
+ AttributeChange attributeChange = CompareFactory.eINSTANCE.createAttributeChange();
+ attributeChange.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.DifferenceSource sourceValue = (org.eclipse.emf.compare.DifferenceSource)feature
+ .getDefaultValue();
+ for (org.eclipse.emf.compare.DifferenceSource aDifferenceSource : org.eclipse.emf.compare.DifferenceSource.VALUES) {
+ if (sourceValue.getValue() != aDifferenceSource.getValue()) {
+ sourceValue = aDifferenceSource;
+ break;
+ }
+ }
+
+ assertFalse(attributeChange.eIsSet(feature));
+ assertEquals(feature.getDefaultValue(), attributeChange.getSource());
+
+ attributeChange.setSource(sourceValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(sourceValue, attributeChange.getSource());
+ assertEquals(attributeChange.getSource(), attributeChange.eGet(feature));
+ assertTrue(attributeChange.eIsSet(feature));
+
+ attributeChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), attributeChange.getSource());
+ assertEquals(attributeChange.getSource(), attributeChange.eGet(feature));
+ assertFalse(attributeChange.eIsSet(feature));
+
+ attributeChange.eSet(feature, sourceValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(sourceValue, attributeChange.getSource());
+ assertEquals(attributeChange.getSource(), attributeChange.eGet(feature));
+ assertTrue(attributeChange.eIsSet(feature));
+
+ attributeChange.setSource(null);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), attributeChange.getSource());
+ assertEquals(attributeChange.getSource(), attributeChange.eGet(feature));
+ assertFalse(attributeChange.eIsSet(feature));
+ }
+
+ /**
+ * Tests the behavior of attribute <code>state</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testState() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_State();
+ AttributeChange attributeChange = CompareFactory.eINSTANCE.createAttributeChange();
+ attributeChange.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.DifferenceState stateValue = (org.eclipse.emf.compare.DifferenceState)feature
+ .getDefaultValue();
+ for (org.eclipse.emf.compare.DifferenceState aDifferenceState : org.eclipse.emf.compare.DifferenceState.VALUES) {
+ if (stateValue.getValue() != aDifferenceState.getValue()) {
+ stateValue = aDifferenceState;
+ break;
+ }
+ }
+
+ assertFalse(attributeChange.eIsSet(feature));
+ assertEquals(feature.getDefaultValue(), attributeChange.getState());
+
+ attributeChange.setState(stateValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(stateValue, attributeChange.getState());
+ assertEquals(attributeChange.getState(), attributeChange.eGet(feature));
+ assertTrue(attributeChange.eIsSet(feature));
+
+ attributeChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), attributeChange.getState());
+ assertEquals(attributeChange.getState(), attributeChange.eGet(feature));
+ assertFalse(attributeChange.eIsSet(feature));
+
+ attributeChange.eSet(feature, stateValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(stateValue, attributeChange.getState());
+ assertEquals(attributeChange.getState(), attributeChange.eGet(feature));
+ assertTrue(attributeChange.eIsSet(feature));
+
+ attributeChange.setState(null);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), attributeChange.getState());
+ assertEquals(attributeChange.getState(), attributeChange.eGet(feature));
+ assertFalse(attributeChange.eIsSet(feature));
+ }
+
+ /**
* Tests the behavior of attribute <code>value</code>'s accessors.
*
* @generated
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
index b171158e7..a255b91f9 100644
--- 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
@@ -21,9 +21,11 @@ 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.ConflictKind;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.DifferenceKind;
import org.eclipse.emf.compare.DifferenceSource;
+import org.eclipse.emf.compare.DifferenceState;
import org.eclipse.emf.compare.Equivalence;
import org.eclipse.emf.compare.Match;
import org.eclipse.emf.compare.MatchResource;
@@ -234,6 +236,36 @@ public class CompareFactoryTest {
}
/**
+ * Ensures that converting {@link DifferenceState} to String can be done through the factory.
+ *
+ * @generated
+ */
+ @Test
+ public void testConvertDifferenceStateToString() {
+ for (DifferenceState value : DifferenceState.VALUES) {
+ Object result = CompareFactory.eINSTANCE.convertToString(
+ ComparePackage.Literals.DIFFERENCE_STATE, value);
+ assertNotNull(result);
+ assertEquals(value.toString(), result);
+ }
+ }
+
+ /**
+ * Ensures that converting {@link ConflictKind} to String can be done through the factory.
+ *
+ * @generated
+ */
+ @Test
+ public void testConvertConflictKindToString() {
+ for (ConflictKind value : ConflictKind.VALUES) {
+ Object result = CompareFactory.eINSTANCE.convertToString(ComparePackage.Literals.CONFLICT_KIND,
+ value);
+ assertNotNull(result);
+ assertEquals(value.toString(), result);
+ }
+ }
+
+ /**
* Ensures that trying to convert an {@link EEnum} from another package to String yields the expected
* exception.
*
@@ -298,6 +330,52 @@ public class CompareFactoryTest {
}
/**
+ * Ensures that creating {@link DifferenceState} from String can be done through the factory.
+ *
+ * @generated
+ */
+ @Test
+ public void testCreateDifferenceStateFromString() {
+ for (DifferenceState value : DifferenceState.VALUES) {
+ Object result = CompareFactory.eINSTANCE.createFromString(
+ ComparePackage.Literals.DIFFERENCE_STATE, value.getLiteral());
+ assertNotNull(result);
+ assertSame(value, result);
+
+ try {
+ CompareFactory.eINSTANCE.createFromString(ComparePackage.Literals.DIFFERENCE_STATE,
+ "ThisShouldntBeAKnownEEnumLiteral");
+ fail("Expected IllegalArgumentException hasn't been thrown");
+ } catch (IllegalArgumentException e) {
+ // Expected behavior
+ }
+ }
+ }
+
+ /**
+ * Ensures that creating {@link ConflictKind} from String can be done through the factory.
+ *
+ * @generated
+ */
+ @Test
+ public void testCreateConflictKindFromString() {
+ for (ConflictKind value : ConflictKind.VALUES) {
+ Object result = CompareFactory.eINSTANCE.createFromString(ComparePackage.Literals.CONFLICT_KIND,
+ value.getLiteral());
+ assertNotNull(result);
+ assertSame(value, result);
+
+ try {
+ CompareFactory.eINSTANCE.createFromString(ComparePackage.Literals.CONFLICT_KIND,
+ "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.
*
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
index 392589ac3..d3fbbf996 100644
--- 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
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.emf.compare.tests.unit;
+import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertSame;
import static junit.framework.Assert.assertTrue;
@@ -161,4 +162,101 @@ public class ComparisonTest extends AbstractCompareTest {
assertTrue(comparison.eIsSet(feature));
}
+ /**
+ * Tests the behavior of reference <code>equivalences</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testEquivalences() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE
+ .getComparison_Equivalences();
+ Comparison comparison = CompareFactory.eINSTANCE.createComparison();
+ comparison.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.Equivalence equivalencesValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ .createEquivalence();
+ List<org.eclipse.emf.compare.Equivalence> listEquivalences = new ArrayList<org.eclipse.emf.compare.Equivalence>(
+ 1);
+ listEquivalences.add(equivalencesValue);
+
+ assertFalse(comparison.eIsSet(feature));
+ assertTrue(comparison.getEquivalences().isEmpty());
+
+ comparison.getEquivalences().add(equivalencesValue);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(comparison.getEquivalences().contains(equivalencesValue));
+ assertSame(comparison.getEquivalences(), comparison.eGet(feature));
+ assertSame(comparison.getEquivalences(), comparison.eGet(feature, false));
+ assertTrue(comparison.eIsSet(feature));
+
+ comparison.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(comparison.getEquivalences().isEmpty());
+ assertSame(comparison.getEquivalences(), comparison.eGet(feature));
+ assertSame(comparison.getEquivalences(), comparison.eGet(feature, false));
+ assertFalse(comparison.eIsSet(feature));
+
+ comparison.eSet(feature, listEquivalences);
+ assertTrue(notified);
+ notified = false;
+ assertTrue(comparison.getEquivalences().contains(equivalencesValue));
+ assertSame(comparison.getEquivalences(), comparison.eGet(feature));
+ assertSame(comparison.getEquivalences(), comparison.eGet(feature, false));
+ assertTrue(comparison.eIsSet(feature));
+ }
+
+ /**
+ * Tests the behavior of attribute <code>threeWay</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testThreeWay() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE
+ .getComparison_ThreeWay();
+ Comparison comparison = CompareFactory.eINSTANCE.createComparison();
+ comparison.eAdapters().add(new MockEAdapter());
+ boolean threeWayValue = getBooleanDistinctFromDefault(feature);
+
+ assertFalse(comparison.eIsSet(feature));
+ assertEquals(((Boolean)feature.getDefaultValue()).booleanValue(), ((Boolean)comparison.isThreeWay())
+ .booleanValue());
+
+ comparison.setThreeWay(threeWayValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(threeWayValue, ((Boolean)comparison.isThreeWay()).booleanValue());
+ assertEquals(((Boolean)comparison.isThreeWay()).booleanValue(), ((Boolean)comparison.eGet(feature))
+ .booleanValue());
+ assertTrue(comparison.eIsSet(feature));
+
+ comparison.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(((Boolean)feature.getDefaultValue()).booleanValue(), ((Boolean)comparison.isThreeWay())
+ .booleanValue());
+ assertEquals(((Boolean)comparison.isThreeWay()).booleanValue(), ((Boolean)comparison.eGet(feature))
+ .booleanValue());
+ assertFalse(comparison.eIsSet(feature));
+
+ comparison.eSet(feature, threeWayValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(threeWayValue, ((Boolean)comparison.isThreeWay()).booleanValue());
+ assertEquals(((Boolean)comparison.isThreeWay()).booleanValue(), ((Boolean)comparison.eGet(feature))
+ .booleanValue());
+ assertTrue(comparison.eIsSet(feature));
+
+ comparison.setThreeWay(((Boolean)feature.getDefaultValue()).booleanValue());
+ assertTrue(notified);
+ notified = false;
+ assertEquals(((Boolean)feature.getDefaultValue()).booleanValue(), ((Boolean)comparison.isThreeWay())
+ .booleanValue());
+ assertEquals(((Boolean)comparison.isThreeWay()).booleanValue(), ((Boolean)comparison.eGet(feature))
+ .booleanValue());
+ assertFalse(comparison.eIsSet(feature));
+ }
+
}
diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/ConflictKindTest.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/ConflictKindTest.java
new file mode 100644
index 000000000..be5b9f633
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/ConflictKindTest.java
@@ -0,0 +1,62 @@
+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 org.junit.Test;
+
+import org.eclipse.emf.compare.ConflictKind;
+
+/**
+ * Tests the behavior of the {@link ConflictKind} enumeration.
+ *
+ * @generated
+ */
+@SuppressWarnings("nls")
+public class ConflictKindTest {
+ /**
+ * Tests the behavior of the {@link ConflictKind#get(int)} method.
+ *
+ * @generated
+ */
+ @Test
+ public void testGetInt() {
+ int highestValue = -1;
+ for (ConflictKind value : ConflictKind.VALUES) {
+ assertSame(ConflictKind.get(value.getValue()), value);
+ if (value.getValue() > highestValue) {
+ highestValue = value.getValue();
+ }
+ }
+ assertNull(ConflictKind.get(++highestValue));
+ }
+
+ /**
+ * Tests the behavior of the {@link ConflictKind#get(java.lang.String)} method.
+ *
+ * @generated
+ */
+ @Test
+ public void testGetString() {
+ for (ConflictKind value : ConflictKind.VALUES) {
+ assertSame(ConflictKind.get(value.getLiteral()), value);
+ }
+ assertNull(ConflictKind.get("ThisIsNotAValueOfTheTestedEnum"));
+ }
+
+ /**
+ * Tests the behavior of the {@link ConflictKind#getByName(java.lang.String)} method.
+ *
+ * @generated
+ */
+ @Test
+ public void testGetByName() {
+ for (ConflictKind value : ConflictKind.VALUES) {
+ assertSame(ConflictKind.getByName(value.getName()), value);
+ }
+ assertNull(ConflictKind.getByName("ThisIsNotTheNameOfAValueFromTheTestedEnum"));
+ }
+}
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
index 748903574..3c9905c3f 100644
--- 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
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.emf.compare.tests.unit;
+import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertSame;
import static junit.framework.Assert.assertTrue;
@@ -75,4 +76,55 @@ public class ConflictTest extends AbstractCompareTest {
assertTrue(differencesValue.getConflict() == conflict);
}
+ /**
+ * Tests the behavior of attribute <code>kind</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testKind() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getConflict_Kind();
+ Conflict conflict = CompareFactory.eINSTANCE.createConflict();
+ conflict.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.ConflictKind kindValue = (org.eclipse.emf.compare.ConflictKind)feature
+ .getDefaultValue();
+ for (org.eclipse.emf.compare.ConflictKind aConflictKind : org.eclipse.emf.compare.ConflictKind.VALUES) {
+ if (kindValue.getValue() != aConflictKind.getValue()) {
+ kindValue = aConflictKind;
+ break;
+ }
+ }
+
+ assertFalse(conflict.eIsSet(feature));
+ assertEquals(feature.getDefaultValue(), conflict.getKind());
+
+ conflict.setKind(kindValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(kindValue, conflict.getKind());
+ assertEquals(conflict.getKind(), conflict.eGet(feature));
+ assertTrue(conflict.eIsSet(feature));
+
+ conflict.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), conflict.getKind());
+ assertEquals(conflict.getKind(), conflict.eGet(feature));
+ assertFalse(conflict.eIsSet(feature));
+
+ conflict.eSet(feature, kindValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(kindValue, conflict.getKind());
+ assertEquals(conflict.getKind(), conflict.eGet(feature));
+ assertTrue(conflict.eIsSet(feature));
+
+ conflict.setKind(null);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), conflict.getKind());
+ assertEquals(conflict.getKind(), conflict.eGet(feature));
+ assertFalse(conflict.eIsSet(feature));
+ }
+
}
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
index 49d36724f..94134a4d3 100644
--- 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
@@ -278,7 +278,7 @@ public class DiffTest extends AbstractCompareTest {
}
/**
- * Tests the behavior of reference <code>equivalentDiffs</code>'s accessors.
+ * Tests the behavior of reference <code>equivalence</code>'s accessors.
*
* @generated
*/
@@ -287,20 +287,20 @@ public class DiffTest extends AbstractCompareTest {
EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_Equivalence();
Diff diff = CompareFactory.eINSTANCE.createDiff();
diff.eAdapters().add(new MockEAdapter());
- org.eclipse.emf.compare.Equivalence equivalentDiffsValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ org.eclipse.emf.compare.Equivalence equivalenceValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
.createEquivalence();
assertFalse(diff.eIsSet(feature));
assertNull(diff.getEquivalence());
- diff.setEquivalence(equivalentDiffsValue);
+ diff.setEquivalence(equivalenceValue);
assertTrue(notified);
notified = false;
- assertSame(equivalentDiffsValue, diff.getEquivalence());
+ assertSame(equivalenceValue, diff.getEquivalence());
assertSame(diff.getEquivalence(), diff.eGet(feature));
assertSame(diff.getEquivalence(), diff.eGet(feature, false));
assertTrue(diff.eIsSet(feature));
- assertTrue(equivalentDiffsValue.getDifferences().contains(diff));
+ assertTrue(equivalenceValue.getDifferences().contains(diff));
diff.eUnset(feature);
assertTrue(notified);
@@ -309,25 +309,25 @@ public class DiffTest extends AbstractCompareTest {
assertSame(diff.getEquivalence(), diff.eGet(feature));
assertSame(diff.getEquivalence(), diff.eGet(feature, false));
assertFalse(diff.eIsSet(feature));
- assertFalse(equivalentDiffsValue.getDifferences().contains(diff));
+ assertFalse(equivalenceValue.getDifferences().contains(diff));
- diff.setEquivalence(equivalentDiffsValue);
+ diff.setEquivalence(equivalenceValue);
assertTrue(notified);
notified = false;
- assertSame(equivalentDiffsValue, diff.getEquivalence());
+ assertSame(equivalenceValue, diff.getEquivalence());
assertSame(diff.getEquivalence(), diff.eGet(feature));
assertSame(diff.getEquivalence(), diff.eGet(feature, false));
assertTrue(diff.eIsSet(feature));
- assertTrue(equivalentDiffsValue.getDifferences().contains(diff));
+ assertTrue(equivalenceValue.getDifferences().contains(diff));
- diff.eSet(feature, equivalentDiffsValue);
+ diff.eSet(feature, equivalenceValue);
assertTrue(notified);
notified = false;
- assertSame(equivalentDiffsValue, diff.getEquivalence());
+ assertSame(equivalenceValue, diff.getEquivalence());
assertSame(diff.getEquivalence(), diff.eGet(feature));
assertSame(diff.getEquivalence(), diff.eGet(feature, false));
assertTrue(diff.eIsSet(feature));
- assertTrue(equivalentDiffsValue.getDifferences().contains(diff));
+ assertTrue(equivalenceValue.getDifferences().contains(diff));
diff.setEquivalence(null);
assertTrue(notified);
@@ -337,7 +337,7 @@ public class DiffTest extends AbstractCompareTest {
assertSame(diff.getEquivalence(), diff.eGet(feature));
assertSame(diff.getEquivalence(), diff.eGet(feature, false));
assertFalse(diff.eIsSet(feature));
- assertFalse(equivalentDiffsValue.getDifferences().contains(diff));
+ assertFalse(equivalenceValue.getDifferences().contains(diff));
}
/**
@@ -454,4 +454,106 @@ public class DiffTest extends AbstractCompareTest {
assertFalse(diff.eIsSet(feature));
}
+ /**
+ * Tests the behavior of attribute <code>source</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testSource() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_Source();
+ Diff diff = CompareFactory.eINSTANCE.createDiff();
+ diff.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.DifferenceSource sourceValue = (org.eclipse.emf.compare.DifferenceSource)feature
+ .getDefaultValue();
+ for (org.eclipse.emf.compare.DifferenceSource aDifferenceSource : org.eclipse.emf.compare.DifferenceSource.VALUES) {
+ if (sourceValue.getValue() != aDifferenceSource.getValue()) {
+ sourceValue = aDifferenceSource;
+ break;
+ }
+ }
+
+ assertFalse(diff.eIsSet(feature));
+ assertEquals(feature.getDefaultValue(), diff.getSource());
+
+ diff.setSource(sourceValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(sourceValue, diff.getSource());
+ assertEquals(diff.getSource(), diff.eGet(feature));
+ assertTrue(diff.eIsSet(feature));
+
+ diff.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), diff.getSource());
+ assertEquals(diff.getSource(), diff.eGet(feature));
+ assertFalse(diff.eIsSet(feature));
+
+ diff.eSet(feature, sourceValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(sourceValue, diff.getSource());
+ assertEquals(diff.getSource(), diff.eGet(feature));
+ assertTrue(diff.eIsSet(feature));
+
+ diff.setSource(null);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), diff.getSource());
+ assertEquals(diff.getSource(), diff.eGet(feature));
+ assertFalse(diff.eIsSet(feature));
+ }
+
+ /**
+ * Tests the behavior of attribute <code>state</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testState() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_State();
+ Diff diff = CompareFactory.eINSTANCE.createDiff();
+ diff.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.DifferenceState stateValue = (org.eclipse.emf.compare.DifferenceState)feature
+ .getDefaultValue();
+ for (org.eclipse.emf.compare.DifferenceState aDifferenceState : org.eclipse.emf.compare.DifferenceState.VALUES) {
+ if (stateValue.getValue() != aDifferenceState.getValue()) {
+ stateValue = aDifferenceState;
+ break;
+ }
+ }
+
+ assertFalse(diff.eIsSet(feature));
+ assertEquals(feature.getDefaultValue(), diff.getState());
+
+ diff.setState(stateValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(stateValue, diff.getState());
+ assertEquals(diff.getState(), diff.eGet(feature));
+ assertTrue(diff.eIsSet(feature));
+
+ diff.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), diff.getState());
+ assertEquals(diff.getState(), diff.eGet(feature));
+ assertFalse(diff.eIsSet(feature));
+
+ diff.eSet(feature, stateValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(stateValue, diff.getState());
+ assertEquals(diff.getState(), diff.eGet(feature));
+ assertTrue(diff.eIsSet(feature));
+
+ diff.setState(null);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), diff.getState());
+ assertEquals(diff.getState(), diff.eGet(feature));
+ assertFalse(diff.eIsSet(feature));
+ }
+
}
diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/DifferenceStateTest.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/DifferenceStateTest.java
new file mode 100644
index 000000000..1a304d6ac
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/unit/DifferenceStateTest.java
@@ -0,0 +1,62 @@
+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 org.junit.Test;
+
+import org.eclipse.emf.compare.DifferenceState;
+
+/**
+ * Tests the behavior of the {@link DifferenceState} enumeration.
+ *
+ * @generated
+ */
+@SuppressWarnings("nls")
+public class DifferenceStateTest {
+ /**
+ * Tests the behavior of the {@link DifferenceState#get(int)} method.
+ *
+ * @generated
+ */
+ @Test
+ public void testGetInt() {
+ int highestValue = -1;
+ for (DifferenceState value : DifferenceState.VALUES) {
+ assertSame(DifferenceState.get(value.getValue()), value);
+ if (value.getValue() > highestValue) {
+ highestValue = value.getValue();
+ }
+ }
+ assertNull(DifferenceState.get(++highestValue));
+ }
+
+ /**
+ * Tests the behavior of the {@link DifferenceState#get(java.lang.String)} method.
+ *
+ * @generated
+ */
+ @Test
+ public void testGetString() {
+ for (DifferenceState value : DifferenceState.VALUES) {
+ assertSame(DifferenceState.get(value.getLiteral()), value);
+ }
+ assertNull(DifferenceState.get("ThisIsNotAValueOfTheTestedEnum"));
+ }
+
+ /**
+ * Tests the behavior of the {@link DifferenceState#getByName(java.lang.String)} method.
+ *
+ * @generated
+ */
+ @Test
+ public void testGetByName() {
+ for (DifferenceState value : DifferenceState.VALUES) {
+ assertSame(DifferenceState.getByName(value.getName()), value);
+ }
+ assertNull(DifferenceState.getByName("ThisIsNotTheNameOfAValueFromTheTestedEnum"));
+ }
+}
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
index 39a0600c4..b8c6dc8e8 100644
--- 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
@@ -161,4 +161,138 @@ public class MatchResourceTest extends AbstractCompareTest {
assertFalse(matchResource.eIsSet(feature));
}
+ /**
+ * Tests the behavior of attribute <code>left</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testLeft() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getMatchResource_Left();
+ MatchResource matchResource = CompareFactory.eINSTANCE.createMatchResource();
+ matchResource.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.ecore.resource.Resource leftValue = (org.eclipse.emf.ecore.resource.Resource)getValueDistinctFromDefault(feature);
+
+ assertFalse(matchResource.eIsSet(feature));
+ assertEquals(feature.getDefaultValue(), matchResource.getLeft());
+
+ matchResource.setLeft(leftValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(leftValue, matchResource.getLeft());
+ assertEquals(matchResource.getLeft(), matchResource.eGet(feature));
+ assertTrue(matchResource.eIsSet(feature));
+
+ matchResource.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), matchResource.getLeft());
+ assertEquals(matchResource.getLeft(), matchResource.eGet(feature));
+ assertFalse(matchResource.eIsSet(feature));
+
+ matchResource.eSet(feature, leftValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(leftValue, matchResource.getLeft());
+ assertEquals(matchResource.getLeft(), matchResource.eGet(feature));
+ assertTrue(matchResource.eIsSet(feature));
+
+ matchResource.setLeft(null);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), matchResource.getLeft());
+ assertEquals(matchResource.getLeft(), matchResource.eGet(feature));
+ assertFalse(matchResource.eIsSet(feature));
+ }
+
+ /**
+ * Tests the behavior of attribute <code>right</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testRight() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE
+ .getMatchResource_Right();
+ MatchResource matchResource = CompareFactory.eINSTANCE.createMatchResource();
+ matchResource.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.ecore.resource.Resource rightValue = (org.eclipse.emf.ecore.resource.Resource)getValueDistinctFromDefault(feature);
+
+ assertFalse(matchResource.eIsSet(feature));
+ assertEquals(feature.getDefaultValue(), matchResource.getRight());
+
+ matchResource.setRight(rightValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(rightValue, matchResource.getRight());
+ assertEquals(matchResource.getRight(), matchResource.eGet(feature));
+ assertTrue(matchResource.eIsSet(feature));
+
+ matchResource.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), matchResource.getRight());
+ assertEquals(matchResource.getRight(), matchResource.eGet(feature));
+ assertFalse(matchResource.eIsSet(feature));
+
+ matchResource.eSet(feature, rightValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(rightValue, matchResource.getRight());
+ assertEquals(matchResource.getRight(), matchResource.eGet(feature));
+ assertTrue(matchResource.eIsSet(feature));
+
+ matchResource.setRight(null);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), matchResource.getRight());
+ assertEquals(matchResource.getRight(), matchResource.eGet(feature));
+ assertFalse(matchResource.eIsSet(feature));
+ }
+
+ /**
+ * Tests the behavior of attribute <code>origin</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testOrigin() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE
+ .getMatchResource_Origin();
+ MatchResource matchResource = CompareFactory.eINSTANCE.createMatchResource();
+ matchResource.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.ecore.resource.Resource originValue = (org.eclipse.emf.ecore.resource.Resource)getValueDistinctFromDefault(feature);
+
+ assertFalse(matchResource.eIsSet(feature));
+ assertEquals(feature.getDefaultValue(), matchResource.getOrigin());
+
+ matchResource.setOrigin(originValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(originValue, matchResource.getOrigin());
+ assertEquals(matchResource.getOrigin(), matchResource.eGet(feature));
+ assertTrue(matchResource.eIsSet(feature));
+
+ matchResource.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), matchResource.getOrigin());
+ assertEquals(matchResource.getOrigin(), matchResource.eGet(feature));
+ assertFalse(matchResource.eIsSet(feature));
+
+ matchResource.eSet(feature, originValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(originValue, matchResource.getOrigin());
+ assertEquals(matchResource.getOrigin(), matchResource.eGet(feature));
+ assertTrue(matchResource.eIsSet(feature));
+
+ matchResource.setOrigin(null);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), matchResource.getOrigin());
+ assertEquals(matchResource.getOrigin(), 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
index e229c1f34..c74a1668d 100644
--- 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
@@ -30,27 +30,27 @@ import org.junit.Test;
*/
public class MatchTest extends AbstractCompareTest {
/**
- * Tests the behavior of reference <code>subMatches</code>'s accessors.
+ * Tests the behavior of reference <code>submatches</code>'s accessors.
*
* @generated
*/
@Test
- public void testSubMatches() {
+ 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
+ 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);
+ 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);
+ match.getSubmatches().add(submatchesValue);
assertTrue(notified);
notified = false;
- assertTrue(match.getSubmatches().contains(subMatchesValue));
+ assertTrue(match.getSubmatches().contains(submatchesValue));
assertSame(match.getSubmatches(), match.eGet(feature));
assertSame(match.getSubmatches(), match.eGet(feature, false));
assertTrue(match.eIsSet(feature));
@@ -63,10 +63,10 @@ public class MatchTest extends AbstractCompareTest {
assertSame(match.getSubmatches(), match.eGet(feature, false));
assertFalse(match.eIsSet(feature));
- match.eSet(feature, listSubMatches);
+ match.eSet(feature, listSubmatches);
assertTrue(notified);
notified = false;
- assertTrue(match.getSubmatches().contains(subMatchesValue));
+ assertTrue(match.getSubmatches().contains(submatchesValue));
assertSame(match.getSubmatches(), match.eGet(feature));
assertSame(match.getSubmatches(), match.eGet(feature, false));
assertTrue(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
index b13fd8239..4c562bc95 100644
--- 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
@@ -278,7 +278,7 @@ public class ReferenceChangeTest extends AbstractCompareTest {
}
/**
- * Tests the behavior of reference <code>equivalentDiffs</code>'s accessors.
+ * Tests the behavior of reference <code>equivalence</code>'s accessors.
*
* @generated
*/
@@ -287,20 +287,20 @@ public class ReferenceChangeTest extends AbstractCompareTest {
EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_Equivalence();
ReferenceChange referenceChange = CompareFactory.eINSTANCE.createReferenceChange();
referenceChange.eAdapters().add(new MockEAdapter());
- org.eclipse.emf.compare.Equivalence equivalentDiffsValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ org.eclipse.emf.compare.Equivalence equivalenceValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
.createEquivalence();
assertFalse(referenceChange.eIsSet(feature));
assertNull(referenceChange.getEquivalence());
- referenceChange.setEquivalence(equivalentDiffsValue);
+ referenceChange.setEquivalence(equivalenceValue);
assertTrue(notified);
notified = false;
- assertSame(equivalentDiffsValue, referenceChange.getEquivalence());
+ assertSame(equivalenceValue, referenceChange.getEquivalence());
assertSame(referenceChange.getEquivalence(), referenceChange.eGet(feature));
assertSame(referenceChange.getEquivalence(), referenceChange.eGet(feature, false));
assertTrue(referenceChange.eIsSet(feature));
- assertTrue(equivalentDiffsValue.getDifferences().contains(referenceChange));
+ assertTrue(equivalenceValue.getDifferences().contains(referenceChange));
referenceChange.eUnset(feature);
assertTrue(notified);
@@ -309,25 +309,25 @@ public class ReferenceChangeTest extends AbstractCompareTest {
assertSame(referenceChange.getEquivalence(), referenceChange.eGet(feature));
assertSame(referenceChange.getEquivalence(), referenceChange.eGet(feature, false));
assertFalse(referenceChange.eIsSet(feature));
- assertFalse(equivalentDiffsValue.getDifferences().contains(referenceChange));
+ assertFalse(equivalenceValue.getDifferences().contains(referenceChange));
- referenceChange.setEquivalence(equivalentDiffsValue);
+ referenceChange.setEquivalence(equivalenceValue);
assertTrue(notified);
notified = false;
- assertSame(equivalentDiffsValue, referenceChange.getEquivalence());
+ assertSame(equivalenceValue, referenceChange.getEquivalence());
assertSame(referenceChange.getEquivalence(), referenceChange.eGet(feature));
assertSame(referenceChange.getEquivalence(), referenceChange.eGet(feature, false));
assertTrue(referenceChange.eIsSet(feature));
- assertTrue(equivalentDiffsValue.getDifferences().contains(referenceChange));
+ assertTrue(equivalenceValue.getDifferences().contains(referenceChange));
- referenceChange.eSet(feature, equivalentDiffsValue);
+ referenceChange.eSet(feature, equivalenceValue);
assertTrue(notified);
notified = false;
- assertSame(equivalentDiffsValue, referenceChange.getEquivalence());
+ assertSame(equivalenceValue, referenceChange.getEquivalence());
assertSame(referenceChange.getEquivalence(), referenceChange.eGet(feature));
assertSame(referenceChange.getEquivalence(), referenceChange.eGet(feature, false));
assertTrue(referenceChange.eIsSet(feature));
- assertTrue(equivalentDiffsValue.getDifferences().contains(referenceChange));
+ assertTrue(equivalenceValue.getDifferences().contains(referenceChange));
referenceChange.setEquivalence(null);
assertTrue(notified);
@@ -337,7 +337,7 @@ public class ReferenceChangeTest extends AbstractCompareTest {
assertSame(referenceChange.getEquivalence(), referenceChange.eGet(feature));
assertSame(referenceChange.getEquivalence(), referenceChange.eGet(feature, false));
assertFalse(referenceChange.eIsSet(feature));
- assertFalse(equivalentDiffsValue.getDifferences().contains(referenceChange));
+ assertFalse(equivalenceValue.getDifferences().contains(referenceChange));
}
/**
@@ -572,4 +572,106 @@ public class ReferenceChangeTest extends AbstractCompareTest {
assertFalse(referenceChange.eIsSet(feature));
}
+ /**
+ * Tests the behavior of attribute <code>source</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testSource() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_Source();
+ ReferenceChange referenceChange = CompareFactory.eINSTANCE.createReferenceChange();
+ referenceChange.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.DifferenceSource sourceValue = (org.eclipse.emf.compare.DifferenceSource)feature
+ .getDefaultValue();
+ for (org.eclipse.emf.compare.DifferenceSource aDifferenceSource : org.eclipse.emf.compare.DifferenceSource.VALUES) {
+ if (sourceValue.getValue() != aDifferenceSource.getValue()) {
+ sourceValue = aDifferenceSource;
+ break;
+ }
+ }
+
+ assertFalse(referenceChange.eIsSet(feature));
+ assertEquals(feature.getDefaultValue(), referenceChange.getSource());
+
+ referenceChange.setSource(sourceValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(sourceValue, referenceChange.getSource());
+ assertEquals(referenceChange.getSource(), referenceChange.eGet(feature));
+ assertTrue(referenceChange.eIsSet(feature));
+
+ referenceChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), referenceChange.getSource());
+ assertEquals(referenceChange.getSource(), referenceChange.eGet(feature));
+ assertFalse(referenceChange.eIsSet(feature));
+
+ referenceChange.eSet(feature, sourceValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(sourceValue, referenceChange.getSource());
+ assertEquals(referenceChange.getSource(), referenceChange.eGet(feature));
+ assertTrue(referenceChange.eIsSet(feature));
+
+ referenceChange.setSource(null);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), referenceChange.getSource());
+ assertEquals(referenceChange.getSource(), referenceChange.eGet(feature));
+ assertFalse(referenceChange.eIsSet(feature));
+ }
+
+ /**
+ * Tests the behavior of attribute <code>state</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testState() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_State();
+ ReferenceChange referenceChange = CompareFactory.eINSTANCE.createReferenceChange();
+ referenceChange.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.DifferenceState stateValue = (org.eclipse.emf.compare.DifferenceState)feature
+ .getDefaultValue();
+ for (org.eclipse.emf.compare.DifferenceState aDifferenceState : org.eclipse.emf.compare.DifferenceState.VALUES) {
+ if (stateValue.getValue() != aDifferenceState.getValue()) {
+ stateValue = aDifferenceState;
+ break;
+ }
+ }
+
+ assertFalse(referenceChange.eIsSet(feature));
+ assertEquals(feature.getDefaultValue(), referenceChange.getState());
+
+ referenceChange.setState(stateValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(stateValue, referenceChange.getState());
+ assertEquals(referenceChange.getState(), referenceChange.eGet(feature));
+ assertTrue(referenceChange.eIsSet(feature));
+
+ referenceChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), referenceChange.getState());
+ assertEquals(referenceChange.getState(), referenceChange.eGet(feature));
+ assertFalse(referenceChange.eIsSet(feature));
+
+ referenceChange.eSet(feature, stateValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(stateValue, referenceChange.getState());
+ assertEquals(referenceChange.getState(), referenceChange.eGet(feature));
+ assertTrue(referenceChange.eIsSet(feature));
+
+ referenceChange.setState(null);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), referenceChange.getState());
+ assertEquals(referenceChange.getState(), 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
index f36afb6e2..ea9acfb65 100644
--- 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
@@ -283,7 +283,7 @@ public class ResourceAttachmentChangeTest extends AbstractCompareTest {
}
/**
- * Tests the behavior of reference <code>equivalentDiffs</code>'s accessors.
+ * Tests the behavior of reference <code>equivalence</code>'s accessors.
*
* @generated
*/
@@ -293,20 +293,20 @@ public class ResourceAttachmentChangeTest extends AbstractCompareTest {
ResourceAttachmentChange resourceAttachmentChange = CompareFactory.eINSTANCE
.createResourceAttachmentChange();
resourceAttachmentChange.eAdapters().add(new MockEAdapter());
- org.eclipse.emf.compare.Equivalence equivalentDiffsValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
+ org.eclipse.emf.compare.Equivalence equivalenceValue = org.eclipse.emf.compare.CompareFactory.eINSTANCE
.createEquivalence();
assertFalse(resourceAttachmentChange.eIsSet(feature));
assertNull(resourceAttachmentChange.getEquivalence());
- resourceAttachmentChange.setEquivalence(equivalentDiffsValue);
+ resourceAttachmentChange.setEquivalence(equivalenceValue);
assertTrue(notified);
notified = false;
- assertSame(equivalentDiffsValue, resourceAttachmentChange.getEquivalence());
+ assertSame(equivalenceValue, resourceAttachmentChange.getEquivalence());
assertSame(resourceAttachmentChange.getEquivalence(), resourceAttachmentChange.eGet(feature));
assertSame(resourceAttachmentChange.getEquivalence(), resourceAttachmentChange.eGet(feature, false));
assertTrue(resourceAttachmentChange.eIsSet(feature));
- assertTrue(equivalentDiffsValue.getDifferences().contains(resourceAttachmentChange));
+ assertTrue(equivalenceValue.getDifferences().contains(resourceAttachmentChange));
resourceAttachmentChange.eUnset(feature);
assertTrue(notified);
@@ -315,25 +315,25 @@ public class ResourceAttachmentChangeTest extends AbstractCompareTest {
assertSame(resourceAttachmentChange.getEquivalence(), resourceAttachmentChange.eGet(feature));
assertSame(resourceAttachmentChange.getEquivalence(), resourceAttachmentChange.eGet(feature, false));
assertFalse(resourceAttachmentChange.eIsSet(feature));
- assertFalse(equivalentDiffsValue.getDifferences().contains(resourceAttachmentChange));
+ assertFalse(equivalenceValue.getDifferences().contains(resourceAttachmentChange));
- resourceAttachmentChange.setEquivalence(equivalentDiffsValue);
+ resourceAttachmentChange.setEquivalence(equivalenceValue);
assertTrue(notified);
notified = false;
- assertSame(equivalentDiffsValue, resourceAttachmentChange.getEquivalence());
+ assertSame(equivalenceValue, resourceAttachmentChange.getEquivalence());
assertSame(resourceAttachmentChange.getEquivalence(), resourceAttachmentChange.eGet(feature));
assertSame(resourceAttachmentChange.getEquivalence(), resourceAttachmentChange.eGet(feature, false));
assertTrue(resourceAttachmentChange.eIsSet(feature));
- assertTrue(equivalentDiffsValue.getDifferences().contains(resourceAttachmentChange));
+ assertTrue(equivalenceValue.getDifferences().contains(resourceAttachmentChange));
- resourceAttachmentChange.eSet(feature, equivalentDiffsValue);
+ resourceAttachmentChange.eSet(feature, equivalenceValue);
assertTrue(notified);
notified = false;
- assertSame(equivalentDiffsValue, resourceAttachmentChange.getEquivalence());
+ assertSame(equivalenceValue, resourceAttachmentChange.getEquivalence());
assertSame(resourceAttachmentChange.getEquivalence(), resourceAttachmentChange.eGet(feature));
assertSame(resourceAttachmentChange.getEquivalence(), resourceAttachmentChange.eGet(feature, false));
assertTrue(resourceAttachmentChange.eIsSet(feature));
- assertTrue(equivalentDiffsValue.getDifferences().contains(resourceAttachmentChange));
+ assertTrue(equivalenceValue.getDifferences().contains(resourceAttachmentChange));
resourceAttachmentChange.setEquivalence(null);
assertTrue(notified);
@@ -343,7 +343,7 @@ public class ResourceAttachmentChangeTest extends AbstractCompareTest {
assertSame(resourceAttachmentChange.getEquivalence(), resourceAttachmentChange.eGet(feature));
assertSame(resourceAttachmentChange.getEquivalence(), resourceAttachmentChange.eGet(feature, false));
assertFalse(resourceAttachmentChange.eIsSet(feature));
- assertFalse(equivalentDiffsValue.getDifferences().contains(resourceAttachmentChange));
+ assertFalse(equivalenceValue.getDifferences().contains(resourceAttachmentChange));
}
/**
@@ -463,6 +463,110 @@ public class ResourceAttachmentChangeTest extends AbstractCompareTest {
}
/**
+ * Tests the behavior of attribute <code>source</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testSource() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_Source();
+ ResourceAttachmentChange resourceAttachmentChange = CompareFactory.eINSTANCE
+ .createResourceAttachmentChange();
+ resourceAttachmentChange.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.DifferenceSource sourceValue = (org.eclipse.emf.compare.DifferenceSource)feature
+ .getDefaultValue();
+ for (org.eclipse.emf.compare.DifferenceSource aDifferenceSource : org.eclipse.emf.compare.DifferenceSource.VALUES) {
+ if (sourceValue.getValue() != aDifferenceSource.getValue()) {
+ sourceValue = aDifferenceSource;
+ break;
+ }
+ }
+
+ assertFalse(resourceAttachmentChange.eIsSet(feature));
+ assertEquals(feature.getDefaultValue(), resourceAttachmentChange.getSource());
+
+ resourceAttachmentChange.setSource(sourceValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(sourceValue, resourceAttachmentChange.getSource());
+ assertEquals(resourceAttachmentChange.getSource(), resourceAttachmentChange.eGet(feature));
+ assertTrue(resourceAttachmentChange.eIsSet(feature));
+
+ resourceAttachmentChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), resourceAttachmentChange.getSource());
+ assertEquals(resourceAttachmentChange.getSource(), resourceAttachmentChange.eGet(feature));
+ assertFalse(resourceAttachmentChange.eIsSet(feature));
+
+ resourceAttachmentChange.eSet(feature, sourceValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(sourceValue, resourceAttachmentChange.getSource());
+ assertEquals(resourceAttachmentChange.getSource(), resourceAttachmentChange.eGet(feature));
+ assertTrue(resourceAttachmentChange.eIsSet(feature));
+
+ resourceAttachmentChange.setSource(null);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), resourceAttachmentChange.getSource());
+ assertEquals(resourceAttachmentChange.getSource(), resourceAttachmentChange.eGet(feature));
+ assertFalse(resourceAttachmentChange.eIsSet(feature));
+ }
+
+ /**
+ * Tests the behavior of attribute <code>state</code>'s accessors.
+ *
+ * @generated
+ */
+ @Test
+ public void testState() {
+ EStructuralFeature feature = org.eclipse.emf.compare.ComparePackage.eINSTANCE.getDiff_State();
+ ResourceAttachmentChange resourceAttachmentChange = CompareFactory.eINSTANCE
+ .createResourceAttachmentChange();
+ resourceAttachmentChange.eAdapters().add(new MockEAdapter());
+ org.eclipse.emf.compare.DifferenceState stateValue = (org.eclipse.emf.compare.DifferenceState)feature
+ .getDefaultValue();
+ for (org.eclipse.emf.compare.DifferenceState aDifferenceState : org.eclipse.emf.compare.DifferenceState.VALUES) {
+ if (stateValue.getValue() != aDifferenceState.getValue()) {
+ stateValue = aDifferenceState;
+ break;
+ }
+ }
+
+ assertFalse(resourceAttachmentChange.eIsSet(feature));
+ assertEquals(feature.getDefaultValue(), resourceAttachmentChange.getState());
+
+ resourceAttachmentChange.setState(stateValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(stateValue, resourceAttachmentChange.getState());
+ assertEquals(resourceAttachmentChange.getState(), resourceAttachmentChange.eGet(feature));
+ assertTrue(resourceAttachmentChange.eIsSet(feature));
+
+ resourceAttachmentChange.eUnset(feature);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), resourceAttachmentChange.getState());
+ assertEquals(resourceAttachmentChange.getState(), resourceAttachmentChange.eGet(feature));
+ assertFalse(resourceAttachmentChange.eIsSet(feature));
+
+ resourceAttachmentChange.eSet(feature, stateValue);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(stateValue, resourceAttachmentChange.getState());
+ assertEquals(resourceAttachmentChange.getState(), resourceAttachmentChange.eGet(feature));
+ assertTrue(resourceAttachmentChange.eIsSet(feature));
+
+ resourceAttachmentChange.setState(null);
+ assertTrue(notified);
+ notified = false;
+ assertEquals(feature.getDefaultValue(), resourceAttachmentChange.getState());
+ assertEquals(resourceAttachmentChange.getState(), resourceAttachmentChange.eGet(feature));
+ assertFalse(resourceAttachmentChange.eIsSet(feature));
+ }
+
+ /**
* Tests the behavior of attribute <code>resourceURI</code>'s accessors.
*
* @generated

Back to the top