summaryrefslogtreecommitdiffstats
path: root/server/tests
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/gridlayout/GridLayoutDeclarativeTest.java23
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());
+ }
}