diff options
author | Artur Signell <artur@vaadin.com> | 2012-11-12 16:38:43 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2012-11-28 11:47:12 +0000 |
commit | 7fecb899c85c038415633857865cc5f20a3ab20e (patch) | |
tree | 8f67aa0f779aeb4060674b77f6b372e381031bb4 /server/tests | |
parent | 42f402de0e2ecb9e2816156ed78225cb41258390 (diff) | |
download | vaadin-framework-7fecb899c85c038415633857865cc5f20a3ab20e.tar.gz vaadin-framework-7fecb899c85c038415633857865cc5f20a3ab20e.zip |
getPrevItemId should return null if id not found (#10124)
Change-Id: I9c0a07610e942bf8fac5832341a4fb31bfd6342a
Diffstat (limited to 'server/tests')
-rw-r--r-- | server/tests/src/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/server/tests/src/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java b/server/tests/src/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java index 64288326f0..844ef705b1 100644 --- a/server/tests/src/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java +++ b/server/tests/src/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java @@ -162,6 +162,24 @@ public class SQLContainerTest { } @Test + public void nextItemNullAtEnd_freeformExistingItem() throws SQLException { + SQLContainer container = new SQLContainer(new FreeformQuery( + "SELECT * FROM people", connectionPool, "ID")); + Object lastItemId = container.lastItemId(); + Object afterLast = container.nextItemId(lastItemId); + Assert.assertNull(afterLast); + } + + @Test + public void prevItemNullAtStart_freeformExistingItem() throws SQLException { + SQLContainer container = new SQLContainer(new FreeformQuery( + "SELECT * FROM people", connectionPool, "ID")); + Object firstItemId = container.firstItemId(); + Object beforeFirst = container.prevItemId(firstItemId); + Assert.assertNull(beforeFirst); + } + + @Test public void getItem_freeform5000RowsWithParameter1337_returnsItemWithId1337() throws SQLException { DataGenerator.addFiveThousandPeople(connectionPool); |