Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-05-20 08:25:25 +0000
committerEike Stepper2008-05-20 08:25:25 +0000
commit0a7a3d3690ec9c12a7e9084192afaaf9b3c21ee8 (patch)
treecfb4e08cc2aeba93a7bd5290f88f5f78d7196007
parentf176b23fe3da52c693b598e7b00a6b30776a67c2 (diff)
downloadcdo-0a7a3d3690ec9c12a7e9084192afaaf9b3c21ee8.tar.gz
cdo-0a7a3d3690ec9c12a7e9084192afaaf9b3c21ee8.tar.xz
cdo-0a7a3d3690ec9c12a7e9084192afaaf9b3c21ee8.zip
[232673] [CDO] can't remove object from collection
https://bugs.eclipse.org/bugs/show_bug.cgi?id=232673
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/InitialTest.java49
1 files changed, 49 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/InitialTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/InitialTest.java
index 7890f33efe..ce16758aa7 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/InitialTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/InitialTest.java
@@ -684,4 +684,53 @@ public class InitialTest extends AbstractCDOTest
session.close();
}
+
+ public void testNullReference() throws Exception
+ {
+ {
+ msg("Opening session");
+ CDOSession session = openModel1Session();
+
+ msg("Opening transaction");
+ CDOTransaction transaction = session.openTransaction();
+
+ msg("Creating resource");
+ CDOResource resource = transaction.createResource("/test1");
+
+ msg("Creating orderDetail");
+ OrderDetail orderDetail = Model1Factory.eINSTANCE.createOrderDetail();
+
+ msg("Setting price");
+ orderDetail.setPrice(4.75f);
+
+ msg("Adding orderDetail");
+ resource.getContents().add(orderDetail);
+
+ msg("Committing");
+ transaction.commit();
+ session.close();
+ }
+
+ msg("Opening session");
+ CDOSession session = openModel1Session();
+
+ msg("Opening transaction");
+ CDOTransaction transaction = session.openTransaction();
+
+ msg("Getting resource");
+ CDOResource resource = transaction.getResource("/test1");
+
+ msg("Getting contents");
+ EList<EObject> contents = resource.getContents();
+
+ msg("Getting supplier");
+ OrderDetail orderDetail = (OrderDetail)contents.get(0);
+ assertNotNull(orderDetail);
+
+ msg("Verifying price");
+ assertEquals(4.75f, orderDetail.getPrice());
+
+ msg("Verifying product");
+ assertEquals(null, orderDetail.getProduct());
+ }
}

Back to the top