This is an automated email from the ASF dual-hosted git repository.

mgrigorov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/wicket.git


The following commit(s) were added to refs/heads/master by this push:
     new c7bcad0  WICKET-6754 Add a test case
c7bcad0 is described below

commit c7bcad0dd79c131f474347dd8308c1f070b12bf8
Author: Martin Tzvetanov Grigorov <[email protected]>
AuthorDate: Sun Mar 8 07:37:19 2020 +0200

    WICKET-6754 Add a test case
---
 .../test/java/org/apache/wicket/MarkupContainerTest.java  | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git 
a/wicket-core/src/test/java/org/apache/wicket/MarkupContainerTest.java 
b/wicket-core/src/test/java/org/apache/wicket/MarkupContainerTest.java
index a8d9178..6d8cea3 100644
--- a/wicket-core/src/test/java/org/apache/wicket/MarkupContainerTest.java
+++ b/wicket-core/src/test/java/org/apache/wicket/MarkupContainerTest.java
@@ -30,6 +30,7 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Optional;
 import java.util.Random;
+import java.util.stream.Collectors;
 
 import org.apache.commons.collections4.map.LinkedMap;
 import org.apache.wicket.core.util.lang.WicketObjects;
@@ -1265,6 +1266,20 @@ class MarkupContainerTest extends WicketTestCase
                        .isPresent());
        }
 
+       // https://issues.apache.org/jira/browse/WICKET-6754
+       @Test
+       void streamChildrenNestedContainer() {
+               WebMarkupContainer wmc = new WebMarkupContainer("parent");
+               WebMarkupContainer wmc1 = new WebMarkupContainer("wmc1");
+               wmc.add(wmc1);
+               WebMarkupContainer wmc1_2= new WebMarkupContainer("wmc1_2");
+               wmc1.add(wmc1_2);
+               Label lbl2 = new Label("lbl2");
+               wmc.add(lbl2);
+               List l = 
wmc.streamChildren().map(Component::getId).collect(Collectors.toList());
+               assertEquals("[wmc1, wmc1_2, lbl2]", l.toString());
+       }
+
        private static class HierarchyChangePage extends WebPage
                implements
                        IMarkupResourceStreamProvider

Reply via email to