Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Richard2014-09-22 08:58:51 -0400
committerLaurent Goubet2014-09-25 10:04:58 -0400
commit71e54051833b807bb1350cc1297e99d57fd36023 (patch)
tree92926153f8e2d757d58055962b97adad6c76a041
parent17fd4c12324239ba9d7f0382c69bed5ca55074a7 (diff)
downloadorg.eclipse.emf.compare-71e54051833b807bb1350cc1297e99d57fd36023.tar.gz
org.eclipse.emf.compare-71e54051833b807bb1350cc1297e99d57fd36023.tar.xz
org.eclipse.emf.compare-71e54051833b807bb1350cc1297e99d57fd36023.zip
[443031] Fix NPE on FeatureFilter.referenceIsSet
Fix NPE on FeatureFilter.referenceIsSet Add tests Bug: 443031 Change-Id: Id2ecebcff6c174341199451d472aad4c06101239 Signed-off-by: Axel Richard <axel.richard@obeo.fr>
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui.tests/src/org/eclipse/emf/compare/rcp/ui/tests/mergeviewer/item/MergeViewerItemFeatureMapsTest.java77
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui.tests/src/org/eclipse/emf/compare/rcp/ui/tests/suite/AllTests.java18
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/mergeviewer/item/impl/MergeViewerItem.java12
-rw-r--r--plugins/org.eclipse.emf.compare.tests/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.emf.compare.tests/model/nodes.ecore21
-rw-r--r--plugins/org.eclipse.emf.compare.tests/model/nodes.genmodel5
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/NodeFeatureMapContainment2.java91
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/NodesFactory.java11
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/NodesPackage.java147
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/impl/NodeFeatureMapContainment2Impl.java212
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/impl/NodesFactoryImpl.java31
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/impl/NodesPackageImpl.java215
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/util/NodesAdapterFactory.java37
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/util/NodesSwitch.java41
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/FeatureFilterTest.java86
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/data/featurefilter/featuremap/FeatureFilterFeatureMapsInputData.java32
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/data/featurefilter/featuremap/left.nodes26
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/data/featurefilter/featuremap/right.nodes26
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/suite/AllTests.java4
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/diff/FeatureFilter.java4
20 files changed, 991 insertions, 108 deletions
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui.tests/src/org/eclipse/emf/compare/rcp/ui/tests/mergeviewer/item/MergeViewerItemFeatureMapsTest.java b/plugins/org.eclipse.emf.compare.rcp.ui.tests/src/org/eclipse/emf/compare/rcp/ui/tests/mergeviewer/item/MergeViewerItemFeatureMapsTest.java
new file mode 100644
index 000000000..007aadf57
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.rcp.ui.tests/src/org/eclipse/emf/compare/rcp/ui/tests/mergeviewer/item/MergeViewerItemFeatureMapsTest.java
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.rcp.ui.tests.mergeviewer.item;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+
+import org.eclipse.emf.compare.Comparison;
+import org.eclipse.emf.compare.EMFCompare;
+import org.eclipse.emf.compare.Match;
+import org.eclipse.emf.compare.rcp.ui.internal.mergeviewer.item.impl.MergeViewerItem;
+import org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer.MergeViewerSide;
+import org.eclipse.emf.compare.rcp.ui.mergeviewer.item.IMergeViewerItem;
+import org.eclipse.emf.compare.scope.DefaultComparisonScope;
+import org.eclipse.emf.compare.scope.IComparisonScope;
+import org.eclipse.emf.compare.tests.diff.data.featurefilter.featuremap.FeatureFilterFeatureMapsInputData;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
+import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Tests for {@link MergeViewerItem}.
+ *
+ * @author <a href="mailto:axel.richard@obeo.fr">Axel Richard</a>
+ */
+@SuppressWarnings("restriction")
+public class MergeViewerItemFeatureMapsTest {
+
+ private static FeatureFilterFeatureMapsInputData inputData = new FeatureFilterFeatureMapsInputData();
+ private final static ComposedAdapterFactory fAdapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+ private static Comparison comparison;
+
+ @BeforeClass
+ public static void beforeClass() throws IOException {
+ fAdapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
+ fAdapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
+ final Resource leftResource = inputData.getNodesLeft();
+ final Resource rightResource = inputData.getNodesRight();
+
+ final IComparisonScope scope = new DefaultComparisonScope(leftResource, rightResource, null);
+ comparison = EMFCompare.builder().build().compare(scope);
+ }
+
+ @Test
+ public void test2WayFeatureMapContainment() throws IOException {
+ // Test with models containing NodeFeatureMapContainment2 elements. A NodeFeatureMapContainment2 is an
+ // element that contains a map with two types of entries: NodeMultipleContainment and
+ // NodeSingleValueContainment. NodeMultipleContainment has containment references that don't exist in
+ // NodeSingleValueContainment. The MergeViewer needs to properly handle the case.
+
+ final Match mapNodeMatch = comparison.getMatches().get(0).getSubmatches().get(0);
+
+ //Test Left Side
+ MergeViewerItem.Container mapNode1MVI = new MergeViewerItem.Container(comparison, null, mapNodeMatch, MergeViewerSide.LEFT, fAdapterFactory);
+ IMergeViewerItem[] children = mapNode1MVI.getChildren(null, null);
+ assertTrue(children.length == 5);
+
+ //Test Right Side
+ mapNode1MVI = new MergeViewerItem.Container(comparison, null, mapNodeMatch, MergeViewerSide.RIGHT, fAdapterFactory);
+ children = mapNode1MVI.getChildren(null, null);
+ assertTrue(children.length == 5);
+
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui.tests/src/org/eclipse/emf/compare/rcp/ui/tests/suite/AllTests.java b/plugins/org.eclipse.emf.compare.rcp.ui.tests/src/org/eclipse/emf/compare/rcp/ui/tests/suite/AllTests.java
index 2492622bc..6856ba632 100644
--- a/plugins/org.eclipse.emf.compare.rcp.ui.tests/src/org/eclipse/emf/compare/rcp/ui/tests/suite/AllTests.java
+++ b/plugins/org.eclipse.emf.compare.rcp.ui.tests/src/org/eclipse/emf/compare/rcp/ui/tests/suite/AllTests.java
@@ -14,12 +14,19 @@ import junit.framework.JUnit4TestAdapter;
import junit.framework.Test;
import junit.textui.TestRunner;
+import org.eclipse.emf.compare.ComparePackage;
+import org.eclipse.emf.compare.rcp.ui.tests.mergeviewer.item.MergeViewerItemFeatureMapsTest;
import org.eclipse.emf.compare.rcp.ui.tests.mergeviewer.item.MergeViewerItemPseudoConflictTest;
import org.eclipse.emf.compare.rcp.ui.tests.mergeviewer.item.MergeViewerItemTest;
import org.eclipse.emf.compare.rcp.ui.tests.structuremergeviewer.groups.TestBasicDifferenceGroupImpl;
import org.eclipse.emf.compare.rcp.ui.tests.structuremergeviewer.groups.provider.TestComparisonTreeNodeItemProviderSpec;
import org.eclipse.emf.compare.rcp.ui.tests.structuremergeviewer.groups.provider.TestMatchTreeNodeItemProviderSpec;
import org.eclipse.emf.compare.rcp.ui.tests.structuremergeviewer.groups.provider.TestReferenceChangeTreeNodeItemProviderSpec;
+import org.eclipse.emf.compare.tests.nodes.NodesPackage;
+import org.eclipse.emf.compare.tests.nodes.util.NodesResourceFactoryImpl;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
@@ -28,7 +35,7 @@ import org.junit.runners.Suite.SuiteClasses;
@SuiteClasses({TestComparisonTreeNodeItemProviderSpec.class,
TestMatchTreeNodeItemProviderSpec.class,
TestReferenceChangeTreeNodeItemProviderSpec.class,
- MergeViewerItemTest.class, MergeViewerItemPseudoConflictTest.class,
+ MergeViewerItemTest.class, MergeViewerItemPseudoConflictTest.class, MergeViewerItemFeatureMapsTest.class,
TestBasicDifferenceGroupImpl.class, BugsTestSuite.class})
public class AllTests {
/**
@@ -49,4 +56,13 @@ public class AllTests {
public static Test suite() {
return new JUnit4TestAdapter(AllTests.class);
}
+
+ @BeforeClass
+ public static void fillEMFRegistries() {
+ EPackage.Registry.INSTANCE.put(ComparePackage.eNS_URI, ComparePackage.eINSTANCE);
+ EPackage.Registry.INSTANCE.put(NodesPackage.eNS_URI, NodesPackage.eINSTANCE);
+
+ Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("nodes", //$NON-NLS-1$
+ new NodesResourceFactoryImpl());
+ }
}
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/mergeviewer/item/impl/MergeViewerItem.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/mergeviewer/item/impl/MergeViewerItem.java
index 61027ffd1..3cc4a183b 100644
--- a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/mergeviewer/item/impl/MergeViewerItem.java
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/mergeviewer/item/impl/MergeViewerItem.java
@@ -342,6 +342,9 @@ public class MergeViewerItem extends AdapterImpl implements IMergeViewerItem {
EStructuralFeature eStructuralFeature, final List<? extends IMergeViewerItem> values,
List<? extends Diff> differences) {
final List<IMergeViewerItem> ret = newArrayList(values);
+ if (differences.isEmpty()) {
+ return ret;
+ }
final List<Object> sideContent = ReferenceUtil.getAsList((EObject)getSideValue(getSide()),
eStructuralFeature);
final List<Object> oppositeContent = ReferenceUtil.getAsList((EObject)getSideValue(getSide()
@@ -660,9 +663,8 @@ public class MergeViewerItem extends AdapterImpl implements IMergeViewerItem {
if (getSide() != MergeViewerSide.ANCESTOR) {
List<? extends Diff> differencesOnFeature = ImmutableList.copyOf(filter(differences,
onFeature(reference.getName())));
- ret.addAll(createInsertionPoints(getComparison(), reference, mergeViewerItem, filteredDiffs(
- differencesOnFeature, predicate, group)));
-
+ List<? extends Diff> filteredDiffs = filteredDiffs(differencesOnFeature, predicate, group);
+ ret.addAll(createInsertionPoints(getComparison(), reference, mergeViewerItem, filteredDiffs));
} else {
ret.addAll(mergeViewerItem);
}
@@ -703,8 +705,8 @@ public class MergeViewerItem extends AdapterImpl implements IMergeViewerItem {
differencesOnFeature.addAll(ImmutableList.copyOf(filter(differences,
onFeature(derivedFeature.getName()))));
}
- ret.addAll(createInsertionPoints(getComparison(), featureMap, mergeViewerItem, filteredDiffs(
- differencesOnFeature, predicate, group)));
+ List<? extends Diff> filteredDiffs = filteredDiffs(differencesOnFeature, predicate, group);
+ ret.addAll(createInsertionPoints(getComparison(), featureMap, mergeViewerItem, filteredDiffs));
} else {
ret.addAll(mergeViewerItem);
}
diff --git a/plugins/org.eclipse.emf.compare.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.tests/META-INF/MANIFEST.MF
index a48197ffb..63106500a 100644
--- a/plugins/org.eclipse.emf.compare.tests/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.tests/META-INF/MANIFEST.MF
@@ -25,6 +25,7 @@ Export-Package: org.eclipse.emf.compare.tests,
org.eclipse.emf.compare.tests.conflict,
org.eclipse.emf.compare.tests.conflict.data,
org.eclipse.emf.compare.tests.diff,
+ org.eclipse.emf.compare.tests.diff.data.featurefilter.featuremap,
org.eclipse.emf.compare.tests.edit,
org.eclipse.emf.compare.tests.edit.data,
org.eclipse.emf.compare.tests.edit.data.ecore.a1,
@@ -47,8 +48,6 @@ Export-Package: org.eclipse.emf.compare.tests,
org.eclipse.emf.compare.tests.nodes.util,
org.eclipse.emf.compare.tests.postprocess,
org.eclipse.emf.compare.tests.postprocess.data,
- org.eclipse.emf.compare.tests.postprocess,
- org.eclipse.emf.compare.tests.postprocess.data,
org.eclipse.emf.compare.tests.req,
org.eclipse.emf.compare.tests.req.data,
org.eclipse.emf.compare.tests.scope,
diff --git a/plugins/org.eclipse.emf.compare.tests/model/nodes.ecore b/plugins/org.eclipse.emf.compare.tests/model/nodes.ecore
index 50cc4f36c..0dd749008 100644
--- a/plugins/org.eclipse.emf.compare.tests/model/nodes.ecore
+++ b/plugins/org.eclipse.emf.compare.tests/model/nodes.ecore
@@ -91,4 +91,25 @@
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="NodeFeatureMapContainment2" eSuperTypes="#//Node">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="map2" upperBound="-1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFeatureMapEntry">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="group"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="multiple" upperBound="-1"
+ eType="#//NodeMultipleContainment" volatile="true" transient="true" derived="true"
+ containment="true">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="group" value="#map2"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="single" upperBound="-1"
+ eType="#//NodeSingleValueContainment" volatile="true" transient="true" derived="true"
+ containment="true">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="group" value="#map2"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
</ecore:EPackage>
diff --git a/plugins/org.eclipse.emf.compare.tests/model/nodes.genmodel b/plugins/org.eclipse.emf.compare.tests/model/nodes.genmodel
index de52f0692..fac0cb1e2 100644
--- a/plugins/org.eclipse.emf.compare.tests/model/nodes.genmodel
+++ b/plugins/org.eclipse.emf.compare.tests/model/nodes.genmodel
@@ -53,5 +53,10 @@
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference nodes.ecore#//NodeFeatureMapNonContainment/firstKeyNC"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference nodes.ecore#//NodeFeatureMapNonContainment/secondKeyNC"/>
</genClasses>
+ <genClasses ecoreClass="nodes.ecore#//NodeFeatureMapContainment2">
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute nodes.ecore#//NodeFeatureMapContainment2/map2"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference nodes.ecore#//NodeFeatureMapContainment2/multiple"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference nodes.ecore#//NodeFeatureMapContainment2/single"/>
+ </genClasses>
</genPackages>
</genmodel:GenModel>
diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/NodeFeatureMapContainment2.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/NodeFeatureMapContainment2.java
new file mode 100644
index 000000000..265237587
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/NodeFeatureMapContainment2.java
@@ -0,0 +1,91 @@
+/**
+ * Copyright (c) 2011, 2014 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ */
+package org.eclipse.emf.compare.tests.nodes;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.util.FeatureMap;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '<em><b>Node Feature Map Containment2</b></em>
+ * '. <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.emf.compare.tests.nodes.NodeFeatureMapContainment2#getMap2 <em>Map2</em>}</li>
+ * <li>{@link org.eclipse.emf.compare.tests.nodes.NodeFeatureMapContainment2#getMultiple <em>Multiple</em>}</li>
+ * <li>{@link org.eclipse.emf.compare.tests.nodes.NodeFeatureMapContainment2#getSingle <em>Single</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.emf.compare.tests.nodes.NodesPackage#getNodeFeatureMapContainment2()
+ * @model
+ * @generated
+ */
+public interface NodeFeatureMapContainment2 extends Node {
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ String copyright = "Copyright (c) 2011, 2012 Obeo.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Obeo - initial API and implementation"; //$NON-NLS-1$
+
+ /**
+ * Returns the value of the '<em><b>Map2</b></em>' attribute list.
+ * The list contents are of type {@link org.eclipse.emf.ecore.util.FeatureMap.Entry}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Map2</em>' attribute list isn't clear, there really should be more of a
+ * description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Map2</em>' attribute list.
+ * @see org.eclipse.emf.compare.tests.nodes.NodesPackage#getNodeFeatureMapContainment2_Map2()
+ * @model dataType="org.eclipse.emf.ecore.EFeatureMapEntry" many="true"
+ * extendedMetaData="kind='group'"
+ * @generated
+ */
+ FeatureMap getMap2();
+
+ /**
+ * Returns the value of the '<em><b>Multiple</b></em>' containment reference list.
+ * The list contents are of type {@link org.eclipse.emf.compare.tests.nodes.NodeMultipleContainment}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Multiple</em>' containment reference list isn't clear, there really should
+ * be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Multiple</em>' containment reference list.
+ * @see org.eclipse.emf.compare.tests.nodes.NodesPackage#getNodeFeatureMapContainment2_Multiple()
+ * @model containment="true" resolveProxies="true" transient="true" volatile="true" derived="true"
+ * extendedMetaData="group='#map2'"
+ * @generated
+ */
+ EList<NodeMultipleContainment> getMultiple();
+
+ /**
+ * Returns the value of the '<em><b>Single</b></em>' containment reference list.
+ * The list contents are of type {@link org.eclipse.emf.compare.tests.nodes.NodeSingleValueContainment}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Single</em>' containment reference list isn't clear, there really should be
+ * more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Single</em>' containment reference list.
+ * @see org.eclipse.emf.compare.tests.nodes.NodesPackage#getNodeFeatureMapContainment2_Single()
+ * @model containment="true" resolveProxies="true" transient="true" volatile="true" derived="true"
+ * extendedMetaData="group='#map2'"
+ * @generated
+ */
+ EList<NodeSingleValueContainment> getSingle();
+
+} // NodeFeatureMapContainment2
diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/NodesFactory.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/NodesFactory.java
index 14ad95ff5..6ec22d225 100644
--- a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/NodesFactory.java
+++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/NodesFactory.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2011, 2012 Obeo.
+ * Copyright (c) 2011, 2014 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -145,6 +145,15 @@ public interface NodesFactory extends EFactory {
NodeFeatureMapNonContainment createNodeFeatureMapNonContainment();
/**
+ * Returns a new object of class '<em>Node Feature Map Containment2</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Node Feature Map Containment2</em>'.
+ * @generated
+ */
+ NodeFeatureMapContainment2 createNodeFeatureMapContainment2();
+
+ /**
* Returns the package supported by this factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/NodesPackage.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/NodesPackage.java
index 1ab82e1e8..ab45a7e58 100644
--- a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/NodesPackage.java
+++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/NodesPackage.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2011, 2012 Obeo.
+ * Copyright (c) 2011, 2014 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -30,8 +30,6 @@ import org.eclipse.emf.ecore.EReference;
* @model kind="package"
* @generated
*/
-//Generated code, suppressing all warnings
-@SuppressWarnings("all")
public interface NodesPackage extends EPackage {
/**
* <!-- begin-user-doc -->
@@ -402,7 +400,6 @@ public interface NodesPackage extends EPackage {
*/
int NODE_MULTI_VALUE_REFERENCE_FEATURE_COUNT = NODE_FEATURE_COUNT + 1;
-
/**
* The meta object id for the '{@link org.eclipse.emf.compare.tests.nodes.impl.NodeOppositeRefOneToOneImpl <em>Node Opposite Ref One To One</em>}' class.
* <!-- begin-user-doc -->
@@ -697,6 +694,71 @@ public interface NodesPackage extends EPackage {
int NODE_FEATURE_MAP_NON_CONTAINMENT_FEATURE_COUNT = NODE_FEATURE_COUNT + 3;
/**
+ * The meta object id for the '{@link org.eclipse.emf.compare.tests.nodes.impl.NodeFeatureMapContainment2Impl <em>Node Feature Map Containment2</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.compare.tests.nodes.impl.NodeFeatureMapContainment2Impl
+ * @see org.eclipse.emf.compare.tests.nodes.impl.NodesPackageImpl#getNodeFeatureMapContainment2()
+ * @generated
+ */
+ int NODE_FEATURE_MAP_CONTAINMENT2 = 12;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NODE_FEATURE_MAP_CONTAINMENT2__NAME = NODE__NAME;
+
+ /**
+ * The feature id for the '<em><b>Containment Ref1</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NODE_FEATURE_MAP_CONTAINMENT2__CONTAINMENT_REF1 = NODE__CONTAINMENT_REF1;
+
+ /**
+ * The feature id for the '<em><b>Map2</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NODE_FEATURE_MAP_CONTAINMENT2__MAP2 = NODE_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Multiple</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NODE_FEATURE_MAP_CONTAINMENT2__MULTIPLE = NODE_FEATURE_COUNT + 1;
+
+ /**
+ * The feature id for the '<em><b>Single</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NODE_FEATURE_MAP_CONTAINMENT2__SINGLE = NODE_FEATURE_COUNT + 2;
+
+ /**
+ * The number of structural features of the '<em>Node Feature Map Containment2</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NODE_FEATURE_MAP_CONTAINMENT2_FEATURE_COUNT = NODE_FEATURE_COUNT + 3;
+
+
+ /**
* Returns the meta object for class '{@link org.eclipse.emf.compare.tests.nodes.Node <em>Node</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1048,6 +1110,49 @@ public interface NodesPackage extends EPackage {
EReference getNodeFeatureMapNonContainment_SecondKeyNC();
/**
+ * Returns the meta object for class '{@link org.eclipse.emf.compare.tests.nodes.NodeFeatureMapContainment2 <em>Node Feature Map Containment2</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Node Feature Map Containment2</em>'.
+ * @see org.eclipse.emf.compare.tests.nodes.NodeFeatureMapContainment2
+ * @generated
+ */
+ EClass getNodeFeatureMapContainment2();
+
+ /**
+ * Returns the meta object for the attribute list '{@link org.eclipse.emf.compare.tests.nodes.NodeFeatureMapContainment2#getMap2 <em>Map2</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute list '<em>Map2</em>'.
+ * @see org.eclipse.emf.compare.tests.nodes.NodeFeatureMapContainment2#getMap2()
+ * @see #getNodeFeatureMapContainment2()
+ * @generated
+ */
+ EAttribute getNodeFeatureMapContainment2_Map2();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.emf.compare.tests.nodes.NodeFeatureMapContainment2#getMultiple <em>Multiple</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Multiple</em>'.
+ * @see org.eclipse.emf.compare.tests.nodes.NodeFeatureMapContainment2#getMultiple()
+ * @see #getNodeFeatureMapContainment2()
+ * @generated
+ */
+ EReference getNodeFeatureMapContainment2_Multiple();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.emf.compare.tests.nodes.NodeFeatureMapContainment2#getSingle <em>Single</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Single</em>'.
+ * @see org.eclipse.emf.compare.tests.nodes.NodeFeatureMapContainment2#getSingle()
+ * @see #getNodeFeatureMapContainment2()
+ * @generated
+ */
+ EReference getNodeFeatureMapContainment2_Single();
+
+ /**
* Returns the factory that creates the instances of the model.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1357,6 +1462,40 @@ public interface NodesPackage extends EPackage {
*/
EReference NODE_FEATURE_MAP_NON_CONTAINMENT__SECOND_KEY_NC = eINSTANCE.getNodeFeatureMapNonContainment_SecondKeyNC();
+ /**
+ * The meta object literal for the '{@link org.eclipse.emf.compare.tests.nodes.impl.NodeFeatureMapContainment2Impl <em>Node Feature Map Containment2</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.compare.tests.nodes.impl.NodeFeatureMapContainment2Impl
+ * @see org.eclipse.emf.compare.tests.nodes.impl.NodesPackageImpl#getNodeFeatureMapContainment2()
+ * @generated
+ */
+ EClass NODE_FEATURE_MAP_CONTAINMENT2 = eINSTANCE.getNodeFeatureMapContainment2();
+
+ /**
+ * The meta object literal for the '<em><b>Map2</b></em>' attribute list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute NODE_FEATURE_MAP_CONTAINMENT2__MAP2 = eINSTANCE.getNodeFeatureMapContainment2_Map2();
+
+ /**
+ * The meta object literal for the '<em><b>Multiple</b></em>' containment reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference NODE_FEATURE_MAP_CONTAINMENT2__MULTIPLE = eINSTANCE.getNodeFeatureMapContainment2_Multiple();
+
+ /**
+ * The meta object literal for the '<em><b>Single</b></em>' containment reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference NODE_FEATURE_MAP_CONTAINMENT2__SINGLE = eINSTANCE.getNodeFeatureMapContainment2_Single();
+
}
} //NodesPackage
diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/impl/NodeFeatureMapContainment2Impl.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/impl/NodeFeatureMapContainment2Impl.java
new file mode 100644
index 000000000..d3e60c831
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/impl/NodeFeatureMapContainment2Impl.java
@@ -0,0 +1,212 @@
+/**
+ * Copyright (c) 2011, 2014 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ */
+package org.eclipse.emf.compare.tests.nodes.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.NotificationChain;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.compare.tests.nodes.NodeFeatureMapContainment2;
+import org.eclipse.emf.compare.tests.nodes.NodeMultipleContainment;
+import org.eclipse.emf.compare.tests.nodes.NodeSingleValueContainment;
+import org.eclipse.emf.compare.tests.nodes.NodesPackage;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.util.BasicFeatureMap;
+import org.eclipse.emf.ecore.util.FeatureMap;
+import org.eclipse.emf.ecore.util.InternalEList;
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Node Feature Map Containment2</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.emf.compare.tests.nodes.impl.NodeFeatureMapContainment2Impl#getMap2 <em>Map2</em>}</li>
+ * <li>{@link org.eclipse.emf.compare.tests.nodes.impl.NodeFeatureMapContainment2Impl#getMultiple <em>Multiple</em>}</li>
+ * <li>{@link org.eclipse.emf.compare.tests.nodes.impl.NodeFeatureMapContainment2Impl#getSingle <em>Single</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class NodeFeatureMapContainment2Impl extends NodeImpl implements NodeFeatureMapContainment2 {
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String copyright = "Copyright (c) 2011, 2012 Obeo.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Obeo - initial API and implementation"; //$NON-NLS-1$
+
+ /**
+ * The cached value of the '{@link #getMap2() <em>Map2</em>}' attribute list.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see #getMap2()
+ * @generated
+ * @ordered
+ */
+ protected FeatureMap map2;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ protected NodeFeatureMapContainment2Impl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return NodesPackage.Literals.NODE_FEATURE_MAP_CONTAINMENT2;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public FeatureMap getMap2() {
+ if (map2 == null) {
+ map2 = new BasicFeatureMap(this, NodesPackage.NODE_FEATURE_MAP_CONTAINMENT2__MAP2);
+ }
+ return map2;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<NodeMultipleContainment> getMultiple() {
+ return getMap2().list(NodesPackage.Literals.NODE_FEATURE_MAP_CONTAINMENT2__MULTIPLE);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<NodeSingleValueContainment> getSingle() {
+ return getMap2().list(NodesPackage.Literals.NODE_FEATURE_MAP_CONTAINMENT2__SINGLE);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case NodesPackage.NODE_FEATURE_MAP_CONTAINMENT2__MAP2:
+ return ((InternalEList<?>)getMap2()).basicRemove(otherEnd, msgs);
+ case NodesPackage.NODE_FEATURE_MAP_CONTAINMENT2__MULTIPLE:
+ return ((InternalEList<?>)getMultiple()).basicRemove(otherEnd, msgs);
+ case NodesPackage.NODE_FEATURE_MAP_CONTAINMENT2__SINGLE:
+ return ((InternalEList<?>)getSingle()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case NodesPackage.NODE_FEATURE_MAP_CONTAINMENT2__MAP2:
+ if (coreType) return getMap2();
+ return ((FeatureMap.Internal)getMap2()).getWrapper();
+ case NodesPackage.NODE_FEATURE_MAP_CONTAINMENT2__MULTIPLE:
+ return getMultiple();
+ case NodesPackage.NODE_FEATURE_MAP_CONTAINMENT2__SINGLE:
+ return getSingle();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case NodesPackage.NODE_FEATURE_MAP_CONTAINMENT2__MAP2:
+ ((FeatureMap.Internal)getMap2()).set(newValue);
+ return;
+ case NodesPackage.NODE_FEATURE_MAP_CONTAINMENT2__MULTIPLE:
+ getMultiple().clear();
+ getMultiple().addAll((Collection<? extends NodeMultipleContainment>)newValue);
+ return;
+ case NodesPackage.NODE_FEATURE_MAP_CONTAINMENT2__SINGLE:
+ getSingle().clear();
+ getSingle().addAll((Collection<? extends NodeSingleValueContainment>)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case NodesPackage.NODE_FEATURE_MAP_CONTAINMENT2__MAP2:
+ getMap2().clear();
+ return;
+ case NodesPackage.NODE_FEATURE_MAP_CONTAINMENT2__MULTIPLE:
+ getMultiple().clear();
+ return;
+ case NodesPackage.NODE_FEATURE_MAP_CONTAINMENT2__SINGLE:
+ getSingle().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case NodesPackage.NODE_FEATURE_MAP_CONTAINMENT2__MAP2:
+ return map2 != null && !map2.isEmpty();
+ case NodesPackage.NODE_FEATURE_MAP_CONTAINMENT2__MULTIPLE:
+ return !getMultiple().isEmpty();
+ case NodesPackage.NODE_FEATURE_MAP_CONTAINMENT2__SINGLE:
+ return !getSingle().isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (map2: "); //$NON-NLS-1$
+ result.append(map2);
+ result.append(')');
+ return result.toString();
+ }
+
+} // NodeFeatureMapContainment2Impl
diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/impl/NodesFactoryImpl.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/impl/NodesFactoryImpl.java
index ae77e52ed..b99f71420 100644
--- a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/impl/NodesFactoryImpl.java
+++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/impl/NodesFactoryImpl.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2011, 2012 Obeo.
+ * Copyright (c) 2011, 2014 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,24 +10,14 @@
*/
package org.eclipse.emf.compare.tests.nodes.impl;
-import org.eclipse.emf.compare.tests.nodes.Node;
-import org.eclipse.emf.compare.tests.nodes.NodeFeatureMapContainment;
-import org.eclipse.emf.compare.tests.nodes.NodeFeatureMapNonContainment;
-import org.eclipse.emf.compare.tests.nodes.NodeMultiValueReference;
-import org.eclipse.emf.compare.tests.nodes.NodeMultiValuedAttribute;
-import org.eclipse.emf.compare.tests.nodes.NodeMultipleContainment;
-import org.eclipse.emf.compare.tests.nodes.NodeOppositeRefManyToMany;
-import org.eclipse.emf.compare.tests.nodes.NodeOppositeRefOneToMany;
-import org.eclipse.emf.compare.tests.nodes.NodeOppositeRefOneToOne;
-import org.eclipse.emf.compare.tests.nodes.NodeSingleValueAttribute;
-import org.eclipse.emf.compare.tests.nodes.NodeSingleValueContainment;
-import org.eclipse.emf.compare.tests.nodes.NodeSingleValueReference;
-import org.eclipse.emf.compare.tests.nodes.NodesFactory;
-import org.eclipse.emf.compare.tests.nodes.NodesPackage;
+import org.eclipse.emf.compare.tests.nodes.*;
+
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
+
import org.eclipse.emf.ecore.impl.EFactoryImpl;
+
import org.eclipse.emf.ecore.plugin.EcorePlugin;
/**
@@ -93,6 +83,7 @@ public class NodesFactoryImpl extends EFactoryImpl implements NodesFactory {
case NodesPackage.NODE_OPPOSITE_REF_MANY_TO_MANY: return createNodeOppositeRefManyToMany();
case NodesPackage.NODE_FEATURE_MAP_CONTAINMENT: return createNodeFeatureMapContainment();
case NodesPackage.NODE_FEATURE_MAP_NON_CONTAINMENT: return createNodeFeatureMapNonContainment();
+ case NodesPackage.NODE_FEATURE_MAP_CONTAINMENT2: return createNodeFeatureMapContainment2();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
}
@@ -223,6 +214,16 @@ public class NodesFactoryImpl extends EFactoryImpl implements NodesFactory {
* <!-- end-user-doc -->
* @generated
*/
+ public NodeFeatureMapContainment2 createNodeFeatureMapContainment2() {
+ NodeFeatureMapContainment2Impl nodeFeatureMapContainment2 = new NodeFeatureMapContainment2Impl();
+ return nodeFeatureMapContainment2;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public NodesPackage getNodesPackage() {
return (NodesPackage)getEPackage();
}
diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/impl/NodesPackageImpl.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/impl/NodesPackageImpl.java
index 55e18645f..23e267ebe 100644
--- a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/impl/NodesPackageImpl.java
+++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/impl/NodesPackageImpl.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2011, 2012 Obeo.
+ * Copyright (c) 2011, 2014 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,6 +12,7 @@ package org.eclipse.emf.compare.tests.nodes.impl;
import org.eclipse.emf.compare.tests.nodes.Node;
import org.eclipse.emf.compare.tests.nodes.NodeFeatureMapContainment;
+import org.eclipse.emf.compare.tests.nodes.NodeFeatureMapContainment2;
import org.eclipse.emf.compare.tests.nodes.NodeFeatureMapNonContainment;
import org.eclipse.emf.compare.tests.nodes.NodeMultiValueReference;
import org.eclipse.emf.compare.tests.nodes.NodeMultiValuedAttribute;
@@ -24,79 +25,94 @@ import org.eclipse.emf.compare.tests.nodes.NodeSingleValueContainment;
import org.eclipse.emf.compare.tests.nodes.NodeSingleValueReference;
import org.eclipse.emf.compare.tests.nodes.NodesFactory;
import org.eclipse.emf.compare.tests.nodes.NodesPackage;
+
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
+
import org.eclipse.emf.ecore.impl.EPackageImpl;
/**
- * <!-- begin-user-doc --> An implementation of the model <b>Package</b>. <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Package</b>.
+ * <!-- end-user-doc -->
* @generated
*/
public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public static final String copyright = "Copyright (c) 2011, 2012 Obeo.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Obeo - initial API and implementation"; //$NON-NLS-1$
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
private EClass nodeEClass = null;
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
private EClass nodeMultipleContainmentEClass = null;
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
private EClass nodeSingleValueContainmentEClass = null;
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
private EClass nodeSingleValueAttributeEClass = null;
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
private EClass nodeMultiValuedAttributeEClass = null;
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
private EClass nodeSingleValueReferenceEClass = null;
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
private EClass nodeMultiValueReferenceEClass = null;
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
private EClass nodeOppositeRefOneToOneEClass = null;
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
private EClass nodeOppositeRefOneToManyEClass = null;
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
private EClass nodeOppositeRefManyToManyEClass = null;
@@ -116,6 +132,13 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
private EClass nodeFeatureMapNonContainmentEClass = null;
/**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass nodeFeatureMapContainment2EClass = null;
+
+ /**
* Creates an instance of the model <b>Package</b>, registered with
* {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
* package URI value.
@@ -123,7 +146,8 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
* factory method {@link #init init()}, which also performs
* initialization of the package, or returns the registered package,
* if one already exists.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @see org.eclipse.emf.ecore.EPackage.Registry
* @see org.eclipse.emf.compare.tests.nodes.NodesPackage#eNS_URI
* @see #init()
@@ -134,7 +158,8 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
private static boolean isInited = false;
@@ -144,7 +169,8 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
*
* <p>This method is used to initialize {@link NodesPackage#eINSTANCE} when that field is accessed.
* Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @see #eNS_URI
* @see #createPackageContents()
* @see #initializePackageContents()
@@ -174,7 +200,8 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public EClass getNode() {
@@ -182,7 +209,8 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public EAttribute getNode_Name() {
@@ -190,7 +218,8 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public EReference getNode_ContainmentRef1() {
@@ -198,7 +227,8 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public EClass getNodeMultipleContainment() {
@@ -206,7 +236,8 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public EReference getNodeMultipleContainment_ContainmentRef2() {
@@ -214,7 +245,8 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public EReference getNodeMultipleContainment_ContainmentRef3() {
@@ -222,7 +254,8 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public EClass getNodeSingleValueContainment() {
@@ -230,7 +263,8 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public EReference getNodeSingleValueContainment_SingleValueContainment() {
@@ -238,7 +272,8 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public EClass getNodeSingleValueAttribute() {
@@ -246,7 +281,8 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public EAttribute getNodeSingleValueAttribute_SingleValuedAttribute() {
@@ -254,7 +290,8 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public EClass getNodeMultiValuedAttribute() {
@@ -262,7 +299,8 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public EAttribute getNodeMultiValuedAttribute_MultiValuedAttribute() {
@@ -270,7 +308,8 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public EClass getNodeSingleValueReference() {
@@ -278,7 +317,8 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public EReference getNodeSingleValueReference_SingleValuedReference() {
@@ -286,7 +326,8 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public EClass getNodeMultiValueReference() {
@@ -294,7 +335,8 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public EReference getNodeMultiValueReference_MultiValuedReference() {
@@ -302,7 +344,8 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public EClass getNodeOppositeRefOneToOne() {
@@ -310,7 +353,8 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public EReference getNodeOppositeRefOneToOne_Source() {
@@ -318,7 +362,8 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public EReference getNodeOppositeRefOneToOne_Destination() {
@@ -326,7 +371,8 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public EClass getNodeOppositeRefOneToMany() {
@@ -334,7 +380,8 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public EReference getNodeOppositeRefOneToMany_Source() {
@@ -342,7 +389,8 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public EReference getNodeOppositeRefOneToMany_Destination() {
@@ -350,7 +398,8 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public EClass getNodeOppositeRefManyToMany() {
@@ -358,7 +407,8 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public EReference getNodeOppositeRefManyToMany_Source() {
@@ -366,7 +416,8 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public EReference getNodeOppositeRefManyToMany_Destination() {
@@ -446,7 +497,44 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getNodeFeatureMapContainment2() {
+ return nodeFeatureMapContainment2EClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getNodeFeatureMapContainment2_Map2() {
+ return (EAttribute)nodeFeatureMapContainment2EClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getNodeFeatureMapContainment2_Multiple() {
+ return (EReference)nodeFeatureMapContainment2EClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getNodeFeatureMapContainment2_Single() {
+ return (EReference)nodeFeatureMapContainment2EClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public NodesFactory getNodesFactory() {
@@ -454,7 +542,8 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
private boolean isCreated = false;
@@ -462,7 +551,8 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
/**
* Creates the meta-model objects for the package. This method is
* guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public void createPackageContents() {
@@ -514,10 +604,16 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
createEAttribute(nodeFeatureMapNonContainmentEClass, NODE_FEATURE_MAP_NON_CONTAINMENT__MAP_NC);
createEReference(nodeFeatureMapNonContainmentEClass, NODE_FEATURE_MAP_NON_CONTAINMENT__FIRST_KEY_NC);
createEReference(nodeFeatureMapNonContainmentEClass, NODE_FEATURE_MAP_NON_CONTAINMENT__SECOND_KEY_NC);
+
+ nodeFeatureMapContainment2EClass = createEClass(NODE_FEATURE_MAP_CONTAINMENT2);
+ createEAttribute(nodeFeatureMapContainment2EClass, NODE_FEATURE_MAP_CONTAINMENT2__MAP2);
+ createEReference(nodeFeatureMapContainment2EClass, NODE_FEATURE_MAP_CONTAINMENT2__MULTIPLE);
+ createEReference(nodeFeatureMapContainment2EClass, NODE_FEATURE_MAP_CONTAINMENT2__SINGLE);
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
private boolean isInitialized = false;
@@ -525,7 +621,8 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
/**
* Complete the initialization of the package and its meta-model. This
* method is guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public void initializePackageContents() {
@@ -553,6 +650,7 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
nodeOppositeRefManyToManyEClass.getESuperTypes().add(this.getNode());
nodeFeatureMapContainmentEClass.getESuperTypes().add(this.getNode());
nodeFeatureMapNonContainmentEClass.getESuperTypes().add(this.getNode());
+ nodeFeatureMapContainment2EClass.getESuperTypes().add(this.getNode());
// Initialize classes and features; add operations and parameters
initEClass(nodeEClass, Node.class, "Node", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
@@ -600,6 +698,11 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
initEReference(getNodeFeatureMapNonContainment_FirstKeyNC(), this.getNode(), null, "firstKeyNC", null, 0, -1, NodeFeatureMapNonContainment.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
initEReference(getNodeFeatureMapNonContainment_SecondKeyNC(), this.getNode(), null, "secondKeyNC", null, 0, -1, NodeFeatureMapNonContainment.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+ initEClass(nodeFeatureMapContainment2EClass, NodeFeatureMapContainment2.class, "NodeFeatureMapContainment2", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
+ initEAttribute(getNodeFeatureMapContainment2_Map2(), ecorePackage.getEFeatureMapEntry(), "map2", null, 0, -1, NodeFeatureMapContainment2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+ initEReference(getNodeFeatureMapContainment2_Multiple(), this.getNodeMultipleContainment(), null, "multiple", null, 0, -1, NodeFeatureMapContainment2.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+ initEReference(getNodeFeatureMapContainment2_Single(), this.getNodeSingleValueContainment(), null, "single", null, 0, -1, NodeFeatureMapContainment2.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+
// Create resource
createResource(eNS_URI);
@@ -651,7 +754,25 @@ public class NodesPackageImpl extends EPackageImpl implements NodesPackage {
source,
new String[] {
"group", "#mapNC" //$NON-NLS-1$ //$NON-NLS-2$
+ });
+ addAnnotation
+ (getNodeFeatureMapContainment2_Map2(),
+ source,
+ new String[] {
+ "kind", "group" //$NON-NLS-1$ //$NON-NLS-2$
+ });
+ addAnnotation
+ (getNodeFeatureMapContainment2_Multiple(),
+ source,
+ new String[] {
+ "group", "#map2" //$NON-NLS-1$ //$NON-NLS-2$
+ });
+ addAnnotation
+ (getNodeFeatureMapContainment2_Single(),
+ source,
+ new String[] {
+ "group", "#map2" //$NON-NLS-1$ //$NON-NLS-2$
});
}
-} // NodesPackageImpl
+} //NodesPackageImpl
diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/util/NodesAdapterFactory.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/util/NodesAdapterFactory.java
index f80695d1e..42078381d 100644
--- a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/util/NodesAdapterFactory.java
+++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/util/NodesAdapterFactory.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2011, 2012 Obeo.
+ * Copyright (c) 2011, 2014 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,20 +12,11 @@ package org.eclipse.emf.compare.tests.nodes.util;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notifier;
+
import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-import org.eclipse.emf.compare.tests.nodes.Node;
-import org.eclipse.emf.compare.tests.nodes.NodeFeatureMapContainment;
-import org.eclipse.emf.compare.tests.nodes.NodeFeatureMapNonContainment;
-import org.eclipse.emf.compare.tests.nodes.NodeMultiValueReference;
-import org.eclipse.emf.compare.tests.nodes.NodeMultiValuedAttribute;
-import org.eclipse.emf.compare.tests.nodes.NodeMultipleContainment;
-import org.eclipse.emf.compare.tests.nodes.NodeOppositeRefManyToMany;
-import org.eclipse.emf.compare.tests.nodes.NodeOppositeRefOneToMany;
-import org.eclipse.emf.compare.tests.nodes.NodeOppositeRefOneToOne;
-import org.eclipse.emf.compare.tests.nodes.NodeSingleValueAttribute;
-import org.eclipse.emf.compare.tests.nodes.NodeSingleValueContainment;
-import org.eclipse.emf.compare.tests.nodes.NodeSingleValueReference;
-import org.eclipse.emf.compare.tests.nodes.NodesPackage;
+
+import org.eclipse.emf.compare.tests.nodes.*;
+
import org.eclipse.emf.ecore.EObject;
/**
@@ -140,6 +131,10 @@ public class NodesAdapterFactory extends AdapterFactoryImpl {
return createNodeFeatureMapNonContainmentAdapter();
}
@Override
+ public Adapter caseNodeFeatureMapContainment2(NodeFeatureMapContainment2 object) {
+ return createNodeFeatureMapContainment2Adapter();
+ }
+ @Override
public Adapter defaultCase(EObject object) {
return createEObjectAdapter();
}
@@ -328,6 +323,20 @@ public class NodesAdapterFactory extends AdapterFactoryImpl {
}
/**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.compare.tests.nodes.NodeFeatureMapContainment2 <em>Node Feature Map Containment2</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.emf.compare.tests.nodes.NodeFeatureMapContainment2
+ * @generated
+ */
+ public Adapter createNodeFeatureMapContainment2Adapter() {
+ return null;
+ }
+
+ /**
* Creates a new adapter for the default case.
* <!-- begin-user-doc -->
* This default implementation returns null.
diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/util/NodesSwitch.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/util/NodesSwitch.java
index 3d445888c..e5fe8ff7b 100644
--- a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/util/NodesSwitch.java
+++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/nodes/util/NodesSwitch.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2011, 2012 Obeo.
+ * Copyright (c) 2011, 2014 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,19 +12,8 @@ package org.eclipse.emf.compare.tests.nodes.util;
import java.util.List;
-import org.eclipse.emf.compare.tests.nodes.Node;
-import org.eclipse.emf.compare.tests.nodes.NodeFeatureMapContainment;
-import org.eclipse.emf.compare.tests.nodes.NodeFeatureMapNonContainment;
-import org.eclipse.emf.compare.tests.nodes.NodeMultiValueReference;
-import org.eclipse.emf.compare.tests.nodes.NodeMultiValuedAttribute;
-import org.eclipse.emf.compare.tests.nodes.NodeMultipleContainment;
-import org.eclipse.emf.compare.tests.nodes.NodeOppositeRefManyToMany;
-import org.eclipse.emf.compare.tests.nodes.NodeOppositeRefOneToMany;
-import org.eclipse.emf.compare.tests.nodes.NodeOppositeRefOneToOne;
-import org.eclipse.emf.compare.tests.nodes.NodeSingleValueAttribute;
-import org.eclipse.emf.compare.tests.nodes.NodeSingleValueContainment;
-import org.eclipse.emf.compare.tests.nodes.NodeSingleValueReference;
-import org.eclipse.emf.compare.tests.nodes.NodesPackage;
+import org.eclipse.emf.compare.tests.nodes.*;
+
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
@@ -41,8 +30,6 @@ import org.eclipse.emf.ecore.EObject;
* @see org.eclipse.emf.compare.tests.nodes.NodesPackage
* @generated
*/
-//Generated code, suppressing all warnings
-@SuppressWarnings("all")
public class NodesSwitch<T> {
/**
* <!-- begin-user-doc -->
@@ -194,6 +181,13 @@ public class NodesSwitch<T> {
if (result == null) result = defaultCase(theEObject);
return result;
}
+ case NodesPackage.NODE_FEATURE_MAP_CONTAINMENT2: {
+ NodeFeatureMapContainment2 nodeFeatureMapContainment2 = (NodeFeatureMapContainment2)theEObject;
+ T result = caseNodeFeatureMapContainment2(nodeFeatureMapContainment2);
+ if (result == null) result = caseNode(nodeFeatureMapContainment2);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
default: return defaultCase(theEObject);
}
}
@@ -379,6 +373,21 @@ public class NodesSwitch<T> {
}
/**
+ * Returns the result of interpreting the object as an instance of '<em>Node Feature Map Containment2</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Node Feature Map Containment2</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseNodeFeatureMapContainment2(NodeFeatureMapContainment2 object) {
+ return null;
+ }
+
+ /**
* Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/FeatureFilterTest.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/FeatureFilterTest.java
new file mode 100644
index 000000000..9e45d5dbd
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/FeatureFilterTest.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.tests.diff;
+
+import static org.junit.Assert.assertFalse;
+
+import com.google.common.collect.Iterators;
+import com.google.common.collect.Sets;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.eclipse.emf.compare.Comparison;
+import org.eclipse.emf.compare.EMFCompare;
+import org.eclipse.emf.compare.Match;
+import org.eclipse.emf.compare.diff.FeatureFilter;
+import org.eclipse.emf.compare.scope.DefaultComparisonScope;
+import org.eclipse.emf.compare.scope.IComparisonScope;
+import org.eclipse.emf.compare.tests.diff.data.featurefilter.featuremap.FeatureFilterFeatureMapsInputData;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.junit.Test;
+
+/**
+ * We will use this to test the methods exposed by the {@link FeatureFilter}.
+ *
+ * @author <a href="mailto:axel.richard@obeo.fr">Axel Richard</a>
+ */
+@SuppressWarnings("nls")
+public class FeatureFilterTest {
+ @Test
+ public void testOnFeatureMaps() throws IOException {
+ // Test with models containing NodeFeatureMapContainment2 elements. A NodeFeatureMapContainment2 is an
+ // element that contains a map with two types of entries: NodeMultipleContainment and
+ // NodeSingleValueContainment. NodeMultipleContainment has containment references that don't exist in
+ // NodeSingleValueContainment. The FeatureFilter needs to properly handle the case.
+ FeatureFilterFeatureMapsInputData inputData = new FeatureFilterFeatureMapsInputData();
+
+ final Resource left = inputData.getNodesLeft();
+ final Resource right = inputData.getNodesRight();
+
+ IComparisonScope scope = new DefaultComparisonScope(left, right, null);
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
+ FeatureFilter filter = new FeatureFilter();
+
+ Collection<Match> allMatches = getAllMatches(comparison);
+ assertFalse(allMatches.isEmpty());
+
+ for (Match m : allMatches) {
+ Iterator<EReference> referencesToCheck = filter.getReferencesToCheck(m);
+ EObject rhsMatch = m.getRight();
+ if (rhsMatch != null) {
+ for (EStructuralFeature sf : rhsMatch.eClass().getEAllStructuralFeatures()) {
+ // If the ref doesn't exists in the right hand side of the match, the filter must exclude
+ // it.
+ if (sf == null) {
+ assertFalse(Iterators.contains(referencesToCheck, sf));
+ }
+ }
+ }
+ }
+ }
+
+ private Collection<Match> getAllMatches(Comparison comparison) {
+ Collection<Match> matches = Sets.newLinkedHashSet();
+ for (Match match : comparison.getMatches()) {
+ matches.add(match);
+ for (Match subMatch : match.getAllSubmatches()) {
+ matches.add(subMatch);
+ }
+ }
+ return matches;
+
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/data/featurefilter/featuremap/FeatureFilterFeatureMapsInputData.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/data/featurefilter/featuremap/FeatureFilterFeatureMapsInputData.java
new file mode 100644
index 000000000..34b8494f0
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/data/featurefilter/featuremap/FeatureFilterFeatureMapsInputData.java
@@ -0,0 +1,32 @@
+/**
+ * Copyright (c) 2014 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ */
+package org.eclipse.emf.compare.tests.diff.data.featurefilter.featuremap;
+
+import java.io.IOException;
+
+import org.eclipse.emf.compare.tests.framework.AbstractInputData;
+import org.eclipse.emf.ecore.resource.Resource;
+
+/**
+ * Provides input models to the unit tests of feature filter.
+ *
+ * @author <a href="mailto:axel.richard@obeo.fr">Axel Richard</a>
+ */
+@SuppressWarnings("nls")
+public class FeatureFilterFeatureMapsInputData extends AbstractInputData {
+ public Resource getNodesLeft() throws IOException {
+ return loadFromClassLoader("left.nodes");
+ }
+
+ public Resource getNodesRight() throws IOException {
+ return loadFromClassLoader("right.nodes");
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/data/featurefilter/featuremap/left.nodes b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/data/featurefilter/featuremap/left.nodes
new file mode 100644
index 000000000..17a17e28d
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/data/featurefilter/featuremap/left.nodes
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nodes:Node
+ xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:nodes="http://www.eclipse.org/emf/compare/tests/nodes"
+ xmi:id="_CEv4EM7REeOlS6AUBGqBsw"
+ name="root">
+ <containmentRef1
+ xsi:type="nodes:NodeFeatureMapContainment2"
+ xmi:id="_EackIM7REeOlS6AUBGqBsw"
+ name="mapNode1">
+ <single
+ xmi:id="_FkC-UEIxEeSBdof79sfInA"
+ name="node1"/>
+ <multiple
+ xmi:id="_GDeFQEIxEeSBdof79sfInA"
+ name="node3"/>
+ <multiple
+ xmi:id="_MfTBNEIxEeSBdof79sfInA"
+ name="node5"/>
+ <single
+ xmi:id="_MMIsoEIxEeSBdof79sfInA"
+ name="node4"/>
+ </containmentRef1>
+</nodes:Node>
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/data/featurefilter/featuremap/right.nodes b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/data/featurefilter/featuremap/right.nodes
new file mode 100644
index 000000000..2f5f33eba
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/data/featurefilter/featuremap/right.nodes
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nodes:Node
+ xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:nodes="http://www.eclipse.org/emf/compare/tests/nodes"
+ xmi:id="_CEv4EM7REeOlS6AUBGqBsw"
+ name="root">
+ <containmentRef1
+ xsi:type="nodes:NodeFeatureMapContainment2"
+ xmi:id="_EackIM7REeOlS6AUBGqBsw"
+ name="mapNode1">
+ <single
+ xmi:id="_FkC-UEIxEeSBdof79sfInA"
+ name="node1"/>
+ <single
+ xmi:id="_LtGAMEIxEeSBdof79sfInA"
+ name="node2"/>
+ <multiple
+ xmi:id="_GDeFQEIxEeSBdof79sfInA"
+ name="node3"/>
+ <multiple
+ xmi:id="_MMIsoEIxEeSBdof79sfInA"
+ name="node4"/>
+ </containmentRef1>
+</nodes:Node>
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/suite/AllTests.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/suite/AllTests.java
index 1fc8520dc..ca5805b02 100644
--- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/suite/AllTests.java
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/suite/AllTests.java
@@ -19,6 +19,7 @@ import org.eclipse.emf.compare.tests.command.CommandStackTestSuite;
import org.eclipse.emf.compare.tests.conflict.ConflictDetectionTest;
import org.eclipse.emf.compare.tests.diff.ComparisonUtilTest;
import org.eclipse.emf.compare.tests.diff.DiffUtilTest;
+import org.eclipse.emf.compare.tests.diff.FeatureFilterTest;
import org.eclipse.emf.compare.tests.diff.LCSPerformanceTest;
import org.eclipse.emf.compare.tests.diff.URIDistanceTest;
import org.eclipse.emf.compare.tests.edit.AllEditTests;
@@ -70,7 +71,8 @@ import org.junit.runners.Suite.SuiteClasses;
AllEditTests.class, CommandStackTestSuite.class, MatchEngineFactoryRegistryTest.class,
ConflictMergeTest.class, PseudoConflictMergeTest.class, ProximityIndexTest.class, AllRCPTests.class,
FeatureMaps2wayMergeTest.class, FeatureMaps3wayMergeTest.class, FeatureMapsConflictsMergeTest.class,
- FeatureMapsPseudoConflictsMergeTest.class, TwoWayBatchMergingTest.class, EqualityHelperTest.class })
+ FeatureMapsPseudoConflictsMergeTest.class, TwoWayBatchMergingTest.class, EqualityHelperTest.class,
+ FeatureFilterTest.class })
public class AllTests {
/**
* Standalone launcher for all of compare's tests.
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/diff/FeatureFilter.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/diff/FeatureFilter.java
index 370789ce7..68dd77aca 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/diff/FeatureFilter.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/diff/FeatureFilter.java
@@ -129,12 +129,12 @@ public class FeatureFilter {
final String featureName = reference.getName();
if (match.getRight() != null) {
final EStructuralFeature rightRef = match.getRight().eClass().getEStructuralFeature(featureName);
- isSet = match.getRight().eIsSet(rightRef);
+ isSet = rightRef != null && match.getRight().eIsSet(rightRef);
}
if (!isSet && match.getOrigin() != null) {
final EStructuralFeature originRef = match.getOrigin().eClass()
.getEStructuralFeature(featureName);
- isSet = match.getOrigin().eIsSet(originRef);
+ isSet = originRef != null && match.getOrigin().eIsSet(originRef);
}
return isSet;
}

Back to the top