]> source.dussan.org Git - vaadin-framework.git/commitdiff
test case
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Wed, 5 May 2010 09:15:02 +0000 (09:15 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Wed, 5 May 2010 09:15:02 +0000 (09:15 +0000)
svn changeset:13050/svn branch:6.3

tests/src/com/vaadin/tests/components/select/ComboBoxAddWhileFiltering.java [new file with mode: 0644]

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 (file)
index 0000000..e8ef599
--- /dev/null
@@ -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;
+    }
+
+}