From eb75c09574249687d9ea3899791c8daa3fcec314 Mon Sep 17 00:00:00 2001 From: John Ahlroos Date: Tue, 10 Dec 2013 16:35:50 +0200 Subject: Validate column group boundaries #12907 Change-Id: I5078d97c5a6bc92f59d0d04eca2a2cfc27c973b4 --- .../server/component/grid/GridColumnGroups.java | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'server/tests') diff --git a/server/tests/src/com/vaadin/tests/server/component/grid/GridColumnGroups.java b/server/tests/src/com/vaadin/tests/server/component/grid/GridColumnGroups.java index 11dc48f7d5..4350bf1a7b 100644 --- a/server/tests/src/com/vaadin/tests/server/component/grid/GridColumnGroups.java +++ b/server/tests/src/com/vaadin/tests/server/component/grid/GridColumnGroups.java @@ -233,4 +233,33 @@ public class GridColumnGroups { } } + + @Test + public void testColumnGroupLimits() throws Exception { + + ColumnGroupRow row = grid.addColumnGroupRow(); + row.addGroup("column1", "column2"); + row.addGroup("column3", "column4"); + + try { + row.addGroup("column2", "column3"); + fail("Adding a group with already grouped properties should throw exception"); + } catch (IllegalArgumentException iae) { + + } + + ColumnGroupRow row2 = grid.addColumnGroupRow(); + + try { + row2.addGroup("column2", "column3"); + fail("Adding a group that breaks previous grouping boundaries should throw exception"); + } catch (IllegalArgumentException iae) { + + } + + // This however should not throw an exception as it spans completely + // over the parent rows groups + row2.addGroup("column1", "column2", "column3", "column4"); + + } } -- cgit v1.2.3