]> source.dussan.org Git - vaadin-framework.git/commitdiff
Prevent adding several scrollbar handlers (#19189). pr7969/r1
authorDenis Anisimov <denis@vaadin.com>
Mon, 12 Dec 2016 15:06:48 +0000 (17:06 +0200)
committerDenis Anisimov <denis@vaadin.com>
Mon, 12 Dec 2016 15:06:48 +0000 (17:06 +0200)
uitest/src/main/java/com/vaadin/tests/components/grid/HorizontalScrollAfterResize.java
uitest/src/test/java/com/vaadin/tests/components/grid/HorizontalScrollAfterResizeTest.java

index 8e6afa5441c9a5d3639085e401afbd9968e84329..580f2d3a3019cf29347b816439b8b94d523f6f49 100644 (file)
@@ -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<Integer> 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);
     }
 
index e1f85fa0748078486bc84623d623b248f5fc0b3b..fcc9681b61bd69a690d662002a2c336b742b0d46 100644 (file)
@@ -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