From 7a111fc541dcc507032cdad6799b477df6d4833f Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Wed, 23 Jan 2013 13:14:18 +0200 Subject: Merge of (#6160) and (#10470) to Vaadin 7. Cache handling update. Change-Id: I81ba74d457eb484f6f2c350629534ab284ead7b7 --- .../components/table/EmptyRowsWhenScrolling.java | 275 +++++++++++++++++++++ .../treetable/EmptyingTreeTableTest.html | 52 ++++ .../treetable/TreeTableCacheOnPartialUpdate.html | 100 ++++---- .../treetable/TreeTableCacheOnPartialUpdates.java | 46 ++-- .../treetable/TreeTableInternalError.html | 61 +++++ .../treetable/TreeTableInternalError.java | 82 ++++++ 6 files changed, 550 insertions(+), 66 deletions(-) create mode 100644 uitest/src/com/vaadin/tests/components/table/EmptyRowsWhenScrolling.java create mode 100644 uitest/src/com/vaadin/tests/components/treetable/EmptyingTreeTableTest.html create mode 100644 uitest/src/com/vaadin/tests/components/treetable/TreeTableInternalError.html create mode 100644 uitest/src/com/vaadin/tests/components/treetable/TreeTableInternalError.java (limited to 'uitest') diff --git a/uitest/src/com/vaadin/tests/components/table/EmptyRowsWhenScrolling.java b/uitest/src/com/vaadin/tests/components/table/EmptyRowsWhenScrolling.java new file mode 100644 index 0000000000..c1ae9b4118 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/EmptyRowsWhenScrolling.java @@ -0,0 +1,275 @@ +package com.vaadin.tests.components.table; + +import java.util.Random; + +import com.vaadin.annotations.AutoGenerated; +import com.vaadin.data.util.BeanContainer; +import com.vaadin.event.ShortcutAction.KeyCode; +import com.vaadin.server.ClassResource; +import com.vaadin.server.Resource; +import com.vaadin.server.VaadinRequest; +import com.vaadin.ui.AbsoluteLayout; +import com.vaadin.ui.Alignment; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; +import com.vaadin.ui.CustomComponent; +import com.vaadin.ui.Embedded; +import com.vaadin.ui.HorizontalLayout; +import com.vaadin.ui.Notification; +import com.vaadin.ui.Table; +import com.vaadin.ui.Table.ColumnGenerator; +import com.vaadin.ui.UI; +import com.vaadin.ui.VerticalLayout; + +/** + * This test cannot be automated. http://dev.vaadin.com/ticket/6160, base code + * by user radosdesign. + * + * The test fails if even occasionally empty rows appear in the table. A + * relatively good way to get them (before the fix) is to wait for the page to + * load, move the scrollbar down, press 'R' before the rows have time to be + * rendered, and then move the scrollbar up when no rows have been rendered yet. + * After this, when you scroll down slowly there may be empty rows. This doesn't + * happen always, and you may need to force the threads slower to get it to + * happen at all. On a slow 32-bit Windows 7 with Chrome version 22.0.1229.94 m + * (no GWT dev mode) this test has managed to reproduce the problem maybe nine + * times out of ten. + * + * @author Anna Koskinen / Vaadin Oy + * + */ +public class EmptyRowsWhenScrolling extends UI { + + @Override + public void init(VaadinRequest request) { + getPage().setTitle("Simpletable Application"); + AppView appView = new AppView(this); + setContent(appView); + addAction(new Button.ClickShortcut(appView.getBtnRefreshTable(), + KeyCode.R)); + } + + private class AppView extends CustomComponent { + + @AutoGenerated + private AbsoluteLayout mainLayout; + @AutoGenerated + private VerticalLayout verticalLayout_1; + @AutoGenerated + private Table table; + @AutoGenerated + private HorizontalLayout horizontalLayout_1; + @AutoGenerated + private Button btnRefreshTable; + + /*- VaadinEditorProperties={"grid":"RegularGrid,20","showGrid":true,"snapToGrid":true,"snapToObject":true,"movingGuides":false,"snappingDistance":10} */ + + /*- VaadinEditorProperties={"grid":"RegularGrid,20","showGrid":true,"snapToGrid":true,"snapToObject":true,"movingGuides":false,"snappingDistance":10} */ + + /** + * The constructor should first build the main layout, set the + * composition root and then do any custom initialization. + * + * The constructor will not be automatically regenerated by the visual + * editor. + */ + public AppView(final UI application) { + buildMainLayout(); + setCompositionRoot(mainLayout); + + // Container with sample data + BeanContainer container = new BeanContainer( + SimpleBean.class); + container.setBeanIdProperty("id"); + for (int i = 1; i <= 50; ++i) { + container.addBean(new SimpleBean(i, "image", + "Column1 row " + i, "Column2 row " + i, "Column3 row " + + i, "Column4 row " + i)); + } + table.setContainerDataSource(container); + table.setEditable(true); + table.setColumnReorderingAllowed(true); + table.setVisibleColumns(new String[] { "image", "id", "col1", + "col2", "col3", "col4" }); + table.addGeneratedColumn("image", new ColumnGenerator() { + public Object generateCell(Table source, Object itemId, + Object columnId) { + int imgNum = new Random().nextInt(5) + 1; + try { + // Simulate background work + System.out + .println("Generated column for image /com/example/simpletable/img/px50-" + + imgNum + ".jpg"); + Thread.sleep(50); + } catch (InterruptedException e) { + e.printStackTrace(); + } + Resource resource = new ClassResource( + "/com/example/simpletable/img/px50-" + imgNum + + ".jpg"); + Embedded image = new Embedded("", resource); + image.setWidth("50px"); + image.setHeight("50px"); + image.addClickListener(new com.vaadin.event.MouseEvents.ClickListener() { + public void click( + com.vaadin.event.MouseEvents.ClickEvent event) { + Notification.show("Image clicked!"); + } + }); + return image; + } + }); + + // Refresh table button + getBtnRefreshTable().addClickListener(new ClickListener() { + public void buttonClick(ClickEvent event) { + table.refreshRowCache(); + } + }); + } + + @AutoGenerated + private AbsoluteLayout buildMainLayout() { + // common part: create layout + mainLayout = new AbsoluteLayout(); + mainLayout.setImmediate(false); + mainLayout.setWidth("100%"); + mainLayout.setHeight("100%"); + + // top-level component properties + setWidth("100.0%"); + setHeight("100.0%"); + + // verticalLayout_1 + verticalLayout_1 = buildVerticalLayout_1(); + mainLayout.addComponent(verticalLayout_1, "top:0.0px;left:0.0px;"); + + return mainLayout; + } + + @AutoGenerated + private VerticalLayout buildVerticalLayout_1() { + // common part: create layout + verticalLayout_1 = new VerticalLayout(); + verticalLayout_1.setImmediate(false); + verticalLayout_1.setWidth("100.0%"); + verticalLayout_1.setHeight("100.0%"); + verticalLayout_1.setMargin(false); + + // horizontalLayout_1 + horizontalLayout_1 = buildHorizontalLayout_1(); + verticalLayout_1.addComponent(horizontalLayout_1); + + // table_1 + table = new Table(); + table.setImmediate(false); + table.setWidth("100.0%"); + table.setHeight("100.0%"); + verticalLayout_1.addComponent(table); + verticalLayout_1.setExpandRatio(table, 1.0f); + + return verticalLayout_1; + } + + @AutoGenerated + private HorizontalLayout buildHorizontalLayout_1() { + // common part: create layout + horizontalLayout_1 = new HorizontalLayout(); + horizontalLayout_1.setImmediate(false); + horizontalLayout_1.setWidth("100.0%"); + horizontalLayout_1.setHeight("-1px"); + horizontalLayout_1.setMargin(false); + + // btnRefreshTable + setBtnRefreshTable(new Button()); + getBtnRefreshTable().setCaption("Reload table row cache"); + getBtnRefreshTable().setImmediate(false); + getBtnRefreshTable().setWidth("-1px"); + getBtnRefreshTable().setHeight("-1px"); + horizontalLayout_1.addComponent(getBtnRefreshTable()); + horizontalLayout_1.setComponentAlignment(getBtnRefreshTable(), + new Alignment(33)); + + return horizontalLayout_1; + } + + public Button getBtnRefreshTable() { + return btnRefreshTable; + } + + public void setBtnRefreshTable(Button btnRefreshTable) { + this.btnRefreshTable = btnRefreshTable; + } + + } + + protected class SimpleBean { + private int id; + private String image; + private String col1; + private String col2; + private String col3; + private String col4; + + public SimpleBean(int id, String image, String col1, String col2, + String col3, String col4) { + super(); + this.id = id; + this.image = image; + this.col1 = col1; + this.col2 = col2; + this.col3 = col3; + this.col4 = col4; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + + public String getCol1() { + return col1; + } + + public void setCol1(String col1) { + this.col1 = col1; + } + + public String getCol2() { + return col2; + } + + public void setCol2(String col2) { + this.col2 = col2; + } + + public String getCol3() { + return col3; + } + + public void setCol3(String col3) { + this.col3 = col3; + } + + public String getCol4() { + return col4; + } + + public void setCol4(String col4) { + this.col4 = col4; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + } + +} diff --git a/uitest/src/com/vaadin/tests/components/treetable/EmptyingTreeTableTest.html b/uitest/src/com/vaadin/tests/components/treetable/EmptyingTreeTableTest.html new file mode 100644 index 0000000000..0c43d41aca --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/treetable/EmptyingTreeTableTest.html @@ -0,0 +1,52 @@ + + + + + + +EmptyingTreeTableTest + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
EmptyingTreeTableTest
open/run/com.vaadin.tests.components.treetable.TreeTableTest?restartApplication
screenCaptureinitial
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableTest::PID_Smenu#item046,6
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableTest::Root/VOverlay[0]/VMenuBar[0]#item512,7
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableTest::Root/VOverlay[1]/VMenuBar[0]#item184,9
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableTest::Root/VOverlay[2]/VMenuBar[0]#item016,10
screenCaptureitemsRemoved
+ + diff --git a/uitest/src/com/vaadin/tests/components/treetable/TreeTableCacheOnPartialUpdate.html b/uitest/src/com/vaadin/tests/components/treetable/TreeTableCacheOnPartialUpdate.html index d9366385ce..df1656dd23 100644 --- a/uitest/src/com/vaadin/tests/components/treetable/TreeTableCacheOnPartialUpdate.html +++ b/uitest/src/com/vaadin/tests/components/treetable/TreeTableCacheOnPartialUpdate.html @@ -4,12 +4,12 @@ -New Test +TreeTableCacheOnPartialUpdates - + @@ -18,17 +18,17 @@ - + - + - + @@ -48,7 +48,7 @@ - + @@ -58,27 +58,27 @@ - + - + - + - + - + @@ -108,7 +108,7 @@ - + @@ -118,22 +118,22 @@ - + - + - + - + @@ -173,22 +173,22 @@ - + - + - + - + @@ -234,7 +234,7 @@ - + @@ -249,7 +249,7 @@ - + @@ -259,7 +259,7 @@ - + @@ -269,7 +269,7 @@ - + @@ -279,7 +279,7 @@ - + @@ -289,7 +289,7 @@ - + @@ -304,7 +304,7 @@ - + @@ -314,7 +314,7 @@ - + @@ -324,12 +324,12 @@ - + - + @@ -339,7 +339,7 @@ - + @@ -359,22 +359,22 @@ - + - + - + - + @@ -399,17 +399,17 @@ - + - + - + @@ -424,7 +424,7 @@ - + @@ -434,7 +434,7 @@ - + @@ -454,22 +454,22 @@ - + - + - + - + @@ -495,7 +495,7 @@ - + @@ -505,12 +505,12 @@ - + - + @@ -520,7 +520,7 @@ - + @@ -530,7 +530,7 @@ - + @@ -540,7 +540,7 @@ - + diff --git a/uitest/src/com/vaadin/tests/components/treetable/TreeTableCacheOnPartialUpdates.java b/uitest/src/com/vaadin/tests/components/treetable/TreeTableCacheOnPartialUpdates.java index c2bd3da860..f792a32f8f 100644 --- a/uitest/src/com/vaadin/tests/components/treetable/TreeTableCacheOnPartialUpdates.java +++ b/uitest/src/com/vaadin/tests/components/treetable/TreeTableCacheOnPartialUpdates.java @@ -72,13 +72,11 @@ public class TreeTableCacheOnPartialUpdates extends TestBase { public Component generateCell(final com.vaadin.ui.Table source, final Object itemId, Object columnId) { TestBean tb = (TestBean) itemId; - // if (!tb.getCol1().contains("children")) { - // return null; - // } String identifier = "Item " + itemId + "/" + columnId; - System.out.println("Generating new Button for " + identifier); Button btnCol3 = new NativeButton(identifier); - btnCol3.addListener(new Button.ClickListener() { + btnCol3.setId("cacheTestButton-" + tb.getCol1() + "-" + + tb.getCol2()); + btnCol3.addClickListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { log.log("Button " + event.getButton().getCaption() @@ -91,6 +89,25 @@ public class TreeTableCacheOnPartialUpdates extends TestBase { } + public class Col4ColumnGenerator implements ColumnGenerator { + public Component generateCell(final com.vaadin.ui.Table source, + final Object itemId, Object columnId) { + TestBean tb = (TestBean) itemId; + String identifier = "Expand/Collapse"; + Button btnCol4 = new NativeButton(identifier); + btnCol4.setId("cacheTestButtonToggle-" + tb.getCol1() + "-" + + tb.getCol2()); + btnCol4.addClickListener(new Button.ClickListener() { + public void buttonClick(ClickEvent event) { + treeTable.setCollapsed(itemId, + !treeTable.isCollapsed(itemId)); + } + }); + return btnCol4; + } + + } + protected int indexOfId(Table source, Object itemId) { Container.Ordered c = (Ordered) source.getContainerDataSource(); if (c instanceof Container.Indexed) { @@ -105,19 +122,17 @@ public class TreeTableCacheOnPartialUpdates extends TestBase { private TreeTable treeTable; private BeanItemContainer testBeanContainer; private static String[] columnHeaders = new String[] { "Col1", "Col2", - "Col3" }; + "Col3", "Col4" }; private static Object[] visibleColumns = new Object[] { "col1", "col2", - "col3" }; + "col3", "col4" }; @Override public void setup() { - setTheme("reindeer-tests"); - // Force row height to be the same in all browsers so scrolling based on // pixels works as expected Button b = new Button("Show first"); addComponent(b); - b.addListener(new ClickListener() { + b.addClickListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { @@ -132,7 +147,7 @@ public class TreeTableCacheOnPartialUpdates extends TestBase { cacheRateSelect.addItem(new Integer(1)); cacheRateSelect.addItem(new Integer(2)); cacheRateSelect.setValue(2); - cacheRateSelect.addListener(new ValueChangeListener() { + cacheRateSelect.addValueChangeListener(new ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { @@ -143,7 +158,6 @@ public class TreeTableCacheOnPartialUpdates extends TestBase { addComponent(cacheRateSelect); treeTable = new TreeTable(); treeTable.addStyleName("table-equal-rowheight"); - // treeTable.setPageLength(0); testBeanContainer = new BeanItemContainer(TestBean.class); Map hasChildren = new HashMap(); @@ -156,7 +170,8 @@ public class TreeTableCacheOnPartialUpdates extends TestBase { hasChildren.put("99", 20); treeTable.setContainerDataSource(createContainer(100, hasChildren)); treeTable.addGeneratedColumn("col3", new Col3ColumnGenerator()); - treeTable.addListener(new ExpandListener() { + treeTable.addGeneratedColumn("col4", new Col4ColumnGenerator()); + treeTable.addExpandListener(new ExpandListener() { @Override public void nodeExpand(ExpandEvent event) { @@ -164,7 +179,7 @@ public class TreeTableCacheOnPartialUpdates extends TestBase { } }); - treeTable.addListener(new CollapseListener() { + treeTable.addCollapseListener(new CollapseListener() { @Override public void nodeCollapse(CollapseEvent event) { @@ -172,12 +187,11 @@ public class TreeTableCacheOnPartialUpdates extends TestBase { } }); - treeTable.setColumnHeaders(columnHeaders); treeTable.setVisibleColumns(visibleColumns); + treeTable.setColumnHeaders(columnHeaders); treeTable.setColumnWidth("col1", 150); treeTable.setColumnWidth("col2", 50); treeTable.setHeight("430px"); - // treeTable.setColumnWidth("col3", 150); addComponent(log); addComponent(treeTable); } diff --git a/uitest/src/com/vaadin/tests/components/treetable/TreeTableInternalError.html b/uitest/src/com/vaadin/tests/components/treetable/TreeTableInternalError.html new file mode 100644 index 0000000000..1aa952d77e --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/treetable/TreeTableInternalError.html @@ -0,0 +1,61 @@ + + + + + + +TreeTableInternalError + + +
New Test
TreeTableCacheOnPartialUpdates
open
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[0]/VNativeButton[0]cacheTestButton-1 (children)-A 47,5
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[1]/VNativeButton[0]cacheTestButton-2-B 46,7
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[6]/VNativeButton[0]cacheTestButton-7 (children)-G 54,12
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]cacheTestButtonToggle-1 (children)-A 10,7
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[0]/VNativeButton[0]cacheTestButton-1 (children)-A 81,6
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[1]/VNativeButton[0]cacheTestButton-1.1-A.A 73,8
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[0]/VNativeButton[0]cacheTestButton-1 (children)-A 86,7
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[5]/VNativeButton[0]cacheTestButton-1.5-A.E 72,2
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[6]/VNativeButton[0]cacheTestButton-2-B 73,7
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]cacheTestButtonToggle-1 (children)-A 11,2
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[0]/VNativeButton[0]cacheTestButton-1 (children)-A 76,5
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[2]/VNativeButton[0]cacheTestButton-3 (children)-C 58,7
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[1]/VNativeButton[0]cacheTestButton-2-B 69,10
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[0]/VNativeButton[0]cacheTestButton-1 (children)-A 78,7
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[41]/VNativeButton[0]cacheTestButton-100-CV 53,-2462
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[34]/VNativeButton[0]cacheTestButton-93-CO 91,-2452
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[28]/VNativeButton[0]cacheTestButton-87-CI 84,-2461
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[41]/VNativeButton[0]cacheTestButton-100-CV 102,-2452
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[34]/domChild[0]/domChild[0]/domChild[0]cacheTestButtonToggle-40 (children)-AN 9,-995
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[34]/VNativeButton[0]cacheTestButton-40 (children)-AN 93,-991
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[35]/VNativeButton[0]cacheTestButton-40.1-AN.A 123,-991
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[40]/VNativeButton[0]cacheTestButton-40.6-AN.F 114,-1000
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[34]/VNativeButton[0]cacheTestButton-40 (children)-AN 118,-993
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[34]/domChild[0]/domChild[0]/domChild[0]cacheTestButtonToggle-40 (children)-AN 9,-998
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[34]/VNativeButton[0]cacheTestButton-40 (children)-AN 42,-990
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[29]/VNativeButton[0]cacheTestButton-35-AI 84,-990
waitForElementPresentvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[42]/VNativeButton[0]cacheTestButton-48-AV
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[42]/VNativeButton[0]cacheTestButton-48-AV 98,-998
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[35]/VNativeButton[0]cacheTestButton-41-AO 101,-994
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[30]/VNativeButton[0]cacheTestButton-86-CH 136,-2447
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[42]/VNativeButton[0]cacheTestButton-98-CT 131,-2462
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[43]/VNativeButton[0]cacheTestButton-99 (children)-CU 134,-2459
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[44]/VNativeButton[0]cacheTestButton-100-CV 144,-2454
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[43]/domChild[0]/domChild[0]/domChild[0]cacheTestButtonToggle-99 (children)-CU 10,-2461
waitForElementPresentvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[43]/VNativeButton[0]cacheTestButton-99 (children)-CU
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[43]/VNativeButton[0]cacheTestButton-99 (children)-CU 65,-2456
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[30]/VNativeButton[0]cacheTestButton-86-CH 109,-2455
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[44]/VNativeButton[0]cacheTestButton-99.1-CU.A 82,-2457
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[43]/VNativeButton[0]cacheTestButton-99 (children)-CU 85,-2792
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[42]/VNativeButton[0]cacheTestButton-98-CT 101,-2788
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[44]/VNativeButton[0]cacheTestButton-99.1-CU.A 111,-2794
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[56]/VNativeButton[0]cacheTestButton-99.13-CU.M 113,-2794
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[43]/domChild[0]/domChild[0]/domChild[0]cacheTestButtonToggle-99 (children)-CU 11,-2792
waitForElementPresentvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[40]/VNativeButton[0]cacheTestButton-99 (children)-CU
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[40]/VNativeButton[0]cacheTestButton-99 (children)-CU 71,-2465
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[41]/VNativeButton[0]cacheTestButton-100-CV 81,-2459
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[39]/VNativeButton[0]cacheTestButton-98-CT 80,-2458
mouseClickvaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[28]/VNativeButton[0]cacheTestButton-87-CI 86,-2462
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TreeTableInternalError
open/run/com.vaadin.tests.components.treetable.TreeTableInternalError?restartApplication
scrollvaadin=runcomvaadintestscomponentstreetableTreeTableInternalError::PID_Streetable/domChild[1]1320
waitForElementPresentcacheTestButtonToggle-57
clickresize
scrollvaadin=runcomvaadintestscomponentstreetableTreeTableInternalError::PID_Streetable/domChild[1]1500
waitForElementPresentcacheTestButtonToggle-55
mouseClickcacheTestButtonToggle-55-402,-1632
mouseClickcacheTestButtonToggle-58-402,-1660
screenCapture
+ + diff --git a/uitest/src/com/vaadin/tests/components/treetable/TreeTableInternalError.java b/uitest/src/com/vaadin/tests/components/treetable/TreeTableInternalError.java new file mode 100644 index 0000000000..f6d7f11eb7 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/treetable/TreeTableInternalError.java @@ -0,0 +1,82 @@ +package com.vaadin.tests.components.treetable; + +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Component; +import com.vaadin.ui.NativeButton; +import com.vaadin.ui.Table.ColumnGenerator; +import com.vaadin.ui.TreeTable; +import com.vaadin.ui.VerticalLayout; + +public class TreeTableInternalError extends TestBase { + private TreeTable t; + + @Override + protected void setup() { + VerticalLayout content = getLayout(); + content.setSizeFull(); + + t = new TreeTable() { + { + setSizeFull(); + fillTreeTable(this); + } + }; + t.setId("treetable"); + content.addComponent(t); + content.setExpandRatio(t, 1); + + Button button = new Button("Resize") { + { + addClickListener(new Button.ClickListener() { + public void buttonClick(ClickEvent event) { + t.setHeight("300px"); + } + }); + } + }; + button.setId("resize"); + content.addComponent(button); + } + + @Override + protected String getDescription() { + return "Internal Error when scrolling down enough that more rows are loaded (cache updated), then scrolling down just a few rows and expanding rows"; + } + + @Override + protected Integer getTicketNumber() { + return 10057; + } + + private void fillTreeTable(TreeTable t) { + t.addContainerProperty("name", String.class, null); + t.addGeneratedColumn("toggle", new ButtonColumnGenerator()); + for (int i = 0; i < 1000; i++) { + t.addItem(i); + t.getContainerProperty(i, "name").setValue("Item-" + i); + t.addItem(i + "c"); + t.getContainerProperty(i + "c", "name").setValue("Child-" + i); + t.setParent(i + "c", i); + t.setChildrenAllowed(i + "c", false); + } + } + + public class ButtonColumnGenerator implements ColumnGenerator { + public Component generateCell(final com.vaadin.ui.Table source, + final Object itemId, Object columnId) { + String identifier = "Expand/Collapse"; + Button btnCol = new NativeButton(identifier); + btnCol.setId("cacheTestButtonToggle-" + itemId); + btnCol.addClickListener(new Button.ClickListener() { + public void buttonClick(ClickEvent event) { + t.setCollapsed(itemId, !t.isCollapsed(itemId)); + } + }); + return btnCol; + } + + } + +} -- cgit v1.2.3