]> source.dussan.org Git - vaadin-framework.git/commitdiff
Testbench test for #7626
authorJohn Alhroos <john.ahlroos@itmill.com>
Fri, 23 Sep 2011 08:35:29 +0000 (08:35 +0000)
committerJohn Alhroos <john.ahlroos@itmill.com>
Fri, 23 Sep 2011 08:35:29 +0000 (08:35 +0000)
svn changeset:21263/svn branch:6.7

tests/src/com/vaadin/tests/components/form/FormClearDatasourceRepaint.html [new file with mode: 0644]
tests/src/com/vaadin/tests/components/form/FormClearDatasourceRepaint.java [new file with mode: 0644]

diff --git a/tests/src/com/vaadin/tests/components/form/FormClearDatasourceRepaint.html b/tests/src/com/vaadin/tests/components/form/FormClearDatasourceRepaint.html
new file mode 100644 (file)
index 0000000..200ddb5
--- /dev/null
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+       <td>open</td>
+       <td>/run/com.vaadin.tests.components.form.FormClearDatasourceRepaint?restartApplication</td>
+       <td></td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>vaadin=runcomvaadintestscomponentsformFormClearDatasourceRepaint::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+       <td></td>
+</tr>
+<tr>
+       <td>screenCapture</td>
+       <td></td>
+       <td>Form0height</td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>vaadin=runcomvaadintestscomponentsformFormClearDatasourceRepaint::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+       <td></td>
+</tr>
+<tr>
+       <td>screenCapture</td>
+       <td></td>
+       <td>FormAutoHeight</td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>vaadin=runcomvaadintestscomponentsformFormClearDatasourceRepaint::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+       <td></td>
+</tr>
+<tr>
+       <td>screenCapture</td>
+       <td></td>
+       <td>Form0height</td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>vaadin=runcomvaadintestscomponentsformFormClearDatasourceRepaint::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+       <td></td>
+</tr>
+<tr>
+       <td>screenCapture</td>
+       <td></td>
+       <td>FormAutoHeight</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/src/com/vaadin/tests/components/form/FormClearDatasourceRepaint.java b/tests/src/com/vaadin/tests/components/form/FormClearDatasourceRepaint.java
new file mode 100644 (file)
index 0000000..39305d5
--- /dev/null
@@ -0,0 +1,71 @@
+package com.vaadin.tests.components.form;
+
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Form;
+
+public class FormClearDatasourceRepaint extends TestBase {
+
+    public static class MyBean {
+
+        private String value;
+
+        public String getValue() {
+            return value;
+        }
+
+        public void setValue(String value) {
+            this.value = value;
+        }
+    }
+
+    public static class MySecondBean extends MyBean {
+
+        private String value2;
+
+        public String getValue2() {
+            return value2;
+        }
+
+        public void setValue2(String value) {
+            this.value2 = value;
+        }
+    }
+
+    @Override
+    protected void setup() {
+
+
+        final Form form = new Form();
+        form.setItemDataSource(new BeanItem<MySecondBean>(new MySecondBean()));
+        addComponent(form);
+
+        addComponent(new Button("Clear datasource", new Button.ClickListener() {
+            public void buttonClick(ClickEvent event) {
+                form.setItemDataSource(null);
+            }
+        }));
+
+        addComponent(new Button("Change data source",
+                new Button.ClickListener() {
+            public void buttonClick(ClickEvent event) {
+                        form.setItemDataSource(new BeanItem<MyBean>(
+                                new MyBean()));
+            }
+                }));
+
+    }
+
+    @Override
+    protected String getDescription() {
+        return "The form should adjust its size when clearing and setting data sources";
+    }
+
+    @Override
+    protected Integer getTicketNumber() {
+        return 7626;
+    }
+
+}