summaryrefslogtreecommitdiffstats
path: root/tests/server-side
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2012-08-08 12:26:55 +0000
committerLeif Åstrand <leif@vaadin.com>2012-08-08 12:26:55 +0000
commit6ead5944ab0a1e4d48b3f502281ac24d43e5ed89 (patch)
tree0372b9ab3d5532f0a49e6a2adf2e507b61644949 /tests/server-side
parentf303f62b2e966fe8e4f2a220f03c8c6b777212ed (diff)
downloadvaadin-framework-6ead5944ab0a1e4d48b3f502281ac24d43e5ed89.tar.gz
vaadin-framework-6ead5944ab0a1e4d48b3f502281ac24d43e5ed89.zip
Allow removing Window while iterating child window set (#9251)
svn changeset:24115/svn branch:6.8
Diffstat (limited to 'tests/server-side')
-rw-r--r--tests/server-side/com/vaadin/tests/server/component/window/AddRemoveSubWindow.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/server-side/com/vaadin/tests/server/component/window/AddRemoveSubWindow.java b/tests/server-side/com/vaadin/tests/server/component/window/AddRemoveSubWindow.java
index 50de91e2af..74859fd8b7 100644
--- a/tests/server-side/com/vaadin/tests/server/component/window/AddRemoveSubWindow.java
+++ b/tests/server-side/com/vaadin/tests/server/component/window/AddRemoveSubWindow.java
@@ -5,6 +5,8 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
+import java.util.Set;
+
import org.junit.Test;
import com.vaadin.Application;
@@ -80,4 +82,19 @@ public class AddRemoveSubWindow {
assertTrue("Window was not removed correctly", removed);
assertNull(subWindow.getParent());
}
+
+ @Test
+ public void testChildWindowsIteratorModification() {
+ Window mainWindow = new Window();
+ mainWindow.addWindow(new Window());
+ mainWindow.addWindow(new Window());
+
+ Set<Window> childWindows = mainWindow.getChildWindows();
+ for (Window window : childWindows) {
+ mainWindow.removeWindow(window);
+ }
+
+ assertEquals(2, childWindows.size());
+ assertEquals(0, mainWindow.getChildWindows().size());
+ }
}