sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1744542 - in /sling/trunk/bundles/commons/repoinit/it/src/test: java/org/apache/sling/repoinit/it/RepoInitIT.java resources/repoinit.txt
Date Thu, 19 May 2016 09:26:15 GMT
Author: bdelacretaz
Date: Thu May 19 09:26:15 2016
New Revision: 1744542

URL: http://svn.apache.org/viewvc?rev=1744542&view=rev
Log:
SLING-5355 - use create path statements in tests

Modified:
    sling/trunk/bundles/commons/repoinit/it/src/test/java/org/apache/sling/repoinit/it/RepoInitIT.java
    sling/trunk/bundles/commons/repoinit/it/src/test/resources/repoinit.txt

Modified: sling/trunk/bundles/commons/repoinit/it/src/test/java/org/apache/sling/repoinit/it/RepoInitIT.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/repoinit/it/src/test/java/org/apache/sling/repoinit/it/RepoInitIT.java?rev=1744542&r1=1744541&r2=1744542&view=diff
==============================================================================
--- sling/trunk/bundles/commons/repoinit/it/src/test/java/org/apache/sling/repoinit/it/RepoInitIT.java
(original)
+++ sling/trunk/bundles/commons/repoinit/it/src/test/java/org/apache/sling/repoinit/it/RepoInitIT.java
Thu May 19 09:26:15 2016
@@ -42,7 +42,6 @@ import org.apache.sling.repoinit.parser.
 import org.apache.sling.repoinit.parser.operations.OperationVisitor;
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 
@@ -65,13 +64,6 @@ public class RepoInitIT {
         WaitFor.services(teleporter, SlingRepository.class, RepoInitParser.class);
         session = teleporter.getService(SlingRepository.class).loginAdministrative(null);
         
-        // TODO this should be done by the repoinit language
-        try {
-            session.getRootNode().addNode("acltest").addNode("A").addNode("B").save();;
-        } catch(RepositoryException ignore) {
-        }
-        assertTrue("Expecting test nodes to be created", session.itemExists("/acltest/A/B"));
-        
         // Execute some repoinit statements
         final InputStream is = getClass().getResourceAsStream(REPO_INIT_FILE);
         assertNotNull("Expecting " + REPO_INIT_FILE, is);
@@ -86,6 +78,8 @@ public class RepoInitIT {
             is.close();
         }
         
+        // The repoinit file causes those nodes to be created
+        assertTrue("Expecting test nodes to be created", session.itemExists("/acltest/A/B"));
     }
     
     @After

Modified: sling/trunk/bundles/commons/repoinit/it/src/test/resources/repoinit.txt
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/repoinit/it/src/test/resources/repoinit.txt?rev=1744542&r1=1744541&r2=1744542&view=diff
==============================================================================
--- sling/trunk/bundles/commons/repoinit/it/src/test/resources/repoinit.txt (original)
+++ sling/trunk/bundles/commons/repoinit/it/src/test/resources/repoinit.txt Thu May 19 09:26:15
2016
@@ -17,11 +17,14 @@
 #  under the License.
 #
 
-# Service users and ACLs for our integration tests
+# Paths on which ACLs will be set
+create path /acltest/A/B
 
+# Service users and ACLs for our integration tests
 create service user fredWilmaService
 create service user anotherService
 
+# ACLs for those service users
 set ACL for fredWilmaService
   allow jcr:all on /acltest
   deny jcr:write on /acltest/A



Mime
View raw message