diff options
author | Automerge <automerge@vaadin.com> | 2012-03-30 13:24:34 +0000 |
---|---|---|
committer | Automerge <automerge@vaadin.com> | 2012-03-30 13:24:34 +0000 |
commit | a6e0d4d7ea1e47a2ced9cb2278e2944e8bbcbe16 (patch) | |
tree | b623c7aca0a336a091b24d929acdc4c68bed3625 | |
parent | a3ab33f6d154a794c0940d49619a2b95b39bf006 (diff) | |
download | vaadin-framework-a6e0d4d7ea1e47a2ced9cb2278e2944e8bbcbe16.tar.gz vaadin-framework-a6e0d4d7ea1e47a2ced9cb2278e2944e8bbcbe16.zip |
[merge from 6.7] #8580 test case
svn changeset:23372/svn branch:6.8
-rw-r--r-- | tests/testbench/com/vaadin/tests/components/table/MultiClickingItemThatDetachesTable.java | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/testbench/com/vaadin/tests/components/table/MultiClickingItemThatDetachesTable.java b/tests/testbench/com/vaadin/tests/components/table/MultiClickingItemThatDetachesTable.java new file mode 100644 index 0000000000..d437ab7a04 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/table/MultiClickingItemThatDetachesTable.java @@ -0,0 +1,49 @@ +package com.vaadin.tests.components.table; + +import com.vaadin.data.Item; +import com.vaadin.event.ItemClickEvent; +import com.vaadin.event.ItemClickEvent.ItemClickListener; +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Label; +import com.vaadin.ui.Table; + +@SuppressWarnings("serial") +public class MultiClickingItemThatDetachesTable extends TestBase { + @Override + public void setup() { + final Table table = new Table(); + table.setImmediate(true); + table.addContainerProperty("p1", String.class, "p1"); + table.addContainerProperty("p2", String.class, "p2"); + for (int i = 0; i < 200; ++i) { + final Item item = table.getItem(table.addItem()); + item.getItemProperty("p2").setValue(i + ""); + item.getItemProperty("p1").setValue(i + ""); + } + table.addListener(new ItemClickListener() { + public void itemClick(ItemClickEvent event) { + if (event.isDoubleClick()) { + try { + // Wait a bit so there's time to click multiple times + Thread.sleep(3000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + replaceComponent(table, new Label("Completed!")); + } + } + }); + addComponent(table); + } + + @Override + protected String getDescription() { + return "Clicking multiple times on an item whose listener detaches the table causes Out of Sync"; + } + + @Override + protected Integer getTicketNumber() { + return 8580; + } + +} |