diff options
author | John Ahlroos <john@vaadin.com> | 2014-04-30 11:47:57 +0300 |
---|---|---|
committer | John Ahlroos <john@vaadin.com> | 2014-05-05 11:24:54 +0300 |
commit | 335eb7937d29c4b540b9bd2e02651e11ff46a6ba (patch) | |
tree | e7a64a6c1af29d5b8fb92aefa7220e28c3624c1a /uitest/src | |
parent | db09b916b8222519a7e51dcb656cb092bec29e55 (diff) | |
download | vaadin-framework-335eb7937d29c4b540b9bd2e02651e11ff46a6ba.tar.gz vaadin-framework-335eb7937d29c4b540b9bd2e02651e11ff46a6ba.zip |
Fixed NPE after columns have been removed #13334
The indexes were never updated for the columns so after columns
was removed and new data was fetched an ArrayOutOfBounds exception
could occur. To fix this we use the id of the column to resolve the
index whenever a cell value is needed to ensure the correct data is
always retrived for the correct column without needing to keep track
of column indexes.
Change-Id: I8dc6fd4bb9f1cf917d7a6beea30a4a0230eea074
Diffstat (limited to 'uitest/src')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/grid/GridBasicFeaturesTest.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/grid/GridBasicFeaturesTest.java b/uitest/src/com/vaadin/tests/components/grid/GridBasicFeaturesTest.java index 7163fbea75..73bef67c32 100644 --- a/uitest/src/com/vaadin/tests/components/grid/GridBasicFeaturesTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/GridBasicFeaturesTest.java @@ -15,6 +15,8 @@ */ package com.vaadin.tests.components.grid; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.IsNot.not; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -167,6 +169,25 @@ public class GridBasicFeaturesTest extends MultiBrowserTest { } @Test + public void testDataLoadingAfterRowRemoval() throws Exception { + openTestURL(); + + // Remove columns 2,3,4 + selectMenuPath("Component", "Columns", "Column2", "Remove"); + selectMenuPath("Component", "Columns", "Column3", "Remove"); + selectMenuPath("Component", "Columns", "Column4", "Remove"); + + // Scroll so new data is lazy loaded + scrollGridVerticallyTo(1000); + + // Let lazy loading do its job + sleep(1000); + + // Check that row is loaded + assertThat(getBodyCellByRowAndColumn(11, 1).getText(), not("...")); + } + + @Test public void testFreezingColumn() throws Exception { openTestURL(); |