diff options
author | Eike Stepper | 2018-04-22 04:29:35 +0000 |
---|---|---|
committer | Eike Stepper | 2018-04-22 04:29:35 +0000 |
commit | 5f582b20c8a4602fc0cc4f554e5098aa2cc7e8c9 (patch) | |
tree | 95144ddf237338d3e57a2458274016a88b19b46f /plugins/org.eclipse.emf.cdo.tests/src | |
parent | 0b250f569edeb1ea983aa761337b7d57057ac328 (diff) | |
download | cdo-5f582b20c8a4602fc0cc4f554e5098aa2cc7e8c9.tar.gz cdo-5f582b20c8a4602fc0cc4f554e5098aa2cc7e8c9.tar.xz cdo-5f582b20c8a4602fc0cc4f554e5098aa2cc7e8c9.zip |
[533909] Unsettable features that are set to null can't be committed
https://bugs.eclipse.org/bugs/show_bug.cgi?id=533909
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/UnsetTest.java | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/UnsetTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/UnsetTest.java index 9193659106..2d693fa34b 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/UnsetTest.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/UnsetTest.java @@ -13,6 +13,7 @@ package org.eclipse.emf.cdo.tests; import org.eclipse.emf.cdo.common.model.EMFUtil; import org.eclipse.emf.cdo.eresource.CDOResource; import org.eclipse.emf.cdo.session.CDOSession; +import org.eclipse.emf.cdo.tests.model1.Company; import org.eclipse.emf.cdo.tests.model1.Supplier; import org.eclipse.emf.cdo.tests.model1.VAT; import org.eclipse.emf.cdo.tests.model2.Unsettable1; @@ -510,6 +511,36 @@ public class UnsetTest extends AbstractCDOTest } } + public void testUnsettableObject() throws Exception + { + CDOSession session = openSession(); + CDOTransaction transaction = session.openTransaction(); + CDOResource resource = transaction.createResource(getResourcePath("/test1")); + + Unsettable1 unsettable = getModel2Factory().createUnsettable1(); + resource.getContents().add(unsettable); + assertEquals(false, unsettable.isSetUnsettableElement()); + transaction.commit(); + assertEquals(false, unsettable.isSetUnsettableElement()); + + unsettable.setUnsettableElement(null); + assertEquals(true, unsettable.isSetUnsettableElement()); + transaction.commit(); + assertEquals(true, unsettable.isSetUnsettableElement()); + + unsettable.unsetUnsettableElement(); + assertEquals(false, unsettable.isSetUnsettableElement()); + transaction.commit(); + assertEquals(false, unsettable.isSetUnsettableElement()); + + Company company = getModel1Factory().createCompany(); + unsettable.eResource().getContents().add(company); + unsettable.setUnsettableElement(company); + assertEquals(true, unsettable.isSetUnsettableElement()); + transaction.commit(); + assertEquals(true, unsettable.isSetUnsettableElement()); + } + @Override protected void doTearDown() throws Exception { |