Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Winkler2011-12-14 10:34:45 -0500
committerStefan Winkler2011-12-15 09:53:03 -0500
commit7fa0334aa96f6d2de08f5995feaf97099a869a48 (patch)
tree4fe0736b9badfbe4e36191d574f30e40a062be0d
parentb93fae4ad6364e6dee0111af089089c5eb3d69a9 (diff)
downloadcdo-7fa0334aa96f6d2de08f5995feaf97099a869a48.tar.gz
cdo-7fa0334aa96f6d2de08f5995feaf97099a869a48.tar.xz
cdo-7fa0334aa96f6d2de08f5995feaf97099a869a48.zip
[366686] [DB] Reduce amount of update statements for non-audit mode
https://bugs.eclipse.org/bugs/show_bug.cgi?id=366686 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 3659cee704..f48e803fb0 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
@@ -531,6 +531,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