summaryrefslogtreecommitdiffstats
path: root/server/tests
diff options
context:
space:
mode:
authorJohn Ahlroos <john@vaadin.com>2013-11-25 13:51:17 +0200
committerVaadin Code Review <review@vaadin.com>2013-12-02 13:43:50 +0000
commit076aa0e6201db1fe9345e256266cb9227384e290 (patch)
tree9681c4bc2816a6d52f1292d25f54577ff6cbb273 /server/tests
parent42461bfebfe43d1f24948d72f29c1dd38a8d7d1a (diff)
downloadvaadin-framework-076aa0e6201db1fe9345e256266cb9227384e290.tar.gz
vaadin-framework-076aa0e6201db1fe9345e256266cb9227384e290.zip
Ensure setting value on detached column group throws exception #3153
Change-Id: I4cef3424dfe846ab814fcf70c5cda4a305cbdf1c
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/grid/GridColumnGroups.java25
1 files changed, 25 insertions, 0 deletions
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 cf1ee14437..11dc48f7d5 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
@@ -19,6 +19,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
@@ -208,4 +209,28 @@ public class GridColumnGroups {
group.setFooterCaption(null);
assertNull(group.getFooterCaption());
}
+
+ @Test
+ public void testColumnGroupDetachment() throws Exception {
+
+ ColumnGroupRow row = grid.addColumnGroupRow();
+ ColumnGroup group = row.addGroup("column1", "column2");
+
+ // Remove group
+ row.removeGroup(group);
+
+ try {
+ group.setHeaderCaption("Header");
+ fail("Should throw exception for setting header caption on detached group");
+ } catch (IllegalStateException ise) {
+
+ }
+
+ try {
+ group.setFooterCaption("Footer");
+ fail("Should throw exception for setting footer caption on detached group");
+ } catch (IllegalStateException ise) {
+
+ }
+ }
}