diff options
author | Marc Englund <marc.englund@itmill.com> | 2012-04-24 14:06:11 +0000 |
---|---|---|
committer | Marc Englund <marc.englund@itmill.com> | 2012-04-24 14:06:11 +0000 |
commit | a6aaabefcc63b182287e04789c01b63baf90c243 (patch) | |
tree | 18c7bfb82b06c393fa34730055241ba268e5d1f5 /tests/server-side | |
parent | 032f760be4c0bb84ea35a3faabcac721a764a56f (diff) | |
download | vaadin-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.java | 25 |
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")); + } +} |