diff options
Diffstat (limited to 'uitest/src/test/java/com/vaadin/tests/data/DataProviderRefreshTest.java')
-rw-r--r-- | uitest/src/test/java/com/vaadin/tests/data/DataProviderRefreshTest.java | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/uitest/src/test/java/com/vaadin/tests/data/DataProviderRefreshTest.java b/uitest/src/test/java/com/vaadin/tests/data/DataProviderRefreshTest.java index f32ec543a8..bbb31535a8 100644 --- a/uitest/src/test/java/com/vaadin/tests/data/DataProviderRefreshTest.java +++ b/uitest/src/test/java/com/vaadin/tests/data/DataProviderRefreshTest.java @@ -1,6 +1,9 @@ package com.vaadin.tests.data; -import org.junit.Assert; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + import org.junit.Test; import com.vaadin.testbench.elements.ButtonElement; @@ -13,25 +16,24 @@ public class DataProviderRefreshTest extends SingleBrowserTest { public void select_and_replace() { openTestURL(); GridElement grid = $(GridElement.class).first(); - Assert.assertFalse("Row should not be initially selected", + assertFalse("Row should not be initially selected", grid.getRow(0).isSelected()); // Select item before replace $(ButtonElement.class).caption("Select old").first().click(); - Assert.assertTrue("Row should be selected", - grid.getRow(0).isSelected()); + assertTrue("Row should be selected", grid.getRow(0).isSelected()); $(ButtonElement.class).caption("Replace item").first().click(); - Assert.assertTrue("Row should still be selected after item replace", + assertTrue("Row should still be selected after item replace", grid.getRow(0).isSelected()); - Assert.assertEquals("Grid content was not updated.", "{ Bar, 10 }", + assertEquals("Grid content was not updated.", "{ Bar, 10 }", grid.getCell(0, 0).getText()); // Deselect row grid.getCell(0, 0).click(); - Assert.assertFalse("Row should be deselected after click", + assertFalse("Row should be deselected after click", grid.getRow(0).isSelected()); - Assert.assertEquals("Second row was affected", "{ Baz, 11 }", + assertEquals("Second row was affected", "{ Baz, 11 }", grid.getCell(1, 0).getText()); } @@ -39,28 +41,27 @@ public class DataProviderRefreshTest extends SingleBrowserTest { public void replace_and_select() { openTestURL(); GridElement grid = $(GridElement.class).first(); - Assert.assertFalse("Row should not be initially selected", + assertFalse("Row should not be initially selected", grid.getRow(0).isSelected()); // Replace item before select $(ButtonElement.class).caption("Replace item").first().click(); - Assert.assertFalse("Row should not be selected after item replace", + assertFalse("Row should not be selected after item replace", grid.getRow(0).isSelected()); - Assert.assertEquals("Grid content was not updated.", "{ Bar, 10 }", + assertEquals("Grid content was not updated.", "{ Bar, 10 }", grid.getCell(0, 0).getText()); $(ButtonElement.class).caption("Select old").first().click(); - Assert.assertTrue("Row should be selected", - grid.getRow(0).isSelected()); - Assert.assertEquals("Grid content should not update.", "{ Bar, 10 }", + assertTrue("Row should be selected", grid.getRow(0).isSelected()); + assertEquals("Grid content should not update.", "{ Bar, 10 }", grid.getCell(0, 0).getText()); // Deselect row grid.getCell(0, 0).click(); - Assert.assertFalse("Row should be deselected after click", + assertFalse("Row should be deselected after click", grid.getRow(0).isSelected()); - Assert.assertEquals("Second row was affected", "{ Baz, 11 }", + assertEquals("Second row was affected", "{ Baz, 11 }", grid.getCell(1, 0).getText()); } } |