From: Artur Signell Date: Fri, 26 Aug 2011 05:45:28 +0000 (+0000) Subject: Test for #7481. Seems impossible to create a TestBench test for it as the problem... X-Git-Tag: 6.7.0.rc1~124 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1acfa477d498253ba37f7f9a1f7486410805c38b;p=vaadin-framework.git Test for #7481. Seems impossible to create a TestBench test for it as the problem lies in the order of events svn changeset:20668/svn branch:6.7 --- diff --git a/tests/src/com/vaadin/tests/components/combobox/ComboBoxTextFieldEventOrder.java b/tests/src/com/vaadin/tests/components/combobox/ComboBoxTextFieldEventOrder.java new file mode 100644 index 0000000000..31979a6a90 --- /dev/null +++ b/tests/src/com/vaadin/tests/components/combobox/ComboBoxTextFieldEventOrder.java @@ -0,0 +1,38 @@ +package com.vaadin.tests.components.combobox; +import java.util.Arrays; + +import com.vaadin.data.Property.ValueChangeEvent; +import com.vaadin.data.Property.ValueChangeListener; +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Select; +import com.vaadin.ui.TextField; + +public class ComboBoxTextFieldEventOrder extends TestBase { + + @Override + protected void setup() { + TextField textField = new TextField("text field"); + textField.setImmediate(true); + final Select select = new Select("select", Arrays.asList("1", "2", "3", + "4")); + textField.addListener(new ValueChangeListener() { + public void valueChange(ValueChangeEvent event) { + select.addItem(Long.valueOf(select.size() + 1).toString()); // or + // just + // select.requestRepaint(); + } + }); + addComponent(textField); + addComponent(select); + } + + @Override + protected String getDescription() { + return "Entering a text in a TextField and then clicking on the button in a ComboBox should cause the TextField value change to be sent first and the ComboBox filtering afterwards. Failure to do so will cause errors if the value change listener modifies the ComboBox"; + } + + @Override + protected Integer getTicketNumber() { + return 7481; + } +}