aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorJenoDK <jenodekeyzer@gmail.com>2017-09-26 10:20:33 +0200
committerTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2017-09-26 12:00:07 +0300
commit9776ea2e85468256c70b8618c0e1a2a7ccb8199b (patch)
treec4d6a91ae325023c93b10181a9fe3150bed7c3a1 /server
parent4d6cb7b107040ec9aedf9b73725675309a1c5729 (diff)
downloadvaadin-framework-9776ea2e85468256c70b8618c0e1a2a7ccb8199b.tar.gz
vaadin-framework-9776ea2e85468256c70b8618c0e1a2a7ccb8199b.zip
Fix DataCommunicator parameter not used in Grid constructor (#10075)
Fixes #9944
Diffstat (limited to 'server')
-rw-r--r--server/src/main/java/com/vaadin/ui/Grid.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/server/component/grid/GridTest.java10
-rw-r--r--server/src/test/java/com/vaadin/tests/server/component/grid/TestGrid.java17
3 files changed, 28 insertions, 1 deletions
diff --git a/server/src/main/java/com/vaadin/ui/Grid.java b/server/src/main/java/com/vaadin/ui/Grid.java
index ba23c92d8a..83e0a32d30 100644
--- a/server/src/main/java/com/vaadin/ui/Grid.java
+++ b/server/src/main/java/com/vaadin/ui/Grid.java
@@ -2277,7 +2277,7 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents,
* @since 8.0.7
*/
protected Grid(Class<T> beanType, DataCommunicator<T> dataCommunicator) {
- this(BeanPropertySet.get(beanType));
+ this(BeanPropertySet.get(beanType), dataCommunicator);
this.beanType = beanType;
}
diff --git a/server/src/test/java/com/vaadin/tests/server/component/grid/GridTest.java b/server/src/test/java/com/vaadin/tests/server/component/grid/GridTest.java
index cf43ed8339..5f8327bb8d 100644
--- a/server/src/test/java/com/vaadin/tests/server/component/grid/GridTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/component/grid/GridTest.java
@@ -23,6 +23,7 @@ import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
import java.util.stream.Stream;
+import com.vaadin.data.provider.DataCommunicator;
import org.easymock.Capture;
import org.junit.Assert;
import org.junit.Before;
@@ -71,6 +72,15 @@ public class GridTest {
}
@Test
+ public void testCreateGridWithDataCommunicator() {
+ DataCommunicator specificDataCommunicator = new DataCommunicator<>();
+
+ TestGrid<String> grid = new TestGrid(String.class, specificDataCommunicator);
+
+ assertEquals(specificDataCommunicator, grid.getDataCommunicator());
+ }
+
+ @Test
public void testGridHeightModeChange() {
assertEquals("Initial height mode was not CSS", HeightMode.CSS,
grid.getHeightMode());
diff --git a/server/src/test/java/com/vaadin/tests/server/component/grid/TestGrid.java b/server/src/test/java/com/vaadin/tests/server/component/grid/TestGrid.java
new file mode 100644
index 0000000000..b6a6ab548f
--- /dev/null
+++ b/server/src/test/java/com/vaadin/tests/server/component/grid/TestGrid.java
@@ -0,0 +1,17 @@
+package com.vaadin.tests.server.component.grid;
+
+import com.vaadin.data.provider.DataCommunicator;
+import com.vaadin.ui.Grid;
+
+/**
+ * {@link Grid} class for testing purposes
+ * @param <T>
+ * the grid bean type
+ */
+public class TestGrid<T> extends Grid<T> {
+
+ public TestGrid(Class<T> beanType, DataCommunicator<T> dataCommunicator) {
+ super(beanType, dataCommunicator);
+ }
+
+}