diff options
author | Maciej PrzepioĢra <mac@vaadin.com> | 2015-09-21 11:05:32 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2015-09-24 07:40:24 +0000 |
commit | 8006d359acce4fb31e7210ed2f20f1da3d7a1cd0 (patch) | |
tree | 8c5c5853809209470ced0945f7c7550c7984d72f /server/tests | |
parent | 50b9c0c472d3caa7d1ff2fe14d1ca270b6bde4ac (diff) | |
download | vaadin-framework-8006d359acce4fb31e7210ed2f20f1da3d7a1cd0.tar.gz vaadin-framework-8006d359acce4fb31e7210ed2f20f1da3d7a1cd0.zip |
Write all empty cells for empty GridLayout in declarative #18805
Change-Id: I589ba0dbb4aea7578f85894046e99903d9202e37
Diffstat (limited to 'server/tests')
-rw-r--r-- | server/tests/src/com/vaadin/tests/server/component/gridlayout/GridLayoutDeclarativeTest.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/server/tests/src/com/vaadin/tests/server/component/gridlayout/GridLayoutDeclarativeTest.java b/server/tests/src/com/vaadin/tests/server/component/gridlayout/GridLayoutDeclarativeTest.java index d69fd92984..fe2d1c4a23 100644 --- a/server/tests/src/com/vaadin/tests/server/component/gridlayout/GridLayoutDeclarativeTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/gridlayout/GridLayoutDeclarativeTest.java @@ -15,6 +15,10 @@ */ package com.vaadin.tests.server.component.gridlayout; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; + import org.junit.Assert; import org.junit.Test; @@ -22,6 +26,7 @@ import com.vaadin.tests.server.component.DeclarativeMarginTestBase; import com.vaadin.ui.Button; import com.vaadin.ui.Component; import com.vaadin.ui.GridLayout; +import com.vaadin.ui.declarative.Design; import com.vaadin.ui.declarative.DesignContext; public class GridLayoutDeclarativeTest extends @@ -236,4 +241,22 @@ public class GridLayoutDeclarativeTest extends testWrite(design, outer); } + + @Test + public void testEmptyGridLayoutWithColsAndRowsSet() throws IOException { + GridLayout layout = new GridLayout(); + layout.setRows(2); + layout.setColumns(2); + + ByteArrayOutputStream out = new ByteArrayOutputStream(); + DesignContext context = new DesignContext(); + context.setRootComponent(layout); + Design.write(context, out); + + ByteArrayInputStream input = new ByteArrayInputStream(out.toByteArray()); + Component component = Design.read(input); + GridLayout readLayout = (GridLayout) component; + + Assert.assertEquals(layout.getRows(), readLayout.getRows()); + } } |