diff options
author | Leif Åstrand <leif@vaadin.com> | 2013-05-07 13:06:34 +0000 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2013-05-10 14:22:27 +0000 |
commit | 55ea6dce33bec44140984633a6d3aee7910b89da (patch) | |
tree | 77701ce3368c8704ff8303cbcfaa0117abdb0e88 /tests/testbench | |
parent | 19e27a15ca765de477fbe929a1cb6a7412c523f7 (diff) | |
download | vaadin-framework-55ea6dce33bec44140984633a6d3aee7910b89da.tar.gz vaadin-framework-55ea6dce33bec44140984633a6d3aee7910b89da.zip |
More specific workaround for no rows in TreeTable with pagelenght = 0 (#9203)
svn changeset:25915/svn branch:6.8
Conflicts:
client/src/com/vaadin/client/ui/VScrollTable.java
Change-Id: I3f5b9dc988f5911023f77f184f5bd6770bbd9f1b
Diffstat (limited to 'tests/testbench')
-rw-r--r-- | tests/testbench/com/vaadin/tests/components/treetable/RowHeightWithoutRows.html | 47 | ||||
-rw-r--r-- | tests/testbench/com/vaadin/tests/components/treetable/RowHeightWithoutRows.java | 87 |
2 files changed, 134 insertions, 0 deletions
diff --git a/tests/testbench/com/vaadin/tests/components/treetable/RowHeightWithoutRows.html b/tests/testbench/com/vaadin/tests/components/treetable/RowHeightWithoutRows.html new file mode 100644 index 0000000000..e8cb0ccfe6 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/treetable/RowHeightWithoutRows.html @@ -0,0 +1,47 @@ +<?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.treetable.RowHeightWithoutRows?restartApplication=</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>two</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentstreetableRowHeightWithoutRows::/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>empty</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentstreetableRowHeightWithoutRows::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>five</td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/tests/testbench/com/vaadin/tests/components/treetable/RowHeightWithoutRows.java b/tests/testbench/com/vaadin/tests/components/treetable/RowHeightWithoutRows.java new file mode 100644 index 0000000000..5e94fc1270 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/treetable/RowHeightWithoutRows.java @@ -0,0 +1,87 @@ +package com.vaadin.tests.components.treetable; + +import com.vaadin.data.util.BeanItemContainer; +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; +import com.vaadin.ui.TreeTable; + +public class RowHeightWithoutRows extends TestBase { + + private TreeTable treeTable = new TreeTable(); + + private BeanItemContainer<User> container = new BeanItemContainer<User>( + User.class); + + @Override + public void setup() { + treeTable.setContainerDataSource(container); + treeTable.setPageLength(0); + + addComponent(treeTable); + + Button refresh = new Button("Add two elements"); + addComponent(refresh); + refresh.addListener(new ClickListener() { + public void buttonClick(ClickEvent event) { + addTwoElements(); + } + }); + + Button reset = new Button("Reset"); + addComponent(reset); + reset.addListener(new ClickListener() { + public void buttonClick(ClickEvent event) { + container.removeAllItems(); + } + }); + + Button refresh5 = new Button("Add five elements"); + addComponent(refresh5); + refresh5.addListener(new ClickListener() { + public void buttonClick(ClickEvent event) { + container.addBean(new User("John", "Doe")); + container.addBean(new User("Mark", "Twain")); + container.addBean(new User("M", "T")); + container.addBean(new User("J", "D")); + container.addBean(new User("J", "T")); + } + }); + addTwoElements(); + } + + private void addTwoElements() { + container.addBean(new User("John", "Doe")); + container.addBean(new User("Mark", "Twain")); + } + + public static class User { + private String firstName; + + private String lastName; + + public User(String firstName, String lastName) { + this.firstName = firstName; + this.lastName = lastName; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + } + + @Override + protected String getDescription() { + return "Reseting the tree table and then adding five elements should properly update the height of the TreeTable"; + } + + @Override + protected Integer getTicketNumber() { + return Integer.valueOf(9203); + } +}
\ No newline at end of file |