fixed error when ExtendReplace flag is on
diff --git a/org.eclipse.epf.library.tests/src/org/eclipse/epf/library/tests/variability/Incoming01FeatureTest.java b/org.eclipse.epf.library.tests/src/org/eclipse/epf/library/tests/variability/Incoming01FeatureTest.java
index 69c541f..160a587 100644
--- a/org.eclipse.epf.library.tests/src/org/eclipse/epf/library/tests/variability/Incoming01FeatureTest.java
+++ b/org.eclipse.epf.library.tests/src/org/eclipse/epf/library/tests/variability/Incoming01FeatureTest.java
@@ -14,6 +14,7 @@
import org.eclipse.epf.library.configuration.ConfigurationHelper;
import org.eclipse.epf.library.configuration.DefaultElementRealizer;
+import org.eclipse.epf.library.configuration.ElementRealizer;
import org.eclipse.epf.library.tests.LibraryTestHelper;
import org.eclipse.epf.library.util.LibraryUtil;
import org.eclipse.epf.uma.Artifact;
@@ -59,14 +60,14 @@
// since 1.2, this is a to-many feature, not to-one
// case 1
d1.getWorkProducts().add(a1);
- d1.getWorkProducts().add(a2);
+ d2.getWorkProducts().add(a2);
List items = ConfigurationHelper.calc0nFeatureValue(a1, ofeature, realizer);
assertEquals(1, items.size());
assertEquals(d1, items.get(0));
items = ConfigurationHelper.calc0nFeatureValue(a2, ofeature, realizer);
assertEquals(1, items.size());
- assertEquals(d1, items.get(0));
+ assertEquals(d2, items.get(0));
// case 2:
LibraryTestHelper.setContributes(d2, d1);
@@ -86,7 +87,8 @@
assertEquals(0, items.size());
items = ConfigurationHelper.calc0nFeatureValue(a2, ofeature, realizer);
- assertEquals(0, items.size());
+ assertEquals(1, items.size());
+ assertEquals(d2, items.get(0));
// case 4:
LibraryTestHelper.setExtends(d2, d1);
@@ -96,7 +98,7 @@
items = ConfigurationHelper.calc0nFeatureValue(a2, ofeature, realizer);
assertEquals(1, items.size());
- assertEquals(d1, items.get(0));
+ assertEquals(d2, items.get(0));
}
public void test_workProduct_Domain_with_contributors() {
diff --git a/org.eclipse.epf.library.tests/src/org/eclipse/epf/library/tests/variability/Outgoing01FeatureTest.java b/org.eclipse.epf.library.tests/src/org/eclipse/epf/library/tests/variability/Outgoing01FeatureTest.java
index ff2d668..f5d3176 100644
--- a/org.eclipse.epf.library.tests/src/org/eclipse/epf/library/tests/variability/Outgoing01FeatureTest.java
+++ b/org.eclipse.epf.library.tests/src/org/eclipse/epf/library/tests/variability/Outgoing01FeatureTest.java
@@ -13,6 +13,7 @@
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.epf.library.configuration.ConfigurationHelper;
import org.eclipse.epf.library.configuration.DefaultElementRealizer;
+import org.eclipse.epf.library.configuration.ElementRealizer;
import org.eclipse.epf.library.tests.LibraryTestHelper;
import org.eclipse.epf.library.util.LibraryUtil;
import org.eclipse.epf.uma.ContentPackage;
@@ -22,6 +23,7 @@
import org.eclipse.epf.uma.Role;
import org.eclipse.epf.uma.Task;
import org.eclipse.epf.uma.UmaPackage;
+import org.eclipse.epf.uma.VariabilityElement;
/**
* Test case for 0..1 feature varaibility.
@@ -195,7 +197,12 @@
EStructuralFeature feature = UmaPackage.eINSTANCE.getTask_PerformedBy();
MethodElement r = ConfigurationHelper.calc01FeatureValue(t, feature, realizer);
- assertEquals(null, r);
+
+ if (ElementRealizer.isExtendReplaceEnabled() ) {
+ assertEquals(r1, r);
+ } else {
+ assertEquals(null, r);
+ }
}
public void test_task_performedBy_with_replacers() {