From 9870992a7676b1589cb66e9a8de1d345e09544e2 Mon Sep 17 00:00:00 2001 From: John Alhroos Date: Fri, 23 Sep 2011 08:35:29 +0000 Subject: [PATCH] Testbench test for #7626 svn changeset:21263/svn branch:6.7 --- .../form/FormClearDatasourceRepaint.html | 62 ++++++++++++++++ .../form/FormClearDatasourceRepaint.java | 71 +++++++++++++++++++ 2 files changed, 133 insertions(+) create mode 100644 tests/src/com/vaadin/tests/components/form/FormClearDatasourceRepaint.html create mode 100644 tests/src/com/vaadin/tests/components/form/FormClearDatasourceRepaint.java 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 index 0000000000..200ddb547d --- /dev/null +++ b/tests/src/com/vaadin/tests/components/form/FormClearDatasourceRepaint.html @@ -0,0 +1,62 @@ + + + + + + +New Test + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
New Test
open/run/com.vaadin.tests.components.form.FormClearDatasourceRepaint?restartApplication
clickvaadin=runcomvaadintestscomponentsformFormClearDatasourceRepaint::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]
screenCaptureForm0height
clickvaadin=runcomvaadintestscomponentsformFormClearDatasourceRepaint::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]
screenCaptureFormAutoHeight
clickvaadin=runcomvaadintestscomponentsformFormClearDatasourceRepaint::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]
screenCaptureForm0height
clickvaadin=runcomvaadintestscomponentsformFormClearDatasourceRepaint::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]
screenCaptureFormAutoHeight
+ + 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 index 0000000000..39305d5638 --- /dev/null +++ b/tests/src/com/vaadin/tests/components/form/FormClearDatasourceRepaint.java @@ -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(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( + 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; + } + +} -- 2.39.5