From 6ead5944ab0a1e4d48b3f502281ac24d43e5ed89 Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Wed, 8 Aug 2012 12:26:55 +0000 Subject: Allow removing Window while iterating child window set (#9251) svn changeset:24115/svn branch:6.8 --- .../server/component/window/AddRemoveSubWindow.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests') 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 childWindows = mainWindow.getChildWindows(); + for (Window window : childWindows) { + mainWindow.removeWindow(window); + } + + assertEquals(2, childWindows.size()); + assertEquals(0, mainWindow.getChildWindows().size()); + } } -- cgit v1.2.3