diff options
author | Matti Tahvonen <matti.tahvonen@itmill.com> | 2010-05-05 09:15:02 +0000 |
---|---|---|
committer | Matti Tahvonen <matti.tahvonen@itmill.com> | 2010-05-05 09:15:02 +0000 |
commit | 45eff918e160e8774db8c31156fe835e9817aaa0 (patch) | |
tree | 1935ede2258e3efb004ec6b273e4b3ffe019300b | |
parent | fa8491ebc2295a4081cd796b44332a148bacc4bc (diff) | |
download | vaadin-framework-45eff918e160e8774db8c31156fe835e9817aaa0.tar.gz vaadin-framework-45eff918e160e8774db8c31156fe835e9817aaa0.zip |
test case
svn changeset:13050/svn branch:6.3
-rw-r--r-- | tests/src/com/vaadin/tests/components/select/ComboBoxAddWhileFiltering.java | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/tests/src/com/vaadin/tests/components/select/ComboBoxAddWhileFiltering.java b/tests/src/com/vaadin/tests/components/select/ComboBoxAddWhileFiltering.java new file mode 100644 index 0000000000..e8ef599e5e --- /dev/null +++ b/tests/src/com/vaadin/tests/components/select/ComboBoxAddWhileFiltering.java @@ -0,0 +1,56 @@ +package com.vaadin.tests.components.select; + +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.ComboBox; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; + +/** + * TODO can't reproduce the issue with this test case, possibly need some + * enhancements. + * + */ +public class ComboBoxAddWhileFiltering extends TestBase { + + private int i; + + @Override + protected void setup() { + final ComboBox comboBox = new ComboBox(); + populate(comboBox); + + Button b = new Button("add item (^N)"); + b.addListener(new ClickListener() { + public void buttonClick(ClickEvent event) { + addItem(comboBox); + } + }); + addComponent(b); + addComponent(comboBox); + getMainWindow().addAction(new Button.ClickShortcut(b, "^n")); + } + + private void populate(ComboBox comboBox) { + for (i = 0; i < 4;) { + addItem(comboBox); + } + } + + private void addItem(ComboBox comboBox) { + i++; + comboBox.addItem("Item " + i); + + } + + @Override + protected String getDescription() { + return "Filtered list should be updated when new item is added."; + } + + @Override + protected Integer getTicketNumber() { + return 3643; + } + +} |