sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sseif...@apache.org
Subject svn commit: r1701830 - in /sling/trunk/testing/mocks/sling-mock: pom.xml src/test/java/org/apache/sling/testing/mock/sling/resource/AbstractSlingCrudResourceResolverTest.java
Date Tue, 08 Sep 2015 16:10:13 GMT
Author: sseifert
Date: Tue Sep  8 16:10:12 2015
New Revision: 1701830

URL: http://svn.apache.org/r1701830
Log:
SLING-5007 add unit test to explicitly test root path child listing in sling-mock as well

Modified:
    sling/trunk/testing/mocks/sling-mock/pom.xml
    sling/trunk/testing/mocks/sling-mock/src/test/java/org/apache/sling/testing/mock/sling/resource/AbstractSlingCrudResourceResolverTest.java

Modified: sling/trunk/testing/mocks/sling-mock/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/testing/mocks/sling-mock/pom.xml?rev=1701830&r1=1701829&r2=1701830&view=diff
==============================================================================
--- sling/trunk/testing/mocks/sling-mock/pom.xml (original)
+++ sling/trunk/testing/mocks/sling-mock/pom.xml Tue Sep  8 16:10:12 2015
@@ -57,7 +57,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.resourceresolver-mock</artifactId>
-            <version>1.1.8</version>
+            <version>1.1.9-SNAPSHOT</version>
             <scope>compile</scope>
         </dependency>
 

Modified: sling/trunk/testing/mocks/sling-mock/src/test/java/org/apache/sling/testing/mock/sling/resource/AbstractSlingCrudResourceResolverTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/testing/mocks/sling-mock/src/test/java/org/apache/sling/testing/mock/sling/resource/AbstractSlingCrudResourceResolverTest.java?rev=1701830&r1=1701829&r2=1701830&view=diff
==============================================================================
--- sling/trunk/testing/mocks/sling-mock/src/test/java/org/apache/sling/testing/mock/sling/resource/AbstractSlingCrudResourceResolverTest.java
(original)
+++ sling/trunk/testing/mocks/sling-mock/src/test/java/org/apache/sling/testing/mock/sling/resource/AbstractSlingCrudResourceResolverTest.java
Tue Sep  8 16:10:12 2015
@@ -47,6 +47,7 @@ import org.junit.Test;
 
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Lists;
 
 /**
  * Implements simple write and read resource and values test. Sling CRUD API is
@@ -209,6 +210,19 @@ public abstract class AbstractSlingCrudR
     }
 
     @Test
+    public void testListChildren_RootNode() throws IOException {
+        Resource resource1 = resourceResolver.getResource("/");
+
+        List<Resource> children = Lists.newArrayList(resource1.listChildren());
+        assertEquals(1, children.size());
+        assertEquals(getTestRootResource().getName(), children.get(0).getName());
+
+        children = Lists.newArrayList(resource1.getChildren());
+        assertEquals(1, children.size());
+        assertEquals(getTestRootResource().getName(), children.get(0).getName());
+    }
+
+    @Test
     public void testBinaryData() throws IOException {
         Resource resource1 = this.resourceResolver.getResource(getTestRootResource().getPath()
+ "/node1");
 



Mime
View raw message