]> source.dussan.org Git - vaadin-framework.git/commitdiff
Moved test class to appropriate source folder (#12337)
authorHenrik Paul <henrik@vaadin.com>
Tue, 1 Oct 2013 07:27:12 +0000 (10:27 +0300)
committerVaadin Code Review <review@vaadin.com>
Tue, 1 Oct 2013 07:45:53 +0000 (07:45 +0000)
Change-Id: I01b25109a487bd0b9ff6a7903564ee5c867d6a33

server/tests/src/com/vaadin/tests/server/component/table/TableRemovedQuicklySendsInvalidRpcCalls.java [deleted file]
uitest/src/com/vaadin/tests/components/table/TableRemovedQuicklySendsInvalidRpcCalls.java [new file with mode: 0644]

diff --git a/server/tests/src/com/vaadin/tests/server/component/table/TableRemovedQuicklySendsInvalidRpcCalls.java b/server/tests/src/com/vaadin/tests/server/component/table/TableRemovedQuicklySendsInvalidRpcCalls.java
deleted file mode 100644 (file)
index b539e42..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright 2000-2013 Vaadin Ltd.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.vaadin.tests.server.component.table;
-
-import com.vaadin.annotations.Push;
-import com.vaadin.event.ItemClickEvent;
-import com.vaadin.event.ItemClickEvent.ItemClickListener;
-import com.vaadin.server.VaadinRequest;
-import com.vaadin.tests.components.AbstractTestUI;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Table;
-
-@Push
-public class TableRemovedQuicklySendsInvalidRpcCalls extends AbstractTestUI {
-
-    @Override
-    protected void setup(VaadinRequest request) {
-        addComponent(new Button("Blink a table", new Button.ClickListener() {
-            @Override
-            public void buttonClick(ClickEvent event) {
-                blinkTable();
-            }
-        }));
-    }
-
-    private void blinkTable() {
-        final Table table = new Table();
-        table.setPageLength(5);
-        table.addContainerProperty(new Object(), String.class, null);
-
-        for (int i = 0; i < 50; i++) {
-            table.addItem(new Object[] { "Row" }, new Object());
-        }
-
-        table.addItemClickListener(new ItemClickListener() {
-            private int i;
-
-            @Override
-            public void itemClick(ItemClickEvent event) {
-                /*
-                 * Ignore implementation. This is only an easy way to make the
-                 * client-side update table's variables (by furiously clicking
-                 * on the table row.
-                 * 
-                 * This way, we get variable changes queued. The push call will
-                 * then remove the Table, while the variable changes being still
-                 * in the queue, leading to the issue as described in the
-                 * ticket.
-                 */
-                System.out.println("clicky " + (++i));
-            }
-        });
-
-        System.out.println("adding component");
-        addComponent(table);
-
-        new Thread() {
-            @Override
-            public void run() {
-                getSession().lock();
-                try {
-                    Thread.sleep(500);
-                    access(new Runnable() {
-                        @Override
-                        public void run() {
-                            System.out.println("removing component");
-                            removeComponent(table);
-                        }
-                    });
-                } catch (InterruptedException e) {
-                    e.printStackTrace();
-                } finally {
-                    getSession().unlock();
-                }
-            };
-        }.start();
-    }
-
-    @Override
-    protected String getTestDescription() {
-        return "Adding and subsequently quickly removing a table "
-                + "should not leave any pending RPC calls waiting "
-                + "in a Timer. Issue can be reproduced by "
-                + "1) pressing the button 2) clicking furiously "
-                + "on a row in the table.";
-    }
-
-    @Override
-    protected Integer getTicketNumber() {
-        return 12337;
-    }
-}
diff --git a/uitest/src/com/vaadin/tests/components/table/TableRemovedQuicklySendsInvalidRpcCalls.java b/uitest/src/com/vaadin/tests/components/table/TableRemovedQuicklySendsInvalidRpcCalls.java
new file mode 100644 (file)
index 0000000..6e4b62e
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * Copyright 2000-2013 Vaadin Ltd.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.vaadin.tests.components.table;
+
+import com.vaadin.annotations.Push;
+import com.vaadin.event.ItemClickEvent;
+import com.vaadin.event.ItemClickEvent.ItemClickListener;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Table;
+
+@Push
+public class TableRemovedQuicklySendsInvalidRpcCalls extends AbstractTestUI {
+
+    @Override
+    protected void setup(VaadinRequest request) {
+        addComponent(new Button("Blink a table", new Button.ClickListener() {
+            @Override
+            public void buttonClick(ClickEvent event) {
+                blinkTable();
+            }
+        }));
+    }
+
+    private void blinkTable() {
+        final Table table = new Table();
+        table.setPageLength(5);
+        table.addContainerProperty(new Object(), String.class, null);
+
+        for (int i = 0; i < 50; i++) {
+            table.addItem(new Object[] { "Row" }, new Object());
+        }
+
+        table.addItemClickListener(new ItemClickListener() {
+            private int i;
+
+            @Override
+            public void itemClick(ItemClickEvent event) {
+                /*
+                 * Ignore implementation. This is only an easy way to make the
+                 * client-side update table's variables (by furiously clicking
+                 * on the table row.
+                 * 
+                 * This way, we get variable changes queued. The push call will
+                 * then remove the Table, while the variable changes being still
+                 * in the queue, leading to the issue as described in the
+                 * ticket.
+                 */
+                System.out.println("clicky " + (++i));
+            }
+        });
+
+        System.out.println("adding component");
+        addComponent(table);
+
+        new Thread() {
+            @Override
+            public void run() {
+                getSession().lock();
+                try {
+                    Thread.sleep(500);
+                    access(new Runnable() {
+                        @Override
+                        public void run() {
+                            System.out.println("removing component");
+                            removeComponent(table);
+                        }
+                    });
+                } catch (InterruptedException e) {
+                    e.printStackTrace();
+                } finally {
+                    getSession().unlock();
+                }
+            };
+        }.start();
+    }
+
+    @Override
+    protected String getTestDescription() {
+        return "Adding and subsequently quickly removing a table "
+                + "should not leave any pending RPC calls waiting "
+                + "in a Timer. Issue can be reproduced by "
+                + "1) pressing the button 2) clicking furiously "
+                + "on a row in the table.";
+    }
+
+    @Override
+    protected Integer getTicketNumber() {
+        return 12337;
+    }
+}