From 77a4f28b7e59895946e6335fe43af3c72cd77796 Mon Sep 17 00:00:00 2001 From: Automerge Date: Wed, 14 Mar 2012 14:07:51 +0000 Subject: [PATCH] [merge from 6.7] Test for #7607 svn changeset:23243/svn branch:6.8 --- .../table/SetCurrentPageFirstItemId.html | 62 +++++++++++++++++++ .../table/SetCurrentPageFirstItemId.java | 55 ++++++++++++++++ 2 files changed, 117 insertions(+) create mode 100644 tests/testbench/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.html create mode 100644 tests/testbench/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.java diff --git a/tests/testbench/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.html b/tests/testbench/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.html new file mode 100644 index 0000000000..8881c0d2f5 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.html @@ -0,0 +1,62 @@ + + + + + + +SetCurrentPageFirstItemId + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SetCurrentPageFirstItemId
open/run/SetCurrentPageFirstItemId?restartApplication
clickvaadin=runSetCurrentPageFirstItemId::/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]
clickvaadin=runSetCurrentPageFirstItemId::/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]
clickvaadin=runSetCurrentPageFirstItemId::/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]
clickvaadin=runSetCurrentPageFirstItemId::/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]
clickvaadin=runSetCurrentPageFirstItemId::/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]
pause300
assertTextvaadin=runSetCurrentPageFirstItemId::/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[24]/domChild[0]/domChild[0]24
screenCapturescrolled-to-bottom
+ + diff --git a/tests/testbench/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.java b/tests/testbench/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.java new file mode 100644 index 0000000000..536348a393 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.java @@ -0,0 +1,55 @@ +package com.vaadin.tests.components.table; + +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.Table; +import com.vaadin.ui.VerticalLayout; + +public class SetCurrentPageFirstItemId extends TestBase { + int index = 0; + + private final Table table = new Table(); + + @Override + public void setup() { + + VerticalLayout mainLayout = new VerticalLayout(); + mainLayout.setHeight("100%"); + mainLayout.setMargin(true); + + getMainWindow().setContent(mainLayout); + + mainLayout.addComponent(table); + table.setSizeFull(); + table.addContainerProperty("rowID", Integer.class, null); + for (int i = 0; i < 20; i++) { + addRow(); + } + + Button addrowButton = new Button("Add row"); + addrowButton.addListener(new ClickListener() { + public void buttonClick(ClickEvent pEvent) { + Object id = addRow(); + table.setCurrentPageFirstItemId(id); + } + }); + + mainLayout.addComponent(addrowButton); + } + + private Object addRow() { + return table.addItem(new Object[] { index++ }, null); + } + + @Override + protected String getDescription() { + return "Table.setCurrentPageFirstItemId doesn't always work with full sized Table"; + } + + @Override + protected Integer getTicketNumber() { + return 7607; + } +} \ No newline at end of file -- 2.39.5