summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaspar De Groot2010-05-24 04:28:11 (EDT)
committerCaspar De Groot2010-05-24 04:28:11 (EDT)
commit3983c0f1c73882401a0da862b2183dbd86c54447 (patch)
tree61070287b1fe68213a93bec57adcde9a03f4388f
parent7cbb162070f7d867fac60d8fd1cb1c44bd1e0acf (diff)
downloadcdo-3983c0f1c73882401a0da862b2183dbd86c54447.zip
cdo-3983c0f1c73882401a0da862b2183dbd86c54447.tar.gz
cdo-3983c0f1c73882401a0da862b2183dbd86c54447.tar.bz2
[312205] After detach-reattach-rollback, object is not present in tx
https://bugs.eclipse.org/bugs/show_bug.cgi?id=312205
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_283985_SavePointTest.java34
1 files changed, 10 insertions, 24 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_283985_SavePointTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_283985_SavePointTest.java
index a40ab22..4d6e9fb 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_283985_SavePointTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_283985_SavePointTest.java
@@ -15,11 +15,9 @@ import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.session.CDOSession;
import org.eclipse.emf.cdo.tests.AbstractCDOTest;
-import org.eclipse.emf.cdo.tests.model1.Company;
import org.eclipse.emf.cdo.tests.model1.Model1Factory;
import org.eclipse.emf.cdo.tests.model1.Order;
import org.eclipse.emf.cdo.tests.model1.OrderDetail;
-import org.eclipse.emf.cdo.tests.model1.PurchaseOrder;
import org.eclipse.emf.cdo.transaction.CDOTransaction;
import org.eclipse.emf.cdo.util.CDOUtil;
@@ -143,34 +141,22 @@ public class Bugzilla_283985_SavePointTest extends AbstractCDOTest
assertEquals(id, CDOUtil.getCDOObject(detail1).cdoID());
}
+ /**
+ * Bugzilla 312205 - After detach-reattach-rollback, object is not present in tx
+ */
public void test4()
{
- CDOSession session = openSession();
- session.options().setPassiveUpdateEnabled(false);
-
- CDOTransaction tx = session.openTransaction();
- CDOResource r1 = tx.createResource("/r2");
-
- Company company = Model1Factory.eINSTANCE.createCompany();
- PurchaseOrder purchaseOrder = Model1Factory.eINSTANCE.createPurchaseOrder();
- company.getPurchaseOrders().add(purchaseOrder);
- r1.getContents().add(company);
- tx.commit();
-
- CDOID id = CDOUtil.getCDOObject(purchaseOrder).cdoID();
- assertSame(tx.getObject(id), purchaseOrder);
+ CDOID id = CDOUtil.getCDOObject(detail1).cdoID();
+ assertSame(transaction.getObject(id), detail1);
// Detach
- company.getPurchaseOrders().remove(purchaseOrder);
+ order1.getOrderDetails().remove(detail1);
// And re-attach
- company.getPurchaseOrders().add(purchaseOrder);
- assertSame(tx.getObject(id), purchaseOrder);
-
- tx.rollback();
- assertSame(tx.getObject(id), purchaseOrder);
+ order1.getOrderDetails().add(detail1);
+ assertSame(transaction.getObject(id), detail1);
- tx.close();
- session.close();
+ transaction.rollback();
+ assertSame(transaction.getObject(id), detail1);
}
}