summaryrefslogtreecommitdiffstats
path: root/tests/src
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2010-02-23 08:37:36 +0000
committerArtur Signell <artur.signell@itmill.com>2010-02-23 08:37:36 +0000
commit73ecd7f2a42e09868e4fd9c91073867c809836a2 (patch)
tree4a6bc7dd7a8c2bde9153ce93959f2a62b0edf6f2 /tests/src
parentc11f26fc7899639c019fba5b41c71f46e7399566 (diff)
downloadvaadin-framework-73ecd7f2a42e09868e4fd9c91073867c809836a2.tar.gz
vaadin-framework-73ecd7f2a42e09868e4fd9c91073867c809836a2.zip
Added test for ContainerHierarchicalWrapper
svn changeset:11481/svn branch:6.3
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/com/vaadin/tests/server/container/AbstractContainerTest.java2
-rw-r--r--tests/src/com/vaadin/tests/server/container/AbstractHierarchicalContainerTest.java24
-rw-r--r--tests/src/com/vaadin/tests/server/container/TestContainerHierarchicalWrapper.java19
3 files changed, 25 insertions, 20 deletions
diff --git a/tests/src/com/vaadin/tests/server/container/AbstractContainerTest.java b/tests/src/com/vaadin/tests/server/container/AbstractContainerTest.java
index 1fad034fd1..f56a788486 100644
--- a/tests/src/com/vaadin/tests/server/container/AbstractContainerTest.java
+++ b/tests/src/com/vaadin/tests/server/container/AbstractContainerTest.java
@@ -85,7 +85,7 @@ public abstract class AbstractContainerTest extends TestCase {
protected static final Object PROP2 = "PROP2";
protected static final Object PROP3 = "PROP3";
- protected void testBasicContainerOperations(Container.Filterable container) {
+ protected void testBasicContainerOperations(Container container) {
initializeContainer(container);
// Basic container
diff --git a/tests/src/com/vaadin/tests/server/container/AbstractHierarchicalContainerTest.java b/tests/src/com/vaadin/tests/server/container/AbstractHierarchicalContainerTest.java
index d1386aa9b4..12037259fd 100644
--- a/tests/src/com/vaadin/tests/server/container/AbstractHierarchicalContainerTest.java
+++ b/tests/src/com/vaadin/tests/server/container/AbstractHierarchicalContainerTest.java
@@ -8,6 +8,7 @@ import com.vaadin.data.Container.Hierarchical;
import com.vaadin.data.Container.Sortable;
public class AbstractHierarchicalContainerTest extends AbstractContainerTest {
+
private void validateHierarchicalContainer(Hierarchical container,
Object expectedFirstItemId, Object expectedLastItemId,
Object itemIdInSet, Object itemIdNotInSet, int expectedSize,
@@ -44,19 +45,19 @@ public class AbstractHierarchicalContainerTest extends AbstractContainerTest {
}
}
- // isRoot should return false for unknown items (#4215)
+ // isRoot should return false for unknown items
assertFalse(container.isRoot(itemIdNotInSet));
// hasChildren should return false for unknown items
assertFalse(container.hasChildren(itemIdNotInSet));
- // areChildrenAllowed should return false for unknown items (#4216)
+ // areChildrenAllowed should return false for unknown items
assertFalse(container.areChildrenAllowed(itemIdNotInSet));
// removeItem of unknown items should return false
assertFalse(container.removeItem(itemIdNotInSet));
- assertEquals(countNodes(container), expectedSize);
+ assertEquals(expectedSize, countNodes(container));
validateHierarchy(container);
}
@@ -158,8 +159,7 @@ public class AbstractHierarchicalContainerTest extends AbstractContainerTest {
validateHierarchicalContainer(container,
"com.vaadin.data.BufferedValidatable",
"com.vaadin.ui.TabSheet",
- "com.vaadin.terminal.gwt.client.Focusable",
- "com.vaadin.data.Buffered", 20, 0);
+ "com.vaadin.terminal.gwt.client.Focusable", "blah", 20, 0);
// filter out every second item except hierarchy items
filterable.removeAllContainerFilters();
@@ -179,20 +179,6 @@ public class AbstractHierarchicalContainerTest extends AbstractContainerTest {
"com.vaadin.data.util.IndexedContainer",
"com.vaadin.terminal.gwt.client.ui.VUriFragmentUtility",
packages + other, 0);
- //
- // int packages = 21;
- // validateHierarchicalContainer(container, "com",
- // "com.vaadin.util.SerializerHelper",
- // "com.vaadin.terminal.ApplicationResource", "blah",
- // sampleData.length + packages, 1);
- //
- // sortable.sort(new Object[] { PROP2 }, new boolean[] { true });
- //
- // validateHierarchicalContainer(container,
- // "com.vaadin.terminal.gwt.server.ApplicationPortlet2",
- // "com.vaadin.data.util.ObjectProperty",
- // "com.vaadin.terminal.ApplicationResource", "blah",
- // sampleData.length + packages, 1);
}
diff --git a/tests/src/com/vaadin/tests/server/container/TestContainerHierarchicalWrapper.java b/tests/src/com/vaadin/tests/server/container/TestContainerHierarchicalWrapper.java
new file mode 100644
index 0000000000..0ac5e76c64
--- /dev/null
+++ b/tests/src/com/vaadin/tests/server/container/TestContainerHierarchicalWrapper.java
@@ -0,0 +1,19 @@
+package com.vaadin.tests.server.container;
+
+import com.vaadin.data.util.ContainerHierarchicalWrapper;
+import com.vaadin.data.util.IndexedContainer;
+
+public class TestContainerHierarchicalWrapper extends
+ AbstractHierarchicalContainerTest {
+
+ public void testBasicOperations() {
+ testBasicContainerOperations(new ContainerHierarchicalWrapper(
+ new IndexedContainer()));
+ }
+
+ public void testHierarchicalContainer() {
+ testHierarchicalContainer(new ContainerHierarchicalWrapper(
+ new IndexedContainer()));
+ }
+
+}