aboutsummaryrefslogtreecommitdiffstats
path: root/server/tests
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/src/com/vaadin/data/util/sqlcontainer/SQLContainerTableQueryTest.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/server/tests/src/com/vaadin/data/util/sqlcontainer/SQLContainerTableQueryTest.java b/server/tests/src/com/vaadin/data/util/sqlcontainer/SQLContainerTableQueryTest.java
index d907f12321..93a27352a5 100644
--- a/server/tests/src/com/vaadin/data/util/sqlcontainer/SQLContainerTableQueryTest.java
+++ b/server/tests/src/com/vaadin/data/util/sqlcontainer/SQLContainerTableQueryTest.java
@@ -1137,6 +1137,20 @@ public class SQLContainerTableQueryTest {
}
@Test
+ public void commit_removeModifiedItem_shouldSucceed() throws SQLException {
+ TableQuery query = new TableQuery("people", connectionPool,
+ SQLTestsConstants.sqlGen);
+ SQLContainer container = new SQLContainer(query);
+ int size = container.size();
+ Object key = container.firstItemId();
+ Item row = container.getItem(key);
+ row.getItemProperty("NAME").setValue("Pekka");
+ Assert.assertTrue(container.removeItem(key));
+ container.commit();
+ Assert.assertEquals(size - 1, container.size());
+ }
+
+ @Test
public void rollback_tableItemAdded_discardsAddedItem() throws SQLException {
SQLContainer container = new SQLContainer(new TableQuery("people",
connectionPool, SQLTestsConstants.sqlGen));