diff options
author | John Ahlroos <john@vaadin.com> | 2012-11-05 11:41:37 +0000 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2012-11-05 11:41:37 +0000 |
commit | d81badda926921ecead349a89222080016fee0e9 (patch) | |
tree | 85f17537ba0564391e5074b283cbd6a86aa8372b /uitest/src | |
parent | 57fd06617af154b7e01f5ec79fad86e662908bdf (diff) | |
parent | d432aa8fd8b4a357947bbb988f5bd6bc98e43f77 (diff) | |
download | vaadin-framework-d81badda926921ecead349a89222080016fee0e9.tar.gz vaadin-framework-d81badda926921ecead349a89222080016fee0e9.zip |
Merge "Properly detach removed connectors (#9815)"
Diffstat (limited to 'uitest/src')
2 files changed, 93 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/HierarchyChangeForRemovedComponentContainers.html b/uitest/src/com/vaadin/tests/components/HierarchyChangeForRemovedComponentContainers.html new file mode 100644 index 0000000000..49b02d3f01 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/HierarchyChangeForRemovedComponentContainers.html @@ -0,0 +1,32 @@ +<?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="http://localhost:8888/" /> +<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.HierarchyChangeForRemovedComponentContainers?restartApplication</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsHierarchyChangeForRemovedComponentContainers::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>two-buttons-no-NPE</td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/components/HierarchyChangeForRemovedComponentContainers.java b/uitest/src/com/vaadin/tests/components/HierarchyChangeForRemovedComponentContainers.java new file mode 100644 index 0000000000..db6ff9f537 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/HierarchyChangeForRemovedComponentContainers.java @@ -0,0 +1,61 @@ +package com.vaadin.tests.components; + +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.HorizontalLayout; +import com.vaadin.ui.VerticalLayout; + +public class HierarchyChangeForRemovedComponentContainers extends TestBase { + + + private HorizontalLayout mainContent; + private VerticalLayout lo2; + + @Override + protected void setup() { + + mainContent = new HorizontalLayout(); + mainContent.setSizeFull(); + + lo2 = new VerticalLayout(); + Button button1 = new Button("asdasd1"); + button1.setHeight("90%"); + Button button2 = new Button("asdasd2"); + button2.setHeight("90%"); + lo2.addComponent(button1); + lo2.addComponent(button2); + + compose(); + + addComponent(new Button("Replace layout with button", + new Button.ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + compose2(); + } + })); + } + + private void compose() { + getLayout().removeAllComponents(); + getLayout().addComponent(mainContent); + mainContent.addComponent(lo2); + System.out.println("composed"); + } + + private void compose2() { + getLayout().removeAllComponents(); + getLayout().addComponent(lo2); + } + + @Override + protected String getDescription() { + return "HierarchyChange events should be triggered for removed layouts"; + } + + @Override + protected Integer getTicketNumber() { + return 9815; + } + +} |