summaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/components/OutOfSync.java
diff options
context:
space:
mode:
Diffstat (limited to 'uitest/src/com/vaadin/tests/components/OutOfSync.java')
-rw-r--r--uitest/src/com/vaadin/tests/components/OutOfSync.java55
1 files changed, 55 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/OutOfSync.java b/uitest/src/com/vaadin/tests/components/OutOfSync.java
new file mode 100644
index 0000000000..8cefffc9d1
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/OutOfSync.java
@@ -0,0 +1,55 @@
+package com.vaadin.tests.components;
+
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Notification;
+
+public class OutOfSync extends AbstractTestUI {
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ Button b = new Button("Click me after 1s to be out of sync");
+ b.addClickListener(new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ Notification.show("This code will never be reached");
+ }
+ });
+ setContent(b);
+ Thread t = new Thread(new Runnable() {
+
+ @Override
+ public void run() {
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ // Remove button but prevent repaint -> causes out of sync
+ // issues
+ getSession().lock();
+ try {
+ setContent(null);
+ getConnectorTracker().markClean(OutOfSync.this);
+ } finally {
+ getSession().unlock();
+ }
+ }
+ });
+ t.start();
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Click the button after 1s when it has been removed server side (causing synchronization problems)";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 10780;
+ }
+
+}