diff options
author | Aleksi Hietanen <aleksi@vaadin.com> | 2017-05-05 11:02:05 +0300 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-05-05 11:02:05 +0300 |
commit | f10c0dcc7ebbafccbf0e037432dc2c75949e8e67 (patch) | |
tree | 9bc63888a44a4a89a4ab3a6ec21f10eda18881ab | |
parent | e06c0940b417cb1e6431f86dcf77e97ef8da4835 (diff) | |
download | vaadin-framework-f10c0dcc7ebbafccbf0e037432dc2c75949e8e67.tar.gz vaadin-framework-f10c0dcc7ebbafccbf0e037432dc2c75949e8e67.zip |
Allow Escalator.setHeightByRows to accept zero as a valid argument (#9244)
3 files changed, 33 insertions, 1 deletions
diff --git a/client/src/main/java/com/vaadin/client/widgets/Escalator.java b/client/src/main/java/com/vaadin/client/widgets/Escalator.java index d85dd7054b..7d2ca986a7 100644 --- a/client/src/main/java/com/vaadin/client/widgets/Escalator.java +++ b/client/src/main/java/com/vaadin/client/widgets/Escalator.java @@ -6461,7 +6461,7 @@ public class Escalator extends Widget * @see #setHeightMode(HeightMode) */ public void setHeightByRows(double rows) throws IllegalArgumentException { - if (rows <= 0) { + if (rows < 0) { throw new IllegalArgumentException( "The number of rows must be a positive number."); } else if (Double.isInfinite(rows)) { diff --git a/uitest/src/main/java/com/vaadin/tests/components/tree/TreeDefaultConstructor.java b/uitest/src/main/java/com/vaadin/tests/components/tree/TreeDefaultConstructor.java new file mode 100644 index 0000000000..831f80e521 --- /dev/null +++ b/uitest/src/main/java/com/vaadin/tests/components/tree/TreeDefaultConstructor.java @@ -0,0 +1,13 @@ +package com.vaadin.tests.components.tree; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Tree; + +public class TreeDefaultConstructor extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + addComponent(new Tree<>()); + } +} diff --git a/uitest/src/test/java/com/vaadin/tests/components/tree/TreeDefaultConstructorTest.java b/uitest/src/test/java/com/vaadin/tests/components/tree/TreeDefaultConstructorTest.java new file mode 100644 index 0000000000..8f55f800e9 --- /dev/null +++ b/uitest/src/test/java/com/vaadin/tests/components/tree/TreeDefaultConstructorTest.java @@ -0,0 +1,19 @@ +package com.vaadin.tests.components.tree; + +import static org.junit.Assert.assertFalse; + +import org.junit.Test; +import org.openqa.selenium.By; + +import com.vaadin.tests.tb3.SingleBrowserTest; + +public class TreeDefaultConstructorTest extends SingleBrowserTest { + + @Test + public void default_constructor_no_exceptions() { + setDebug(true); + openTestURL(); + assertNoErrorNotifications(); + assertFalse(isElementPresent(By.className("v-errorindicator"))); + } +} |