summaryrefslogtreecommitdiffstats
path: root/server/tests
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <teemusa@vaadin.com>2016-02-12 09:35:41 +0200
committerVaadin Code Review <review@vaadin.com>2016-02-13 12:32:37 +0000
commit614457a95d24ee7a307f5317d8a26c9876728a6c (patch)
treed38fc371fec68031fd39f1d8e835d0d544dd4ae0 /server/tests
parentb5fb9c61ee7710558bdedda2ccf4c5e2f9481bff (diff)
downloadvaadin-framework-614457a95d24ee7a307f5317d8a26c9876728a6c.tar.gz
vaadin-framework-614457a95d24ee7a307f5317d8a26c9876728a6c.zip
Fix Grid DetailsGenerator being removed on Container change (#19593)
Change-Id: Ied328804260b1a7bb35093fca1d972735559cf41
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/grid/GridContainerTest.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/server/tests/src/com/vaadin/tests/server/component/grid/GridContainerTest.java b/server/tests/src/com/vaadin/tests/server/component/grid/GridContainerTest.java
index 527568eac8..079487d01f 100644
--- a/server/tests/src/com/vaadin/tests/server/component/grid/GridContainerTest.java
+++ b/server/tests/src/com/vaadin/tests/server/component/grid/GridContainerTest.java
@@ -19,11 +19,33 @@ import org.junit.Assert;
import org.junit.Test;
import com.vaadin.data.util.IndexedContainer;
+import com.vaadin.ui.Component;
import com.vaadin.ui.Grid;
+import com.vaadin.ui.Grid.DetailsGenerator;
+import com.vaadin.ui.Grid.RowReference;
+import com.vaadin.ui.Label;
public class GridContainerTest {
@Test
+ public void testDetailsGeneratorDoesNotResetOnContainerChange() {
+ Grid grid = new Grid();
+ DetailsGenerator detGen = new DetailsGenerator() {
+
+ @Override
+ public Component getDetails(RowReference rowReference) {
+ return new Label("Empty details");
+ }
+ };
+ grid.setDetailsGenerator(detGen);
+
+ grid.setContainerDataSource(createContainer());
+
+ Assert.assertEquals("DetailsGenerator changed", detGen,
+ grid.getDetailsGenerator());
+ }
+
+ @Test
public void testSetContainerTwice() throws Exception {
TestGrid grid = new TestGrid();