sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1651385 - /sling/trunk/contrib/extensions/resourcemerger/src/test/java/org/apache/sling/resourcemerger/impl/MergedResourceProviderTest.java
Date Tue, 13 Jan 2015 15:42:07 GMT
Author: cziegeler
Date: Tue Jan 13 15:42:06 2015
New Revision: 1651385

URL: http://svn.apache.org/r1651385
Log:
Add a new test case

Modified:
    sling/trunk/contrib/extensions/resourcemerger/src/test/java/org/apache/sling/resourcemerger/impl/MergedResourceProviderTest.java

Modified: sling/trunk/contrib/extensions/resourcemerger/src/test/java/org/apache/sling/resourcemerger/impl/MergedResourceProviderTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/resourcemerger/src/test/java/org/apache/sling/resourcemerger/impl/MergedResourceProviderTest.java?rev=1651385&r1=1651384&r2=1651385&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/resourcemerger/src/test/java/org/apache/sling/resourcemerger/impl/MergedResourceProviderTest.java
(original)
+++ sling/trunk/contrib/extensions/resourcemerger/src/test/java/org/apache/sling/resourcemerger/impl/MergedResourceProviderTest.java
Tue Jan 13 15:42:06 2015
@@ -76,6 +76,9 @@ public class MergedResourceProviderTest
                                             .resource(".4").p("a", "1").p("b", "2").p("c",
"3")
                                             .resource(".Y")
                                             .resource(".Z")
+                                          .resource("/libs/a/Y/a")
+                                          .resource("/libs/a/Y/b")
+                                          .resource("/libs/a/Y/c")
                                         .commit();
 
         this.provider = new CRUDMergingResourceProvider("/merged", new MergingResourcePicker());
@@ -120,6 +123,21 @@ public class MergedResourceProviderTest
         assertTrue(names.contains("X"));
     }
 
+    @Test public void testListSubChildren() {
+        final Resource rsrcY = this.provider.getResource(this.resolver, "/merged/a/Y");
+        assertNotNull(rsrcY);
+        final Iterator<Resource> i = this.provider.listChildren(rsrcY);
+        assertNotNull(i);
+        final List<String> names = new ArrayList<String>();
+        while ( i.hasNext() ) {
+            names.add(i.next().getName());
+        }
+        assertEquals(3, names.size());
+        assertTrue(names.contains("a"));
+        assertTrue(names.contains("b"));
+        assertTrue(names.contains("c"));
+    }
+
     @Test public void testProperties() {
         final Resource rsrcA1 = this.provider.getResource(this.resolver, "/merged/a/1");
         final ValueMap vm = rsrcA1.adaptTo(ValueMap.class);



Mime
View raw message