Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2018-07-27 09:04:07 -0400
committerEike Stepper2018-07-27 09:04:07 -0400
commit53a0d2faf5f64226aa17775f71ee63de2353895b (patch)
treebf13d4ab78f777c52a94a7e298a8e36bcdf77c3a /plugins/org.eclipse.emf.cdo.tests/src
parent4fd0c31bf0c5eda3b91234583e335c626209a48d (diff)
downloadcdo-53a0d2faf5f64226aa17775f71ee63de2353895b.tar.gz
cdo-53a0d2faf5f64226aa17775f71ee63de2353895b.tar.xz
cdo-53a0d2faf5f64226aa17775f71ee63de2353895b.zip
[537081] Cannot unset a Reference with external EObject as values
https://bugs.eclipse.org/bugs/show_bug.cgi?id=537081
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.tests/src')
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ExternalReferenceTest.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ExternalReferenceTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ExternalReferenceTest.java
index b6381c2436..165fbaec8d 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ExternalReferenceTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ExternalReferenceTest.java
@@ -55,6 +55,7 @@ import org.eclipse.emf.ecore.xmi.impl.XMLResourceFactoryImpl;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
+import java.util.Collections;
import java.util.List;
import java.util.Map;
@@ -395,7 +396,8 @@ public class ExternalReferenceTest extends AbstractCDOTest
CDOTransaction transaction = session.openTransaction(resourceSet);
Supplier supplier = getModel1Factory().createSupplier();
- supplier.getPurchaseOrders().add(externalObject);
+ EList<PurchaseOrder> purchaseOrders = supplier.getPurchaseOrders();
+ purchaseOrders.add(externalObject);
CDOResource resource = transaction.createResource(getResourcePath("/internal"));
resource.getContents().add(supplier);
@@ -404,6 +406,12 @@ public class ExternalReferenceTest extends AbstractCDOTest
CDORevision salesOrderRevision = CDOUtil.getCDOObject(supplier).cdoRevision();
Object externalReference = salesOrderRevision.data().get(getModel1Package().getSupplier_PurchaseOrders(), 0);
assertInstanceOf(CDOIDExternal.class, externalReference);
+
+ assertEquals(externalObject, purchaseOrders.get(0));
+ assertEquals(0, purchaseOrders.indexOf(externalObject));
+ assertEquals(0, purchaseOrders.lastIndexOf(externalObject));
+ assertTrue(purchaseOrders.contains(externalObject));
+ assertTrue(purchaseOrders.containsAll(Collections.singleton(externalObject))); // Bug 537081.
}
public void testWithXMLAndPrefetching() throws Exception

Back to the top