]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix LegacyUIAddRemoveComponents test (#2924) 64/264/1
authorHenri Sara <hesara@vaadin.com>
Wed, 14 Nov 2012 10:52:21 +0000 (12:52 +0200)
committerHenri Sara <hesara@vaadin.com>
Wed, 14 Nov 2012 10:52:21 +0000 (12:52 +0200)
Change-Id: Ib6f59d3707713a5ec3c23ee552e19d87d4713862

server/tests/src/com/vaadin/tests/server/component/ui/LegacyUIAddRemoveComponents.java

index 1a5e19e0daacb343fee19a00330ce58382a8d785..24fd3d85a855f2a80eb8500402947773f318d8d2 100644 (file)
@@ -26,7 +26,7 @@ public class LegacyUIAddRemoveComponents {
 
         ui.addComponent(c);
 
-        assertSame(c, ui.iterator().next());
+        assertSame(c.getParent(), ui.iterator().next());
         assertSame(c, ui.getContent().iterator().next());
         assertEquals(1, ui.getComponentCount());
         assertEquals(1, ui.getContent().getComponentCount());
@@ -41,9 +41,9 @@ public class LegacyUIAddRemoveComponents {
 
         ui.removeComponent(c);
 
-        assertFalse(ui.iterator().hasNext());
+        assertEquals(ui.getContent(), ui.iterator().next());
         assertFalse(ui.getContent().iterator().hasNext());
-        assertEquals(0, ui.getComponentCount());
+        assertEquals(1, ui.getComponentCount());
         assertEquals(0, ui.getContent().getComponentCount());
     }
 
@@ -57,7 +57,7 @@ public class LegacyUIAddRemoveComponents {
 
         ui.replaceComponent(c, d);
 
-        assertSame(d, ui.iterator().next());
+        assertSame(d.getParent(), ui.iterator().next());
         assertSame(d, ui.getContent().iterator().next());
         assertEquals(1, ui.getComponentCount());
         assertEquals(1, ui.getContent().getComponentCount());