summaryrefslogtreecommitdiffstats
path: root/server/tests/src/com/vaadin/data
diff options
context:
space:
mode:
authorHenri Sara <hesara@vaadin.com>2012-09-04 16:47:42 +0300
committerHenri Sara <hesara@vaadin.com>2012-09-04 16:47:42 +0300
commite8a5f2082d854085fc9da33d5f837900ef347f4f (patch)
treeebb7cb59236a8605252de61d5fd00d6facdaa6c1 /server/tests/src/com/vaadin/data
parent99a423cea5a273d7ddcc39a959895931d12533df (diff)
downloadvaadin-framework-e8a5f2082d854085fc9da33d5f837900ef347f4f.tar.gz
vaadin-framework-e8a5f2082d854085fc9da33d5f837900ef347f4f.zip
Fix SQLContainer indexed access and related tests (#9472)
Diffstat (limited to 'server/tests/src/com/vaadin/data')
-rw-r--r--server/tests/src/com/vaadin/data/util/sqlcontainer/SQLContainerTableQueryTest.java7
-rw-r--r--server/tests/src/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java9
2 files changed, 13 insertions, 3 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 438c40823d..7b3d8a4cf2 100644
--- a/server/tests/src/com/vaadin/data/util/sqlcontainer/SQLContainerTableQueryTest.java
+++ b/server/tests/src/com/vaadin/data/util/sqlcontainer/SQLContainerTableQueryTest.java
@@ -1468,7 +1468,12 @@ public class SQLContainerTableQueryTest {
container.getContainerProperty(container.getIdByIndex(3),
"NAME").getValue());
- Assert.assertNull(container.getIdByIndex(4));
+ try {
+ container.getIdByIndex(4);
+ Assert.fail("SQLContainer.getIdByIndex() returned a value for an index beyond the end of the container");
+ } catch (IndexOutOfBoundsException e) {
+ // should throw exception - item is filtered out
+ }
Assert.assertNull(container.nextItemId(container.getIdByIndex(3)));
Assert.assertFalse(container.containsId(id2));
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 6649bc16e8..0856b3c08c 100644
--- a/server/tests/src/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java
+++ b/server/tests/src/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java
@@ -2322,8 +2322,13 @@ public class SQLContainerTest {
container.getContainerProperty(container.getIdByIndex(3),
"NAME").getValue());
- Assert.assertNull(container.getIdByIndex(4));
- Assert.assertNull(container.nextItemId(container.getIdByIndex(3)));
+ try {
+ container.getIdByIndex(4);
+ Assert.fail("SQLContainer.getIdByIndex() returned a value for an index beyond the end of the container");
+ } catch (IndexOutOfBoundsException e) {
+ // should throw exception - item is filtered out
+ }
+ container.nextItemId(container.getIdByIndex(3));
Assert.assertFalse(container.containsId(id2));
Assert.assertFalse(container.getItemIds().contains(id2));