From a6e0d4d7ea1e47a2ced9cb2278e2944e8bbcbe16 Mon Sep 17 00:00:00 2001 From: Automerge Date: Fri, 30 Mar 2012 13:24:34 +0000 Subject: [PATCH] [merge from 6.7] #8580 test case svn changeset:23372/svn branch:6.8 --- .../MultiClickingItemThatDetachesTable.java | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 tests/testbench/com/vaadin/tests/components/table/MultiClickingItemThatDetachesTable.java 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; + } + +} -- 2.39.5