aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorHenri Sara <henri.sara@itmill.com>2011-11-24 11:38:37 +0000
committerHenri Sara <henri.sara@itmill.com>2011-11-24 11:38:37 +0000
commit2b7369f3b488587e76952cc4c2efc38d440ce980 (patch)
tree68ed55fc0991cb6026d4d43a84f92e3b196a57fd /tests
parent08e8d3b94008b037102f0ed7e6c257eff9d6cb4c (diff)
downloadvaadin-framework-2b7369f3b488587e76952cc4c2efc38d440ce980.tar.gz
vaadin-framework-2b7369f3b488587e76952cc4c2efc38d440ce980.zip
#7988 no partial refresh for an item that is not in the buffer, improved test
svn changeset:22120/svn branch:6.7
Diffstat (limited to 'tests')
-rw-r--r--tests/testbench/com/vaadin/tests/components/treetable/ProgrammaticCollapse.html64
-rw-r--r--tests/testbench/com/vaadin/tests/components/treetable/ProgrammaticCollapse.java40
2 files changed, 97 insertions, 7 deletions
diff --git a/tests/testbench/com/vaadin/tests/components/treetable/ProgrammaticCollapse.html b/tests/testbench/com/vaadin/tests/components/treetable/ProgrammaticCollapse.html
index a9eb80e4d8..44dd858378 100644
--- a/tests/testbench/com/vaadin/tests/components/treetable/ProgrammaticCollapse.html
+++ b/tests/testbench/com/vaadin/tests/components/treetable/ProgrammaticCollapse.html
@@ -18,7 +18,7 @@
</tr>
<tr>
<td>click</td>
- <td>vaadin=runcomvaadintestscomponentstreetableProgrammaticCollapse::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstreetableProgrammaticCollapse::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
<td></td>
</tr>
<tr>
@@ -33,7 +33,7 @@
</tr>
<tr>
<td>click</td>
- <td>vaadin=runcomvaadintestscomponentstreetableProgrammaticCollapse::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstreetableProgrammaticCollapse::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
<td></td>
</tr>
<tr>
@@ -46,6 +46,66 @@
<td>//body/div[2]</td>
<td>0,0</td>
</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentstreetableProgrammaticCollapse::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>closeNotification</td>
+ <td>//body/div[2]</td>
+ <td>0,0</td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>lastexpanded</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentstreetableProgrammaticCollapse::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>closeNotification</td>
+ <td>//body/div[2]</td>
+ <td>0,0</td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>lastcollapsed</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentstreetableProgrammaticCollapse::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>closeNotification</td>
+ <td>//body/div[2]</td>
+ <td>0,0</td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>manyexpanded</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentstreetableProgrammaticCollapse::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>closeNotification</td>
+ <td>//body/div[2]</td>
+ <td>0,0</td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>manycollapsed</td>
+</tr>
</tbody></table>
</body>
diff --git a/tests/testbench/com/vaadin/tests/components/treetable/ProgrammaticCollapse.java b/tests/testbench/com/vaadin/tests/components/treetable/ProgrammaticCollapse.java
index f37e5c5888..6f2e507ce3 100644
--- a/tests/testbench/com/vaadin/tests/components/treetable/ProgrammaticCollapse.java
+++ b/tests/testbench/com/vaadin/tests/components/treetable/ProgrammaticCollapse.java
@@ -4,20 +4,28 @@ 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.HorizontalLayout;
import com.vaadin.ui.TreeTable;
+import com.vaadin.ui.VerticalLayout;
public class ProgrammaticCollapse extends TestBase {
@Override
protected void setup() {
- HorizontalLayout layout = new HorizontalLayout();
+ VerticalLayout layout = new VerticalLayout();
final TreeTable table = new TreeTable();
+ table.setPageLength(10);
table.addContainerProperty("A", String.class, null);
table.addContainerProperty("B", String.class, null);
- table.addItem(new Object[] { "A1", "B1" }, 1);
- table.addItem(new Object[] { "A2", "B2" }, 2);
- table.setParent(2, 1);
+ for (int i = 1; i <= 100; ++i) {
+ int parentid = i;
+ table.addItem(new Object[] { "A" + i, "B" + i }, parentid);
+ for (int j = 1; j < 5; ++j) {
+ int id = 1000 * i + j;
+ table.addItem(new Object[] { "A" + i + "." + j,
+ "B" + i + "." + j }, id);
+ table.setParent(id, parentid);
+ }
+ }
layout.addComponent(table);
layout.addComponent(new Button("Expand / Collapse",
new ClickListener() {
@@ -28,6 +36,28 @@ public class ProgrammaticCollapse extends TestBase {
table.setCollapsed(1, collapsed);
}
}));
+ layout.addComponent(new Button("Expand / Collapse last",
+ new ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ boolean collapsed = !table.isCollapsed(100);
+ table.getWindow().showNotification(
+ "set collapsed: " + collapsed);
+ table.setCollapsed(100, collapsed);
+ }
+ }));
+ layout.addComponent(new Button("Expand / Collapse multiple",
+ new ClickListener() {
+ private boolean collapsed = true;
+
+ public void buttonClick(ClickEvent event) {
+ collapsed = !collapsed;
+ table.getWindow().showNotification(
+ "set collapsed: " + collapsed);
+ for (int i = 0; i < 50; ++i) {
+ table.setCollapsed(i * 2, collapsed);
+ }
+ }
+ }));
addComponent(layout);
}