Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Winkler2011-12-14 10:34:45 -0500
committerStefan Winkler2011-12-21 16:39:53 -0500
commit841a3d4e5de551f3e993aecd7d694c3385b44ea8 (patch)
treef28bd5a3e48486b7d22e4dbf3945e758cc045d2a
parentcb20a2e1c590a21e94a4449a16100a0a7c08a813 (diff)
downloadcdo-841a3d4e5de551f3e993aecd7d694c3385b44ea8.tar.gz
cdo-841a3d4e5de551f3e993aecd7d694c3385b44ea8.tar.xz
cdo-841a3d4e5de551f3e993aecd7d694c3385b44ea8.zip
[367356] [DB] Reduce amount of update statements for non-audit mode
https://bugs.eclipse.org/bugs/show_bug.cgi?id=367356 Enhanced test case to test the non-audit list table handling a bit more
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionDeltaTest.java132
1 files changed, 132 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionDeltaTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionDeltaTest.java
index 0d41a743ce..174679f2ef 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionDeltaTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionDeltaTest.java
@@ -533,6 +533,138 @@ public class RevisionDeltaTest extends AbstractCDOTest
});
}
+ public void testMultipleInserts()
+ {
+ testStoreDelta(new ListManipulator()
+ {
+ @SuppressWarnings("unchecked")
+ public void doManipulations(EList<?> list)
+ {
+ EList<Company> l = (EList<Company>)list;
+ Company company = getModel1Factory().createCompany();
+ company.setName("NewEntry 1");
+ l.add(7, company);
+ company = getModel1Factory().createCompany();
+ company.setName("NewEntry 2");
+ l.add(12, company);
+ }
+ });
+ }
+
+ public void testInsertAndRemove()
+ {
+ testStoreDelta(new ListManipulator()
+ {
+ @SuppressWarnings("unchecked")
+ public void doManipulations(EList<?> list)
+ {
+ EList<Company> l = (EList<Company>)list;
+ Company company = getModel1Factory().createCompany();
+ company.setName("NewEntry 1");
+ l.add(7, company);
+ l.remove(12);
+ }
+ });
+ }
+
+ public void testInsertAndMove()
+ {
+ testStoreDelta(new ListManipulator()
+ {
+ @SuppressWarnings("unchecked")
+ public void doManipulations(EList<?> list)
+ {
+ EList<Company> l = (EList<Company>)list;
+ Company company = getModel1Factory().createCompany();
+ company.setName("NewEntry 1");
+ l.add(7, company);
+ l.move(12, 7);
+ }
+ });
+ }
+
+ public void testMoveAndDelete()
+ {
+ testStoreDelta(new ListManipulator()
+ {
+ @SuppressWarnings("unchecked")
+ public void doManipulations(EList<?> list)
+ {
+ EList<Company> l = (EList<Company>)list;
+ l.move(12, 7);
+ l.remove(12);
+ }
+ });
+ }
+
+ public void testInsertAndMoveAndRemove()
+ {
+ testStoreDelta(new ListManipulator()
+ {
+ @SuppressWarnings("unchecked")
+ public void doManipulations(EList<?> list)
+ {
+ EList<Company> l = (EList<Company>)list;
+ Company company = getModel1Factory().createCompany();
+ company.setName("NewEntry 1");
+ l.add(7, company);
+ l.move(12, 7);
+ l.remove(12);
+ }
+ });
+ }
+
+ public void testInsertAndSet()
+ {
+ testStoreDelta(new ListManipulator()
+ {
+ @SuppressWarnings("unchecked")
+ public void doManipulations(EList<?> list)
+ {
+ EList<Company> l = (EList<Company>)list;
+ Company company = getModel1Factory().createCompany();
+ company.setName("NewEntry 1");
+ l.add(7, company);
+ Company company2 = getModel1Factory().createCompany();
+ company2.setName("NewEntry 2");
+ l.set(7, company2);
+ l.add(19, company); // <- needed because the set operation makes the company a dangling reference
+ }
+ });
+ }
+
+ public void testSetAndRemove()
+ {
+ testStoreDelta(new ListManipulator()
+ {
+ @SuppressWarnings("unchecked")
+ public void doManipulations(EList<?> list)
+ {
+ EList<Company> l = (EList<Company>)list;
+ Company company = getModel1Factory().createCompany();
+ company.setName("NewEntry 1");
+ Company oldCompany = l.get(7);
+ l.set(7, company);
+ l.add(19, oldCompany);
+ l.remove(7); // <- needed because the set operation makes the company a dangling reference
+ }
+ });
+ }
+
+ public void testMultipleRemoves()
+ {
+ testStoreDelta(new ListManipulator()
+ {
+ @SuppressWarnings("unchecked")
+ public void doManipulations(EList<?> list)
+ {
+ EList<Company> l = (EList<Company>)list;
+ l.remove(7);
+ l.remove(12);
+ }
+ });
+ }
+
private InternalCDORevision getCopyCDORevision(Object object)
{
return (InternalCDORevision)CDOUtil.getCDOObject((EObject)object).cdoRevision().copy();

Back to the top