summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2011-11-17 11:41:44 +0000
committerArtur Signell <artur.signell@itmill.com>2011-11-17 11:41:44 +0000
commit664cd522e5a3d1de400eec94f5f584a4b93767ef (patch)
tree5047333b0a71a46f22fe3ce81562d12bfd59d3bb /tests
parent2a53dd7204e254eaacc7f33abb21224cb7211584 (diff)
downloadvaadin-framework-664cd522e5a3d1de400eec94f5f584a4b93767ef.tar.gz
vaadin-framework-664cd522e5a3d1de400eec94f5f584a4b93767ef.zip
Test for #7950 and #7949
svn changeset:22032/svn branch:6.7
Diffstat (limited to 'tests')
-rw-r--r--tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSlow.java55
1 files changed, 55 insertions, 0 deletions
diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSlow.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSlow.java
new file mode 100644
index 0000000000..15742cc783
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSlow.java
@@ -0,0 +1,55 @@
+package com.vaadin.tests.components.combobox;
+
+import java.util.Map;
+
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.Log;
+import com.vaadin.ui.ComboBox;
+
+public class ComboBoxSlow extends TestBase {
+
+ private Log log = new Log(5);
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 7949;
+ }
+
+ @Override
+ protected String getDescription() {
+ return "The ComboBox artificially introduces a server delay to more easily spot problems";
+ }
+
+ public class SlowComboBox extends ComboBox {
+ @Override
+ public void changeVariables(Object source, Map<String, Object> variables) {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ super.changeVariables(source, variables);
+ }
+ }
+
+ @Override
+ protected void setup() {
+ addComponent(log);
+ final SlowComboBox cb = new SlowComboBox();
+ cb.setImmediate(true);
+ for (int i = 0; i <= 1000; i++) {
+ cb.addItem("Item " + i);
+ }
+ cb.addListener(new ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ log.log("Value changed to " + cb.getValue());
+
+ }
+ });
+ addComponent(cb);
+ }
+}