summaryrefslogtreecommitdiffstats
path: root/tests/server-side
diff options
context:
space:
mode:
authorMarc Englund <marc.englund@itmill.com>2012-04-24 14:06:11 +0000
committerMarc Englund <marc.englund@itmill.com>2012-04-24 14:06:11 +0000
commita6aaabefcc63b182287e04789c01b63baf90c243 (patch)
tree18c7bfb82b06c393fa34730055241ba268e5d1f5 /tests/server-side
parent032f760be4c0bb84ea35a3faabcac721a764a56f (diff)
downloadvaadin-framework-a6aaabefcc63b182287e04789c01b63baf90c243.tar.gz
vaadin-framework-a6aaabefcc63b182287e04789c01b63baf90c243.zip
Applied patch provided for #8600 (hasChildren() broken if item used to have children) and added junit test. Fixes #8600
svn changeset:23624/svn branch:6.8
Diffstat (limited to 'tests/server-side')
-rw-r--r--tests/server-side/com/vaadin/tests/server/component/tree/TestHasChildren.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/server-side/com/vaadin/tests/server/component/tree/TestHasChildren.java b/tests/server-side/com/vaadin/tests/server/component/tree/TestHasChildren.java
new file mode 100644
index 0000000000..66535d3ffb
--- /dev/null
+++ b/tests/server-side/com/vaadin/tests/server/component/tree/TestHasChildren.java
@@ -0,0 +1,25 @@
+package com.vaadin.tests.server.component.tree;
+
+import junit.framework.TestCase;
+
+import com.vaadin.ui.Tree;
+
+public class TestHasChildren extends TestCase {
+
+ private Tree tree;
+
+ @Override
+ protected void setUp() {
+ tree = new Tree();
+ tree.addItem("parent");
+ tree.addItem("child");
+ tree.setChildrenAllowed("parent", true);
+ tree.setParent("child", "parent");
+ }
+
+ public void testRemoveChildren() {
+ assertTrue(tree.hasChildren("parent"));
+ tree.removeItem("child");
+ assertFalse(tree.hasChildren("parent"));
+ }
+}