diff options
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java | 13 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridSelectionTest.java | 14 |
2 files changed, 27 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java index 94ee3ef348..777f5f6775 100644 --- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java +++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java @@ -1396,6 +1396,19 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { ds.removeAllItems(); } }, null); + + createClickAction("Remove selected rows", "Body rows", + new Command<Grid, String>() { + @Override + public void execute(Grid c, String value, Object data) { + // Usually you'd deselect all the rows before removing + // them. It is done this way to test for #19152 + for (Object itemId : c.getSelectedRows()) { + ds.removeItem(itemId); + } + c.select(null); + } + }, null); } protected void createEditorActions() { diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridSelectionTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridSelectionTest.java index 8bf8639d76..44a632bc49 100644 --- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridSelectionTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridSelectionTest.java @@ -382,6 +382,20 @@ public class GridSelectionTest extends GridBasicFeaturesTest { selectAll.isSelected()); } + @Test + public void testRemoveSelectedRow() { + openTestURL(); + + setSelectionModelSingle(); + getGridElement().getCell(0, 0).click(); + + selectMenuPath("Component", "Body rows", "Remove selected rows"); + + assertFalse( + "Unexpected NullPointerException when removing selected rows", + logContainsText("Exception occured, java.lang.NullPointerException: null")); + } + private void waitUntilCheckBoxValue(final WebElement checkBoxElememnt, final boolean expectedValue) { waitUntil(new ExpectedCondition<Boolean>() { |