summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorHenri Sara <henri.sara@itmill.com>2011-03-01 12:43:32 +0000
committerHenri Sara <henri.sara@itmill.com>2011-03-01 12:43:32 +0000
commitfca375e6b185a6758337c40276c8b7a5cdbbc7fc (patch)
tree9acaf3aaaf713f3695d655f16c49b535b7da5abf /tests
parentb6d0d54631a5455a7087d7b77d54fa377fd44ef2 (diff)
downloadvaadin-framework-fca375e6b185a6758337c40276c8b7a5cdbbc7fc.tar.gz
vaadin-framework-fca375e6b185a6758337c40276c8b7a5cdbbc7fc.zip
Containers JUnit test: assert result of removing items, test removing non-existing item
svn changeset:17529/svn branch:6.6
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/vaadin/tests/server/container/AbstractContainerTest.java18
1 files changed, 11 insertions, 7 deletions
diff --git a/tests/src/com/vaadin/tests/server/container/AbstractContainerTest.java b/tests/src/com/vaadin/tests/server/container/AbstractContainerTest.java
index 2b8dd1eecf..b6a2b765da 100644
--- a/tests/src/com/vaadin/tests/server/container/AbstractContainerTest.java
+++ b/tests/src/com/vaadin/tests/server/container/AbstractContainerTest.java
@@ -211,9 +211,13 @@ public abstract class AbstractContainerTest extends TestCase {
Assert.assertEquals(itemId,
container.getIdByIndex(itemPosition + 2));
- container.removeItem(addedId);
- container.removeItem(newFirstId);
- container.removeItem(newLastId);
+ Assert.assertTrue(container.removeItem(addedId));
+ Assert.assertTrue(container.removeItem(newFirstId));
+ Assert.assertTrue(container.removeItem(newLastId));
+
+ Assert.assertFalse(
+ "Removing non-existing item should indicate failure",
+ container.removeItem(addedId));
}
// addItemAt
@@ -224,7 +228,7 @@ public abstract class AbstractContainerTest extends TestCase {
Assert.assertEquals(newItemId, container.getIdByIndex(itemPosition));
Assert.assertEquals(itemId,
container.getIdByIndex(itemPosition + 1));
- container.removeItem(newItemId);
+ Assert.assertTrue(container.removeItem(newItemId));
Assert.assertFalse(container.containsId(newItemId));
container.addItemAt(0, newItemId);
@@ -234,7 +238,7 @@ public abstract class AbstractContainerTest extends TestCase {
Assert.assertEquals(newItemId, container.getIdByIndex(0));
Assert.assertEquals(itemId,
container.getIdByIndex(itemPosition + 1));
- container.removeItem(newItemId);
+ Assert.assertTrue(container.removeItem(newItemId));
Assert.assertFalse(container.containsId(newItemId));
container.addItemAt(container.size(), newItemId);
@@ -245,7 +249,7 @@ public abstract class AbstractContainerTest extends TestCase {
Assert.assertEquals(newItemId,
container.getIdByIndex(container.size() - 1));
Assert.assertEquals(itemId, container.getIdByIndex(itemPosition));
- container.removeItem(newItemId);
+ Assert.assertTrue(container.removeItem(newItemId));
Assert.assertFalse(container.containsId(newItemId));
}
}
@@ -335,7 +339,7 @@ public abstract class AbstractContainerTest extends TestCase {
}
protected void initializeContainer(Container container) {
- container.removeAllItems();
+ Assert.assertTrue(container.removeAllItems());
Object[] propertyIds = container.getContainerPropertyIds().toArray();
for (Object propertyId : propertyIds) {
container.removeContainerProperty(propertyId);