From: Denis Anisimov Date: Mon, 12 Dec 2016 15:06:48 +0000 (+0200) Subject: Prevent adding several scrollbar handlers (#19189). X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=34576b60e55a2f98a075c062e132fb090be338e4;p=vaadin-framework.git Prevent adding several scrollbar handlers (#19189). --- diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/HorizontalScrollAfterResize.java b/uitest/src/main/java/com/vaadin/tests/components/grid/HorizontalScrollAfterResize.java index 8e6afa5441..580f2d3a30 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/HorizontalScrollAfterResize.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/HorizontalScrollAfterResize.java @@ -15,7 +15,7 @@ */ package com.vaadin.tests.components.grid; -import java.util.Arrays; +import java.util.stream.IntStream; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; @@ -29,21 +29,18 @@ public class HorizontalScrollAfterResize extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - final Grid grid = new Grid(); + final Grid grid = new Grid<>(); grid.setWidth("100%"); grid.setHeight("350px"); grid.setCaption("My Grid"); for (int i = 0; i < 10; i++) { char ch = (char) ('a' + i); - grid.addColumn(ch, String.class); - } - for (int i = 0; i < 100; i++) { - String[] row = new String[10]; - Arrays.fill(row, "test"); - grid.addRow(row); + grid.addColumn(item -> "test").setCaption("" + ch); } + grid.setItems(IntStream.of(0, 100).mapToObj(Integer::valueOf)); + addComponents(grid); } diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/HorizontalScrollAfterResizeTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/HorizontalScrollAfterResizeTest.java index e1f85fa074..fcc9681b61 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/HorizontalScrollAfterResizeTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/HorizontalScrollAfterResizeTest.java @@ -21,7 +21,7 @@ import org.openqa.selenium.Dimension; import org.openqa.selenium.Point; import com.vaadin.testbench.elements.GridElement; -import com.vaadin.tests.components.grid.basicfeatures.GridBasicFeaturesTest; +import com.vaadin.v7.tests.components.grid.basicfeatures.GridBasicFeaturesTest; /** * @author Vaadin Ltd