From 45eff918e160e8774db8c31156fe835e9817aaa0 Mon Sep 17 00:00:00 2001 From: Matti Tahvonen Date: Wed, 5 May 2010 09:15:02 +0000 Subject: [PATCH] test case svn changeset:13050/svn branch:6.3 --- .../select/ComboBoxAddWhileFiltering.java | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 tests/src/com/vaadin/tests/components/select/ComboBoxAddWhileFiltering.java 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; + } + +} -- 2.39.5