You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 09:57:49 UTC

[sling-org-apache-sling-repoinit-parser] annotated tag org.apache.sling.repoinit.parser-1.0.0 created (now 847a732)

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

rombert pushed a change to annotated tag org.apache.sling.repoinit.parser-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-repoinit-parser.git.


      at 847a732  (tag)
 tagging 00e8be98690f29439f378a67781cc8b5331169bd (commit)
      by Bertrand Delacretaz
      on Tue Jun 21 14:41:52 2016 +0000

- Log -----------------------------------------------------------------
org.apache.sling.repoinit.parser-1.0.0
-----------------------------------------------------------------------

This annotated tag includes the following new commits:

     new 52bef86  SLING-5355 - initial parser and tests
     new 73dc487  SLING-5355 - make space for more acldef modules
     new c593f72  SLING-5355 - jcr module added, work in progress
     new 230fdf7  fix build by setting commons-io’s version to 2.4
     new 847aa69  SLING-5355 - parser service
     new 0ac405a  SLING-5355 - AclSetupComponent, work in progress
     new 69e2707  Switch to parent pom 26
     new 464dd03  SLING-5449 - rename the modules to 'jcrinit'
     new 061b136  SLING-5449 - the name is 'repoinit' instead as the parser is not JCR-specific
     new 0ea77fd  SLING-5449 - the name is 'repoinit' instead as the parser is not JCR-specific
     new 1f9131f  SLING-5449 - rename packages to repoinit
     new 927bc9e  SLING-5449 - rename the remaining things from ACL to 'repoinit'
     new 593ad88  SLING-5449 - move repoinit under commons
     new 83b37d9  repoinit: fix SCM urls after move
     new a7fbbdd  normalize line endings to ensure tests run on windows as well
     new 09f97e2  SLING-5449 - initial base tree creation language, see test-20.txt for examples
     new db642cd  SLING-5449 - use nicer 'create path' syntax
     new 69753a9  SLING-5449 - Implement CreatePath in oak-jcr module
     new 73201e5  SLING-5449 - move the repoinit modules under extensions, they do contain Sling-specific stuff
     new ab73315  SLING-5449 - fix scm strings
     new 63ef28c  [maven-release-plugin] prepare release org.apache.sling.repoinit.parser-1.0.0
     new 00e8be9  [maven-release-plugin] copy for tag org.apache.sling.repoinit.parser-1.0.0

The 22 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


-- 
To stop receiving notification emails like this one, please contact
['"commits@sling.apache.org" <co...@sling.apache.org>'].

[sling-org-apache-sling-repoinit-parser] 13/22: SLING-5449 - move repoinit under commons

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.repoinit.parser-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-repoinit-parser.git

commit 593ad88b998c4dc3d897ed074acc65e53542fe81
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Fri Jan 22 19:17:30 2016 +0000

    SLING-5449 - move repoinit under commons
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/commons/repoinit/parser@1726292 13f79535-47bb-0310-9956-ffa450edef68

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-repoinit-parser] 10/22: SLING-5449 - the name is 'repoinit' instead as the parser is not JCR-specific

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.repoinit.parser-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-repoinit-parser.git

commit 0ea77fd44230afdd290495705ccaad3720ce176c
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Fri Jan 22 15:44:17 2016 +0000

    SLING-5449 - the name is 'repoinit' instead as the parser is not JCR-specific
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/repoinit/parser@1726242 13f79535-47bb-0310-9956-ffa450edef68

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-repoinit-parser] 21/22: [maven-release-plugin] prepare release org.apache.sling.repoinit.parser-1.0.0

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.repoinit.parser-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-repoinit-parser.git

commit 63ef28c6d70bcaebe0e68e7569217a35f2d0da69
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Tue Jun 21 14:41:39 2016 +0000

    [maven-release-plugin] prepare release org.apache.sling.repoinit.parser-1.0.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/repoinit/parser@1749535 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/pom.xml b/pom.xml
index 431e845..96bf799 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,19 +24,19 @@
     <groupId>org.apache.sling</groupId>
     <artifactId>sling</artifactId>
     <version>26</version>
-    <relativePath/>
+    <relativePath />
   </parent>
 
   <artifactId>org.apache.sling.repoinit.parser</artifactId>
   <packaging>bundle</packaging>
-  <version>0.0.1-SNAPSHOT</version>
+  <version>1.0.0</version>
   <name>Apache Sling RepoInit Parser</name>
   <description>Parser for the Repository Initialization language used in Sling</description>
 
   <scm>
-    <connection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/repoinit/parser</connection>
-    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/repoinit/parser</developerConnection>
-    <url>https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/repoinit/parser</url>
+    <connection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.repoinit.parser-1.0.0</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.repoinit.parser-1.0.0</developerConnection>
+    <url>https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.repoinit.parser-1.0.0</url>
   </scm>
   
   <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-repoinit-parser] 16/22: SLING-5449 - initial base tree creation language, see test-20.txt for examples

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.repoinit.parser-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-repoinit-parser.git

commit 09f97e23862860042021f98a4ce503c09fdd524b
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Tue May 17 14:12:23 2016 +0000

    SLING-5449 - initial base tree creation language, see test-20.txt for examples
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/commons/repoinit/parser@1744274 13f79535-47bb-0310-9956-ffa450edef68
---
 .../repoinit/parser/operations/CreatePath.java     | 68 ++++++++++++++++++++++
 .../parser/operations/OperationVisitor.java        |  1 +
 ...tionVisitor.java => PathSegmentDefinition.java} | 33 +++++++++--
 src/main/javacc/RepoInitGrammar.jjt                | 38 ++++++++++--
 .../parser/test/OperationToStringVisitor.java      |  6 ++
 src/test/resources/testcases/test-20-output.txt    |  4 ++
 src/test/resources/testcases/test-20.txt           |  6 ++
 src/test/resources/testcases/test-99-output.txt    |  2 +
 src/test/resources/testcases/test-99.txt           |  3 +
 9 files changed, 152 insertions(+), 9 deletions(-)

diff --git a/src/main/java/org/apache/sling/repoinit/parser/operations/CreatePath.java b/src/main/java/org/apache/sling/repoinit/parser/operations/CreatePath.java
new file mode 100644
index 0000000..ae1e313
--- /dev/null
+++ b/src/main/java/org/apache/sling/repoinit/parser/operations/CreatePath.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.sling.repoinit.parser.operations;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+public class CreatePath extends Operation {
+    private List<PathSegmentDefinition> pathDef;
+    private final String defaultPrimaryType;
+    
+    public CreatePath(String defaultPrimaryType) {
+        this.pathDef = new ArrayList<PathSegmentDefinition>();
+        this.defaultPrimaryType = defaultPrimaryType;
+    }
+    
+    @Override
+    public String toString() {
+        return getClass().getSimpleName() + " " + pathDef;
+    }
+    
+    @Override
+    protected String getParametersDescription() {
+        return pathDef.toString();
+    }
+
+    @Override
+    public void accept(OperationVisitor v) {
+        v.visitCreatePath(this);
+    }
+    
+    public void addSegment(String path, String primaryType) {
+        // We might get a path like /var/discovery, in which case
+        // the specified primary type applies to the last
+        // segment only
+        final String [] segments = path.split("/");
+        for(int i=0; i < segments.length; i++) {
+            if(segments[i].length() == 0) {
+                continue;
+            }
+            String pt = defaultPrimaryType;
+            if(i == segments.length -1 && primaryType != null) {
+                pt = primaryType;
+            }
+            pathDef.add(new PathSegmentDefinition(segments[i], pt));
+        }
+    }
+    
+    public Iterator<PathSegmentDefinition> getDefinitions() {
+        return pathDef.iterator();
+    }
+}
diff --git a/src/main/java/org/apache/sling/repoinit/parser/operations/OperationVisitor.java b/src/main/java/org/apache/sling/repoinit/parser/operations/OperationVisitor.java
index d6e500c..4079386 100644
--- a/src/main/java/org/apache/sling/repoinit/parser/operations/OperationVisitor.java
+++ b/src/main/java/org/apache/sling/repoinit/parser/operations/OperationVisitor.java
@@ -22,4 +22,5 @@ public interface OperationVisitor {
     void visitDeleteServiceUser(DeleteServiceUser s);
     void visitSetAclPrincipal(SetAclPrincipals s);
     void visitSetAclPaths(SetAclPaths s);
+    void visitCreatePath(CreatePath cp);
 }
diff --git a/src/main/java/org/apache/sling/repoinit/parser/operations/OperationVisitor.java b/src/main/java/org/apache/sling/repoinit/parser/operations/PathSegmentDefinition.java
similarity index 53%
copy from src/main/java/org/apache/sling/repoinit/parser/operations/OperationVisitor.java
copy to src/main/java/org/apache/sling/repoinit/parser/operations/PathSegmentDefinition.java
index d6e500c..62f95b8 100644
--- a/src/main/java/org/apache/sling/repoinit/parser/operations/OperationVisitor.java
+++ b/src/main/java/org/apache/sling/repoinit/parser/operations/PathSegmentDefinition.java
@@ -17,9 +17,32 @@
 
 package org.apache.sling.repoinit.parser.operations;
 
-public interface OperationVisitor {
-    void visitCreateServiceUser(CreateServiceUser s);
-    void visitDeleteServiceUser(DeleteServiceUser s);
-    void visitSetAclPrincipal(SetAclPrincipals s);
-    void visitSetAclPaths(SetAclPaths s);
+/** Defines a segment of a path to be created, 
+ *  with its name and an optional primary type
+ */
+public class PathSegmentDefinition {
+    private final String segment;
+    private final String primaryType;
+    
+    public PathSegmentDefinition(String segment, String primaryType) {
+        this.segment = segment;
+        this.primaryType = primaryType;
+    }
+
+    public String toString() {
+        final StringBuilder sb = new StringBuilder();
+        sb.append(segment);
+        if(primaryType != null) {
+            sb.append("(").append(primaryType).append(")");
+        }
+        return sb.toString();
+    }
+    
+    public String getSegment() {
+        return segment;
+    }
+
+    public String getPrimaryType() {
+        return primaryType;
+    }
 }
diff --git a/src/main/javacc/RepoInitGrammar.jjt b/src/main/javacc/RepoInitGrammar.jjt
index 60e84d8..abc011c 100644
--- a/src/main/javacc/RepoInitGrammar.jjt
+++ b/src/main/javacc/RepoInitGrammar.jjt
@@ -5,8 +5,9 @@
  
 options
 {
-    LOOKAHEAD=3;
     STATIC=false;
+    LOOKAHEAD=3;
+    //FORCE_LA_CHECK=true;
 }
 
 PARSER_BEGIN(RepoInitParserImpl)
@@ -63,6 +64,9 @@ TOKEN:
 |   < END: "end" >
 |   < USER: "user" >
 |   < NODETYPES: "nodetypes" >
+|   < CREATE_PATH: "create_path" >
+|   < LPAREN: "(" >
+|   < RPAREN: ")" >
 |   < PRINCIPAL: (["a"-"z"] | ["A"-"Z"] | ["0"-"9"] | "_" | "-")+ >
 |   < COMMA: "," >
 |   < STAR: "*" >
@@ -79,7 +83,8 @@ List<Operation> parse() :
     ( 
         serviceUserStatement(result) 
         | setAclPaths(result) 
-        | setAclPrincipals(result) 
+        | setAclPrincipals(result)
+        | createPathStatement(result)
         | blankLine() 
     ) * 
     <EOF>
@@ -141,8 +146,7 @@ List<String> namespacedItemsList() :
 List<String> pathsList() :
 {
     Token t = null;
-    List<String> paths = new ArrayList<String>(); 
-    
+    List<String> paths = new ArrayList<String>();
 }
 {
     t = <PATH> { paths.add(t.image); } 
@@ -150,6 +154,32 @@ List<String> pathsList() :
     { return paths; }
 }
 
+void createPathStatement(List<Operation> result) :
+{
+    CreatePath cp = null;
+    String defaultPrimaryType = null;
+    Token t1 = null;
+    Token t2 = null;
+}
+{
+    <CREATE_PATH> 
+    ( <LPAREN> t1 = <NAMESPACED_ITEM> <RPAREN> { defaultPrimaryType = t1.image; } ) ?
+    
+    ( t1 = <PATH> ( <LPAREN> t2 = <NAMESPACED_ITEM> <RPAREN> ) ?
+        {
+            if(cp == null) {
+                cp = new CreatePath(defaultPrimaryType);
+            } 
+            cp.addSegment(t1.image, t2 == null ? null : t2.image); 
+            t2 = null; 
+        }
+    ) +
+    
+    (<EOL> | <EOF>)
+    
+    { if(cp != null) result.add(cp); }
+}
+
 void setAclPaths(List<Operation> result) :
 {
     List<String> paths;
diff --git a/src/test/java/org/apache/sling/repoinit/parser/test/OperationToStringVisitor.java b/src/test/java/org/apache/sling/repoinit/parser/test/OperationToStringVisitor.java
index b6b704a..a439549 100644
--- a/src/test/java/org/apache/sling/repoinit/parser/test/OperationToStringVisitor.java
+++ b/src/test/java/org/apache/sling/repoinit/parser/test/OperationToStringVisitor.java
@@ -21,6 +21,7 @@ import java.io.PrintWriter;
 import java.util.Collection;
 
 import org.apache.sling.repoinit.parser.operations.AclLine;
+import org.apache.sling.repoinit.parser.operations.CreatePath;
 import org.apache.sling.repoinit.parser.operations.CreateServiceUser;
 import org.apache.sling.repoinit.parser.operations.DeleteServiceUser;
 import org.apache.sling.repoinit.parser.operations.OperationVisitor;
@@ -72,6 +73,11 @@ class OperationToStringVisitor implements OperationVisitor {
         dumpAclLines(s.getLines());
     }
     
+    @Override
+    public void visitCreatePath(CreatePath cp) {
+        out.println(cp.toString());
+    }
+
     private void dumpAclLines(Collection<AclLine> c) {
         for(AclLine line : c) {
             out.print("  ");
diff --git a/src/test/resources/testcases/test-20-output.txt b/src/test/resources/testcases/test-20-output.txt
new file mode 100644
index 0000000..68fa997
--- /dev/null
+++ b/src/test/resources/testcases/test-20-output.txt
@@ -0,0 +1,4 @@
+CreatePath [var(sling:Folder), discovery(nt:unstructured), somefolder(sling:Folder)]
+CreatePath [one, two, three]
+CreatePath [three, four(nt:folk), five(nt:jazz), six]
+CreatePath [seven(nt:x), eight(nt:x), nine(nt:x)]
\ No newline at end of file
diff --git a/src/test/resources/testcases/test-20.txt b/src/test/resources/testcases/test-20.txt
new file mode 100644
index 0000000..9a67807
--- /dev/null
+++ b/src/test/resources/testcases/test-20.txt
@@ -0,0 +1,6 @@
+# Various create path tests
+# TODO should use "create path" instead of "create_path"
+create_path (sling:Folder) /var/discovery(nt:unstructured)/somefolder
+create_path /one/two/three
+create_path /three/four(nt:folk)/five(nt:jazz)/six
+create_path (nt:x) /seven/eight/nine
diff --git a/src/test/resources/testcases/test-99-output.txt b/src/test/resources/testcases/test-99-output.txt
index ec98fc4..2761b1b 100644
--- a/src/test/resources/testcases/test-99-output.txt
+++ b/src/test/resources/testcases/test-99-output.txt
@@ -9,6 +9,8 @@ SetAclPaths on /libs /apps
 CreateServiceUser bob_the_service
 SetAclPaths on /tmp 
   AclLine ALLOW {principals=[bob_the_service], privileges=[some:otherPrivilege]}
+CreatePath [content, example.com(sling:Folder)]
+CreatePath [var(nt:unstructured)]
 SetAclPrincipals for alice bob fred 
   AclLine REMOVE_ALL {paths=[/]}
   AclLine ALLOW {paths=[/content, /var], privileges=[jcr:read]}
diff --git a/src/test/resources/testcases/test-99.txt b/src/test/resources/testcases/test-99.txt
index 67e0949..6632b03 100644
--- a/src/test/resources/testcases/test-99.txt
+++ b/src/test/resources/testcases/test-99.txt
@@ -17,6 +17,9 @@ set ACL on /tmp
 allow some:otherPrivilege for bob_the_service
 end
 
+create_path /content/example.com(sling:Folder)
+create_path (nt:unstructured) /var
+
 set ACL for alice, bob,fred
     remove * on /
     allow jcr:read on /content,/var

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-repoinit-parser] 09/22: SLING-5449 - the name is 'repoinit' instead as the parser is not JCR-specific

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.repoinit.parser-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-repoinit-parser.git

commit 061b136b8cc934ddc7b477cd4f922e42dd4c0be1
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Fri Jan 22 15:43:35 2016 +0000

    SLING-5449 - the name is 'repoinit' instead as the parser is not JCR-specific
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/jcrinit/parser@1726240 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/pom.xml b/pom.xml
index 2b183e1..7fe6c0c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -27,16 +27,16 @@
     <relativePath/>
   </parent>
 
-  <artifactId>org.apache.sling.acldef.parser</artifactId>
+  <artifactId>org.apache.sling.repoinit.parser</artifactId>
   <packaging>bundle</packaging>
   <version>0.0.1-SNAPSHOT</version>
-  <name>Apache Sling ACL Definitions Parser</name>
-  <description>Parser for an ACL Definition Language used in Sling</description>
+  <name>Apache Sling RepoInit Parser</name>
+  <description>Parser for the Repository Initialization language used in Sling</description>
 
   <scm>
-    <connection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/acldef-parser</connection>
-    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/acldef-parser</developerConnection>
-    <url>https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/acldef-parser</url>
+    <connection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/repoinit/parser</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/repoinit/parser</developerConnection>
+    <url>https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/repoinit/parser</url>
   </scm>
   
   <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-repoinit-parser] 14/22: repoinit: fix SCM urls after move

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.repoinit.parser-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-repoinit-parser.git

commit 83b37d9d07e35cd1de427a0bfc7f6e35dc4eb77d
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Mon Jan 25 07:34:39 2016 +0000

    repoinit: fix SCM urls after move
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/commons/repoinit/parser@1726588 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index 7fe6c0c..2df3f3c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -34,9 +34,9 @@
   <description>Parser for the Repository Initialization language used in Sling</description>
 
   <scm>
-    <connection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/repoinit/parser</connection>
-    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/repoinit/parser</developerConnection>
-    <url>https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/repoinit/parser</url>
+    <connection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/commons/repoinit/parser</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/commons/repoinit/parser</developerConnection>
+    <url>https://svn.apache.org/repos/asf/sling/trunk/bundles/commons/repoinit/parser</url>
   </scm>
   
   <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-repoinit-parser] 03/22: SLING-5355 - jcr module added, work in progress

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.repoinit.parser-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-repoinit-parser.git

commit c593f726413baf0594d12c8834ffcff38d8d3347
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Mon Dec 21 09:49:23 2015 +0000

    SLING-5355 - jcr module added, work in progress
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/acldef/parser@1721113 13f79535-47bb-0310-9956-ffa450edef68
---
 .../apache/sling/acldef/parser/operations/ServiceUserOperation.java  | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/acldef/parser/operations/ServiceUserOperation.java b/src/main/java/org/apache/sling/acldef/parser/operations/ServiceUserOperation.java
index 45e4c93..0965536 100644
--- a/src/main/java/org/apache/sling/acldef/parser/operations/ServiceUserOperation.java
+++ b/src/main/java/org/apache/sling/acldef/parser/operations/ServiceUserOperation.java
@@ -27,5 +27,8 @@ public abstract class ServiceUserOperation extends Operation {
     protected String getParametersDescription() {
         return username;
     }
-
+    
+    public String getUsername() {
+        return username;
+    }
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-repoinit-parser] 15/22: normalize line endings to ensure tests run on windows as well

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.repoinit.parser-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-repoinit-parser.git

commit a7fbbdd2181fcbb413eacf45648a5f925e01aeec
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Fri Feb 5 23:03:49 2016 +0000

    normalize line endings to ensure tests run on windows as well
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/commons/repoinit/parser@1728773 13f79535-47bb-0310-9956-ffa450edef68
---
 .../java/org/apache/sling/repoinit/parser/test/ParserTest.java     | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/test/java/org/apache/sling/repoinit/parser/test/ParserTest.java b/src/test/java/org/apache/sling/repoinit/parser/test/ParserTest.java
index 8c75643..94c77e2 100644
--- a/src/test/java/org/apache/sling/repoinit/parser/test/ParserTest.java
+++ b/src/test/java/org/apache/sling/repoinit/parser/test/ParserTest.java
@@ -117,7 +117,12 @@ public class ParserTest {
                 o.accept(v);
             }
             sw.flush();
-            assertEquals(expected, sw.toString().trim());
+            String actual = sw.toString().trim();
+            
+            // normalize line endings to ensure tests run on windows as well
+            actual = actual.replaceAll("\r\n", "\n");
+            
+            assertEquals(expected, actual);
         } finally {
             tc.close();
         }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-repoinit-parser] 01/22: SLING-5355 - initial parser and tests

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.repoinit.parser-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-repoinit-parser.git

commit 52bef869b2ad4836dd56874ecf208480d2dd710c
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Tue Dec 15 12:31:34 2015 +0000

    SLING-5355 - initial parser and tests
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/acldef-parser@1720142 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |  92 ++++++++++++++++
 .../parser/operations/CreateServiceUser.java       |  29 +++++
 .../parser/operations/DeleteServiceUser.java       |  29 +++++
 .../sling/acldef/parser/operations/Operation.java  |  30 +++++
 .../acldef/parser/operations/OperationVisitor.java |  23 ++++
 .../parser/operations/ServiceUserOperation.java    |  31 ++++++
 src/main/javacc/ACLDefinitions.jjt                 | 121 +++++++++++++++++++++
 .../sling/acldef/parser/test/ParserTest.java       | 118 ++++++++++++++++++++
 src/test/resources/testcases/test-1-output.txt     |   4 +
 src/test/resources/testcases/test-1.txt            |   2 +
 src/test/resources/testcases/test-2-output.txt     |   3 +
 src/test/resources/testcases/test-2.txt            |   2 +
 src/test/resources/testcases/test-3-output.txt     |   1 +
 src/test/resources/testcases/test-3.txt            |  10 ++
 14 files changed, 495 insertions(+)

diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..ec88c3c
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.sling</groupId>
+    <artifactId>sling</artifactId>
+    <version>25</version>
+    <relativePath/>
+  </parent>
+
+  <artifactId>org.apache.sling.acldef.parser</artifactId>
+  <packaging>bundle</packaging>
+  <version>0.0.1-SNAPSHOT</version>
+  <name>Apache Sling ACL Definitions Parser</name>
+  <description>Parser for an ACL Definition Language used in Sling</description>
+
+  <scm>
+    <connection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/acldef-parser</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/acldef-parser</developerConnection>
+    <url>https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/acldef-parser</url>
+  </scm>
+  
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-scr-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <extensions>true</extensions>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.rat</groupId>
+        <artifactId>apache-rat-plugin</artifactId>
+        <configuration>
+          <excludes>
+            <exclude>src/test/resources/testcases/**</exclude>
+          </excludes>
+        </configuration>
+      </plugin>
+       <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>javacc-maven-plugin</artifactId>
+        <version>2.5</version>
+        <executions>
+          <execution>
+            <id>calculator</id>
+            <configuration>
+              <sourceDirectory>${basedir}/src/main/javacc</sourceDirectory>
+            </configuration>
+            <goals>
+              <goal>jjtree-javacc</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>commons-io</groupId>
+      <artifactId>commons-io</artifactId>
+      <version>2.5</version>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/src/main/java/org/apache/sling/acldef/parser/operations/CreateServiceUser.java b/src/main/java/org/apache/sling/acldef/parser/operations/CreateServiceUser.java
new file mode 100644
index 0000000..fcf60a1
--- /dev/null
+++ b/src/main/java/org/apache/sling/acldef/parser/operations/CreateServiceUser.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.sling.acldef.parser.operations;
+
+public class CreateServiceUser extends ServiceUserOperation {
+    public CreateServiceUser(String username) {
+        super(username);
+    }
+
+    @Override
+    public void accept(OperationVisitor v) {
+        v.visitCreateServiceUser(this);
+    }
+}
diff --git a/src/main/java/org/apache/sling/acldef/parser/operations/DeleteServiceUser.java b/src/main/java/org/apache/sling/acldef/parser/operations/DeleteServiceUser.java
new file mode 100644
index 0000000..378fdd4
--- /dev/null
+++ b/src/main/java/org/apache/sling/acldef/parser/operations/DeleteServiceUser.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.sling.acldef.parser.operations;
+
+public class DeleteServiceUser extends ServiceUserOperation {
+    public DeleteServiceUser(String username) {
+        super(username);
+    }
+    
+    @Override
+    public void accept(OperationVisitor v) {
+        v.visitDeleteServiceUser(this);
+    }
+}
diff --git a/src/main/java/org/apache/sling/acldef/parser/operations/Operation.java b/src/main/java/org/apache/sling/acldef/parser/operations/Operation.java
new file mode 100644
index 0000000..3c5c6cc
--- /dev/null
+++ b/src/main/java/org/apache/sling/acldef/parser/operations/Operation.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.sling.acldef.parser.operations;
+
+public abstract class Operation {
+    public abstract void accept(OperationVisitor v);
+    
+    protected abstract String getParametersDescription();
+    
+    @Override
+    public String toString() {
+        return getClass().getSimpleName() + " " + getParametersDescription();
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/acldef/parser/operations/OperationVisitor.java b/src/main/java/org/apache/sling/acldef/parser/operations/OperationVisitor.java
new file mode 100644
index 0000000..2c46128
--- /dev/null
+++ b/src/main/java/org/apache/sling/acldef/parser/operations/OperationVisitor.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.sling.acldef.parser.operations;
+
+public interface OperationVisitor {
+    void visitCreateServiceUser(CreateServiceUser s);
+    void visitDeleteServiceUser(DeleteServiceUser s);
+}
diff --git a/src/main/java/org/apache/sling/acldef/parser/operations/ServiceUserOperation.java b/src/main/java/org/apache/sling/acldef/parser/operations/ServiceUserOperation.java
new file mode 100644
index 0000000..45e4c93
--- /dev/null
+++ b/src/main/java/org/apache/sling/acldef/parser/operations/ServiceUserOperation.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.sling.acldef.parser.operations;
+
+public abstract class ServiceUserOperation extends Operation {
+    protected final String username;
+    
+    ServiceUserOperation(String username) {
+        this.username = username;
+    }
+    
+    protected String getParametersDescription() {
+        return username;
+    }
+
+}
diff --git a/src/main/javacc/ACLDefinitions.jjt b/src/main/javacc/ACLDefinitions.jjt
new file mode 100644
index 0000000..e3ede86
--- /dev/null
+++ b/src/main/javacc/ACLDefinitions.jjt
@@ -0,0 +1,121 @@
+/* JavaCC grammar for the SLING-5355 ACL definitions language
+ * See https://javacc.java.net/doc/docindex.html for the JavaCC docs
+ */
+ 
+options
+{
+    LOOKAHEAD=2;
+    STATIC=false;
+}
+
+PARSER_BEGIN(ACLDefinitions)
+
+package org.apache.sling.acldef.parser;
+
+import java.util.List;
+import java.util.ArrayList;
+
+import org.apache.sling.acldef.parser.operations.*;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+public class ACLDefinitions
+{
+    private List<Operation> result = null;
+}
+
+PARSER_END(ACLDefinitions)
+
+SKIP :
+{
+    " "
+|   "\r"
+|   "\t"
+|   < COMMENT: "#" (~["\n"])* "\n" >
+}
+
+TOKEN:
+{
+    < NUMBER: (<DIGIT>)+ ( "." (<DIGIT>)+ )? >
+|   < DIGIT: ["0"-"9"] >
+|   < SET: "set" >
+|   < ACL: "ACL" >
+|   < ON: "on" >
+|   < REMOVE: "remove" >
+|   < ALLOW: "allow" >
+|   < DENY: "deny" >
+|   < FOR: "for" >
+|   < CREATE: "create" >
+|   < DELETE: "delete" >
+|   < SERVICE: "service" >
+|   < USER: "user" >
+|   < USERNAME: (["a"-"z"] | ["A"-"Z"] | ["0"-"9"] | "_" | "-")+ >
+|   < COMMA: "," >
+|   < EOL: "\n" >
+}
+
+List<Operation> parse() :
+{}
+{
+    {
+        if(result != null) {
+            throw new IllegalStateException("This parser cannot be reused, please create a new one");
+        }
+        result = new ArrayList<Operation>();
+    }
+    
+    ( blankLine() | serviceUserStatement() ) * <EOF>
+    
+    { return result; }
+}
+
+void blankLine() :
+{}
+{
+    <EOL>
+}
+
+List<String> usernameList() :
+{
+    Token t = null;
+    List<String> usernames = new ArrayList<String>(); 
+    
+}
+{
+    t = <USERNAME> { usernames.add(t.image); } 
+    ( <COMMA> t = <USERNAME> { usernames.add(t.image); } )* 
+    { return usernames; }
+}
+
+void serviceUserStatement() :
+{
+    Token t;
+    List<String> usernames;
+}
+{
+    (t=<CREATE> | t=<DELETE>) <SERVICE> <USER> usernames = usernameList() (<EOL> | <EOF>)
+    {
+        for(String username : usernames) {
+            if(CREATE == t.kind) {
+                result.add(new CreateServiceUser(username));
+            } else {
+                result.add(new DeleteServiceUser(username));
+            }
+        } 
+    }
+}
\ No newline at end of file
diff --git a/src/test/java/org/apache/sling/acldef/parser/test/ParserTest.java b/src/test/java/org/apache/sling/acldef/parser/test/ParserTest.java
new file mode 100644
index 0000000..caccf99
--- /dev/null
+++ b/src/test/java/org/apache/sling/acldef/parser/test/ParserTest.java
@@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.sling.acldef.parser.test;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.sling.acldef.parser.ACLDefinitions;
+import org.apache.sling.acldef.parser.ParseException;
+import org.apache.sling.acldef.parser.operations.Operation;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+/** Test the parser using our test-* 
+ *  input/expected output files.
+ */
+@RunWith(Parameterized.class)
+public class ParserTest {
+    
+    public static final String DEFAULT_ENCODING = "UTF-8";
+    
+    static class TestCase {
+        final InputStream input;
+        final String inputFilename;
+        final InputStream expected;
+        final String outputFilename;
+        
+        private static final String PREFIX = "/testcases/test-"; 
+        
+        @Override
+        public String toString() {
+            return inputFilename;
+        }
+        
+        private TestCase(int index) {
+            inputFilename = PREFIX + index + ".txt";
+            input = getClass().getResourceAsStream(inputFilename);
+            outputFilename = PREFIX + index + "-output.txt";
+            expected = getClass().getResourceAsStream(outputFilename);
+        }
+        
+        static TestCase build(int index) {
+            final TestCase result = new TestCase(index);
+            if(result.input == null || result.expected == null) {
+                return null;
+            }
+            return result;
+        }
+        
+        void close() {
+            try {
+                input.close();
+            } catch(IOException ignored) {
+            }
+            try {
+                expected.close();
+            } catch(IOException ignored) {
+            }
+        }
+    }
+    
+    private final TestCase tc;
+    
+    @Parameters(name="{0}")
+    public static Collection<Object[]> data() {
+        final List<Object []> result = new ArrayList<Object[]>();
+        for(int i=0; i < 100; i++) {
+            final TestCase tc = TestCase.build(i);
+            if(tc != null) {
+                result.add(new Object[] { tc });
+            }
+        }
+        return result;
+        
+    }
+    
+    public ParserTest(TestCase tc) {
+        this.tc = tc;
+    }
+
+    @Test
+    public void checkResult() throws ParseException, IOException {
+        final String expected = IOUtils.toString(tc.expected, DEFAULT_ENCODING).trim();
+        try {
+            final StringBuilder sb = new StringBuilder();
+            final List<Operation> result = new ACLDefinitions(tc.input).parse(); 
+            for(Operation o : result) {
+                sb.append(o.toString()).append("\n");
+            }
+            assertEquals(expected, sb.toString().trim());
+        } finally {
+            tc.close();
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/test/resources/testcases/test-1-output.txt b/src/test/resources/testcases/test-1-output.txt
new file mode 100644
index 0000000..d4fde81
--- /dev/null
+++ b/src/test/resources/testcases/test-1-output.txt
@@ -0,0 +1,4 @@
+CreateServiceUser bob
+CreateServiceUser alice
+CreateServiceUser tom21
+CreateServiceUser lonesome
diff --git a/src/test/resources/testcases/test-1.txt b/src/test/resources/testcases/test-1.txt
new file mode 100644
index 0000000..1ad451a
--- /dev/null
+++ b/src/test/resources/testcases/test-1.txt
@@ -0,0 +1,2 @@
+create service user bob,alice, tom21
+create service user lonesome
\ No newline at end of file
diff --git a/src/test/resources/testcases/test-2-output.txt b/src/test/resources/testcases/test-2-output.txt
new file mode 100644
index 0000000..d2b3951
--- /dev/null
+++ b/src/test/resources/testcases/test-2-output.txt
@@ -0,0 +1,3 @@
+CreateServiceUser Mark-21
+DeleteServiceUser Leonardo
+DeleteServiceUser Winston_32
\ No newline at end of file
diff --git a/src/test/resources/testcases/test-2.txt b/src/test/resources/testcases/test-2.txt
new file mode 100644
index 0000000..c0c7b7e
--- /dev/null
+++ b/src/test/resources/testcases/test-2.txt
@@ -0,0 +1,2 @@
+create service user Mark-21
+delete service user Leonardo,Winston_32
\ No newline at end of file
diff --git a/src/test/resources/testcases/test-3-output.txt b/src/test/resources/testcases/test-3-output.txt
new file mode 100644
index 0000000..0178953
--- /dev/null
+++ b/src/test/resources/testcases/test-3-output.txt
@@ -0,0 +1 @@
+CreateServiceUser comments_test_passed
diff --git a/src/test/resources/testcases/test-3.txt b/src/test/resources/testcases/test-3.txt
new file mode 100644
index 0000000..49f1c07
--- /dev/null
+++ b/src/test/resources/testcases/test-3.txt
@@ -0,0 +1,10 @@
+#
+# single-word
+# We're testing the comments now
+# This is A COMMENT with other things like 12, 34
+# And now for a tag, <ok> ?
+# And some punctuation: .,;-_[]+"*ç%&/()=?^`"
+   # Also with leading whitespace.
+
+# blank lines work, of course   
+create service user comments_test_passed
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-repoinit-parser] 05/22: SLING-5355 - parser service

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.repoinit.parser-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-repoinit-parser.git

commit 847aa69c8a59e1a77d7ffa56ea7c7eaf9fcdab22
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Wed Dec 23 12:37:23 2015 +0000

    SLING-5355 - parser service
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/acldef/parser@1721535 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/acldef/parser/AclDefinitionsParser.java  | 29 +++++++++++++
 .../sling/acldef/parser/AclParsingException.java   | 27 ++++++++++++
 .../parser/impl/ACLDefinitionsParserService.java   | 49 ++++++++++++++++++++++
 .../sling/acldef/parser/operations/AclLine.java    |  5 +++
 .../acldef/parser/operations/package-info.java     | 21 ++++++++++
 .../apache/sling/acldef/parser/package-info.java   | 21 ++++++++++
 src/main/javacc/ACLDefinitions.jjt                 | 27 +++++-------
 .../acldef/parser/test/ParserServiceTest.java      | 39 +++++++++++++++++
 .../sling/acldef/parser/test/ParserTest.java       |  6 +--
 .../acldef/parser/test/ParsingErrorsTest.java      |  8 ++--
 10 files changed, 209 insertions(+), 23 deletions(-)

diff --git a/src/main/java/org/apache/sling/acldef/parser/AclDefinitionsParser.java b/src/main/java/org/apache/sling/acldef/parser/AclDefinitionsParser.java
new file mode 100644
index 0000000..11cf6c7
--- /dev/null
+++ b/src/main/java/org/apache/sling/acldef/parser/AclDefinitionsParser.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.acldef.parser;
+
+import java.io.Reader;
+import java.util.List;
+
+import org.apache.sling.acldef.parser.operations.Operation;
+
+/** ACL definitions parser service interface */
+public interface AclDefinitionsParser {
+    List<Operation> parse(Reader r) throws AclParsingException;
+}
diff --git a/src/main/java/org/apache/sling/acldef/parser/AclParsingException.java b/src/main/java/org/apache/sling/acldef/parser/AclParsingException.java
new file mode 100644
index 0000000..1ddc2f0
--- /dev/null
+++ b/src/main/java/org/apache/sling/acldef/parser/AclParsingException.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.acldef.parser;
+
+public class AclParsingException extends Exception {
+    private static final long serialVersionUID = 1L;
+
+    public AclParsingException(String reason, Throwable cause) {
+        super(reason, cause);
+    }
+}
diff --git a/src/main/java/org/apache/sling/acldef/parser/impl/ACLDefinitionsParserService.java b/src/main/java/org/apache/sling/acldef/parser/impl/ACLDefinitionsParserService.java
new file mode 100644
index 0000000..c78441b
--- /dev/null
+++ b/src/main/java/org/apache/sling/acldef/parser/impl/ACLDefinitionsParserService.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.acldef.parser.impl;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.util.List;
+
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.sling.acldef.parser.AclDefinitionsParser;
+import org.apache.sling.acldef.parser.AclParsingException;
+import org.apache.sling.acldef.parser.operations.Operation;
+
+/** ACL definitions parser service */
+@Component
+@Service(value=AclDefinitionsParser.class)
+public class ACLDefinitionsParserService implements AclDefinitionsParser {
+
+    @Override
+    public List<Operation> parse(Reader r) throws AclParsingException {
+        try {
+            return new ACLDefinitionsParserImpl(r).parse();
+        } catch (ParseException pe) {
+            throw new AclParsingException(pe.getMessage(), pe);
+        } finally {
+            try {
+                r.close();
+            } catch(IOException ignore) {
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/main/java/org/apache/sling/acldef/parser/operations/AclLine.java b/src/main/java/org/apache/sling/acldef/parser/operations/AclLine.java
index 0e47dcd..cdb39d9 100644
--- a/src/main/java/org/apache/sling/acldef/parser/operations/AclLine.java
+++ b/src/main/java/org/apache/sling/acldef/parser/operations/AclLine.java
@@ -29,6 +29,11 @@ public class AclLine {
     private final Action action;
     private static final List<String> EMPTY_LIST = Collections.unmodifiableList(new ArrayList<String>());
     
+    public static final String PROP_PATHS = "paths";
+    public static final String PROP_PRINCIPALS = "principals";
+    public static final String PROP_PRIVILEGES = "privileges";
+    public static final String PROP_NODETYPES = "nodetypes";
+
     public enum Action {
         REMOVE,
         REMOVE_ALL,
diff --git a/src/main/java/org/apache/sling/acldef/parser/operations/package-info.java b/src/main/java/org/apache/sling/acldef/parser/operations/package-info.java
new file mode 100644
index 0000000..7587c6d
--- /dev/null
+++ b/src/main/java/org/apache/sling/acldef/parser/operations/package-info.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+
+@Version("1.0.0")
+package org.apache.sling.acldef.parser.operations;
+
+import aQute.bnd.annotation.Version;
\ No newline at end of file
diff --git a/src/main/java/org/apache/sling/acldef/parser/package-info.java b/src/main/java/org/apache/sling/acldef/parser/package-info.java
new file mode 100644
index 0000000..d74cfb7
--- /dev/null
+++ b/src/main/java/org/apache/sling/acldef/parser/package-info.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+
+@Version("1.0.0")
+package org.apache.sling.acldef.parser;
+
+import aQute.bnd.annotation.Version;
\ No newline at end of file
diff --git a/src/main/javacc/ACLDefinitions.jjt b/src/main/javacc/ACLDefinitions.jjt
index 1de9b00..06ecb48 100644
--- a/src/main/javacc/ACLDefinitions.jjt
+++ b/src/main/javacc/ACLDefinitions.jjt
@@ -8,9 +8,9 @@ options
     STATIC=false;
 }
 
-PARSER_BEGIN(ACLDefinitions)
+PARSER_BEGIN(ACLDefinitionsParserImpl)
 
-package org.apache.sling.acldef.parser;
+package org.apache.sling.acldef.parser.impl;
 
 import java.util.List;
 import java.util.ArrayList;
@@ -34,15 +34,10 @@ import org.apache.sling.acldef.parser.operations.*;
  * limitations under the License.
  */
 
-public class ACLDefinitions
+public class ACLDefinitionsParserImpl 
 {
-    public static final String PROP_PATHS = "paths";
-    public static final String PROP_PRINCIPALS = "principals";
-    public static final String PROP_PRIVILEGES = "privileges";
-    public static final String PROP_NODETYPES = "nodetypes";
 }
-
-PARSER_END(ACLDefinitions)
+PARSER_END(ACLDefinitionsParserImpl)
 
 SKIP :
 {
@@ -178,9 +173,9 @@ void removeStarLine(List<AclLine> lines) :
 {
     <REMOVE> <STAR> 
     (
-        <FOR> tmp = principalsList() { line.setProperty(PROP_PRINCIPALS, tmp); }
+        <FOR> tmp = principalsList() { line.setProperty(AclLine.PROP_PRINCIPALS, tmp); }
         
-        | <ON> tmp = pathsList() { line.setProperty(PROP_PATHS, tmp); }
+        | <ON> tmp = pathsList() { line.setProperty(AclLine.PROP_PATHS, tmp); }
     )     
     <EOL>
     
@@ -206,9 +201,9 @@ void userPrivilegesLine(List<AclLine> lines) :
 }
 {
     line = privilegesLineOperation()
-    tmp = namespacedItemsList() { line.setProperty(PROP_PRIVILEGES, tmp); } 
+    tmp = namespacedItemsList() { line.setProperty(AclLine.PROP_PRIVILEGES, tmp); } 
     <FOR>
-    tmp = principalsList() { line.setProperty(PROP_PRINCIPALS, tmp); }
+    tmp = principalsList() { line.setProperty(AclLine.PROP_PRINCIPALS, tmp); }
     <EOL>
 
     {   
@@ -223,9 +218,9 @@ void pathPrivilegesLine(List<AclLine> lines) :
 }
 {
     line = privilegesLineOperation()
-    tmp = namespacedItemsList() { line.setProperty(PROP_PRIVILEGES, tmp); } 
-    <ON> tmp = pathsList() { line.setProperty(PROP_PATHS, tmp); }
-    ( <NODETYPES> tmp = namespacedItemsList() { line.setProperty(PROP_NODETYPES, tmp); }) ?
+    tmp = namespacedItemsList() { line.setProperty(AclLine.PROP_PRIVILEGES, tmp); } 
+    <ON> tmp = pathsList() { line.setProperty(AclLine.PROP_PATHS, tmp); }
+    ( <NODETYPES> tmp = namespacedItemsList() { line.setProperty(AclLine.PROP_NODETYPES, tmp); }) ?
     <EOL>
     
     {    
diff --git a/src/test/java/org/apache/sling/acldef/parser/test/ParserServiceTest.java b/src/test/java/org/apache/sling/acldef/parser/test/ParserServiceTest.java
new file mode 100644
index 0000000..2c0d27b
--- /dev/null
+++ b/src/test/java/org/apache/sling/acldef/parser/test/ParserServiceTest.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.sling.acldef.parser.test;
+
+import java.io.Reader;
+import java.io.StringReader;
+
+import org.apache.sling.acldef.parser.AclParsingException;
+import org.apache.sling.acldef.parser.impl.ACLDefinitionsParserService;
+import org.junit.Test;
+
+public class ParserServiceTest {
+    @Test
+    public void noErrors() throws AclParsingException {
+        final Reader r = new StringReader("create service user foo");
+        new ACLDefinitionsParserService().parse(r);
+    }
+    
+    @Test(expected = AclParsingException.class)
+    public void syntaxError() throws AclParsingException {
+        final Reader r = new StringReader("not a valid statement");
+        new ACLDefinitionsParserService().parse(r);
+    }
+}
\ No newline at end of file
diff --git a/src/test/java/org/apache/sling/acldef/parser/test/ParserTest.java b/src/test/java/org/apache/sling/acldef/parser/test/ParserTest.java
index c76fe20..5779711 100644
--- a/src/test/java/org/apache/sling/acldef/parser/test/ParserTest.java
+++ b/src/test/java/org/apache/sling/acldef/parser/test/ParserTest.java
@@ -28,8 +28,8 @@ import java.util.Collection;
 import java.util.List;
 
 import org.apache.commons.io.IOUtils;
-import org.apache.sling.acldef.parser.ACLDefinitions;
-import org.apache.sling.acldef.parser.ParseException;
+import org.apache.sling.acldef.parser.impl.ACLDefinitionsParserImpl;
+import org.apache.sling.acldef.parser.impl.ParseException;
 import org.apache.sling.acldef.parser.operations.Operation;
 import org.apache.sling.acldef.parser.operations.OperationVisitor;
 import org.junit.Test;
@@ -112,7 +112,7 @@ public class ParserTest {
         try {
             final StringWriter sw = new StringWriter();
             final OperationVisitor v = new OperationToStringVisitor(new PrintWriter(sw)); 
-            final List<Operation> result = new ACLDefinitions(tc.input).parse(); 
+            final List<Operation> result = new ACLDefinitionsParserImpl(tc.input).parse(); 
             for(Operation o : result) {
                 o.accept(v);
             }
diff --git a/src/test/java/org/apache/sling/acldef/parser/test/ParsingErrorsTest.java b/src/test/java/org/apache/sling/acldef/parser/test/ParsingErrorsTest.java
index 37cdbd4..30c4eea 100644
--- a/src/test/java/org/apache/sling/acldef/parser/test/ParsingErrorsTest.java
+++ b/src/test/java/org/apache/sling/acldef/parser/test/ParsingErrorsTest.java
@@ -26,9 +26,9 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 
-import org.apache.sling.acldef.parser.ACLDefinitions;
-import org.apache.sling.acldef.parser.ParseException;
-import org.apache.sling.acldef.parser.TokenMgrError;
+import org.apache.sling.acldef.parser.impl.ACLDefinitionsParserImpl;
+import org.apache.sling.acldef.parser.impl.ParseException;
+import org.apache.sling.acldef.parser.impl.TokenMgrError;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -74,7 +74,7 @@ public class ParsingErrorsTest {
     public void checkResult() throws ParseException, IOException {
         final StringReader r = new StringReader(input);
         try {
-            new ACLDefinitions(r).parse();
+            new ACLDefinitionsParserImpl(r).parse();
             if(expected != null) {
                 fail("Expected a " + expected.getSimpleName() + " for [" + input + "]");
             }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-repoinit-parser] 17/22: SLING-5449 - use nicer 'create path' syntax

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.repoinit.parser-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-repoinit-parser.git

commit db642cd824d3b3ba2dd61aa4b6125d8757901f6a
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Tue May 17 14:18:51 2016 +0000

    SLING-5449 - use nicer 'create path' syntax
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/commons/repoinit/parser@1744278 13f79535-47bb-0310-9956-ffa450edef68
---
 src/main/javacc/RepoInitGrammar.jjt      | 12 ++++++------
 src/test/resources/testcases/test-20.txt |  9 ++++-----
 src/test/resources/testcases/test-99.txt |  4 ++--
 3 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/src/main/javacc/RepoInitGrammar.jjt b/src/main/javacc/RepoInitGrammar.jjt
index abc011c..66b52b0 100644
--- a/src/main/javacc/RepoInitGrammar.jjt
+++ b/src/main/javacc/RepoInitGrammar.jjt
@@ -61,17 +61,17 @@ TOKEN:
 |   < CREATE: "create" >
 |   < DELETE: "delete" >
 |   < SERVICE: "service" >
+|   < PATH: "path" >
 |   < END: "end" >
 |   < USER: "user" >
 |   < NODETYPES: "nodetypes" >
-|   < CREATE_PATH: "create_path" >
 |   < LPAREN: "(" >
 |   < RPAREN: ")" >
 |   < PRINCIPAL: (["a"-"z"] | ["A"-"Z"] | ["0"-"9"] | "_" | "-")+ >
 |   < COMMA: "," >
 |   < STAR: "*" >
 |   < NAMESPACED_ITEM: (["a"-"z"] | ["A"-"Z"])+ ":" (["a"-"z"] | ["A"-"Z"])+ >
-|   < PATH: "/" (["a"-"z"] | ["A"-"Z"] | ["0"-"9"] | ["-"] | ["_"] | ["."] | ["/"]) * >
+|   < PATH_STRING: "/" (["a"-"z"] | ["A"-"Z"] | ["0"-"9"] | ["-"] | ["_"] | ["."] | ["/"]) * >
 |   < EOL: "\n" >
 }
 
@@ -149,8 +149,8 @@ List<String> pathsList() :
     List<String> paths = new ArrayList<String>();
 }
 {
-    t = <PATH> { paths.add(t.image); } 
-    ( <COMMA> t = <PATH> { paths.add(t.image); } )* 
+    t = <PATH_STRING> { paths.add(t.image); } 
+    ( <COMMA> t = <PATH_STRING> { paths.add(t.image); } )* 
     { return paths; }
 }
 
@@ -162,10 +162,10 @@ void createPathStatement(List<Operation> result) :
     Token t2 = null;
 }
 {
-    <CREATE_PATH> 
+    <CREATE> <PATH> 
     ( <LPAREN> t1 = <NAMESPACED_ITEM> <RPAREN> { defaultPrimaryType = t1.image; } ) ?
     
-    ( t1 = <PATH> ( <LPAREN> t2 = <NAMESPACED_ITEM> <RPAREN> ) ?
+    ( t1 = <PATH_STRING> ( <LPAREN> t2 = <NAMESPACED_ITEM> <RPAREN> ) ?
         {
             if(cp == null) {
                 cp = new CreatePath(defaultPrimaryType);
diff --git a/src/test/resources/testcases/test-20.txt b/src/test/resources/testcases/test-20.txt
index 9a67807..30f1355 100644
--- a/src/test/resources/testcases/test-20.txt
+++ b/src/test/resources/testcases/test-20.txt
@@ -1,6 +1,5 @@
 # Various create path tests
-# TODO should use "create path" instead of "create_path"
-create_path (sling:Folder) /var/discovery(nt:unstructured)/somefolder
-create_path /one/two/three
-create_path /three/four(nt:folk)/five(nt:jazz)/six
-create_path (nt:x) /seven/eight/nine
+create path (sling:Folder) /var/discovery(nt:unstructured)/somefolder
+create path /one/two/three
+create path /three/four(nt:folk)/five(nt:jazz)/six
+create path (nt:x) /seven/eight/nine
diff --git a/src/test/resources/testcases/test-99.txt b/src/test/resources/testcases/test-99.txt
index 6632b03..df013a8 100644
--- a/src/test/resources/testcases/test-99.txt
+++ b/src/test/resources/testcases/test-99.txt
@@ -17,8 +17,8 @@ set ACL on /tmp
 allow some:otherPrivilege for bob_the_service
 end
 
-create_path /content/example.com(sling:Folder)
-create_path (nt:unstructured) /var
+create path /content/example.com(sling:Folder)
+create path (nt:unstructured) /var
 
 set ACL for alice, bob,fred
     remove * on /

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-repoinit-parser] 06/22: SLING-5355 - AclSetupComponent, work in progress

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.repoinit.parser-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-repoinit-parser.git

commit 0ac405ae7fdad9ad084fbd37a5327ed64f46562b
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Wed Dec 30 10:58:37 2015 +0000

    SLING-5355 - AclSetupComponent, work in progress
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/acldef/parser@1722308 13f79535-47bb-0310-9956-ffa450edef68
---
 .../java/org/apache/sling/acldef/parser/AclDefinitionsParser.java    | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/main/java/org/apache/sling/acldef/parser/AclDefinitionsParser.java b/src/main/java/org/apache/sling/acldef/parser/AclDefinitionsParser.java
index 11cf6c7..dc84d12 100644
--- a/src/main/java/org/apache/sling/acldef/parser/AclDefinitionsParser.java
+++ b/src/main/java/org/apache/sling/acldef/parser/AclDefinitionsParser.java
@@ -25,5 +25,10 @@ import org.apache.sling.acldef.parser.operations.Operation;
 
 /** ACL definitions parser service interface */
 public interface AclDefinitionsParser {
+    /** Parse the supplied input.
+     * @param r Input in ACL definitions format. The reader is closed
+     *  by this method. 
+     * @throws AclParsingException on parsing errors
+     */
     List<Operation> parse(Reader r) throws AclParsingException;
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-repoinit-parser] 11/22: SLING-5449 - rename packages to repoinit

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.repoinit.parser-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-repoinit-parser.git

commit 1f9131f42431fa52179706aea96526ba0cdd2388
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Fri Jan 22 17:22:24 2016 +0000

    SLING-5449 - rename packages to repoinit
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/repoinit/parser@1726259 13f79535-47bb-0310-9956-ffa450edef68
---
 .../parser/AclDefinitionsParser.java                     |  4 ++--
 .../{acldef => repoinit}/parser/AclParsingException.java |  2 +-
 .../parser/impl/ACLDefinitionsParserService.java         | 10 +++++-----
 .../parser/operations/AclGroupBase.java                  |  4 ++--
 .../{acldef => repoinit}/parser/operations/AclLine.java  |  2 +-
 .../parser/operations/CreateServiceUser.java             |  2 +-
 .../parser/operations/DeleteServiceUser.java             |  2 +-
 .../parser/operations/Operation.java                     |  2 +-
 .../parser/operations/OperationVisitor.java              |  2 +-
 .../parser/operations/ServiceUserOperation.java          |  2 +-
 .../parser/operations/SetAclPaths.java                   |  4 ++--
 .../parser/operations/SetAclPrincipals.java              |  4 ++--
 .../parser/operations/package-info.java                  |  4 ++--
 .../sling/{acldef => repoinit}/parser/package-info.java  |  4 ++--
 src/main/javacc/ACLDefinitions.jjt                       |  6 +++---
 .../parser/test/OperationToStringVisitor.java            | 16 ++++++++--------
 .../parser/test/ParserServiceTest.java                   |  8 ++++----
 .../{acldef => repoinit}/parser/test/ParserTest.java     | 12 ++++++------
 .../parser/test/ParsingErrorsTest.java                   | 10 +++++-----
 19 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/src/main/java/org/apache/sling/acldef/parser/AclDefinitionsParser.java b/src/main/java/org/apache/sling/repoinit/parser/AclDefinitionsParser.java
similarity index 92%
rename from src/main/java/org/apache/sling/acldef/parser/AclDefinitionsParser.java
rename to src/main/java/org/apache/sling/repoinit/parser/AclDefinitionsParser.java
index dc84d12..a2c50c0 100644
--- a/src/main/java/org/apache/sling/acldef/parser/AclDefinitionsParser.java
+++ b/src/main/java/org/apache/sling/repoinit/parser/AclDefinitionsParser.java
@@ -16,12 +16,12 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.acldef.parser;
+package org.apache.sling.repoinit.parser;
 
 import java.io.Reader;
 import java.util.List;
 
-import org.apache.sling.acldef.parser.operations.Operation;
+import org.apache.sling.repoinit.parser.operations.Operation;
 
 /** ACL definitions parser service interface */
 public interface AclDefinitionsParser {
diff --git a/src/main/java/org/apache/sling/acldef/parser/AclParsingException.java b/src/main/java/org/apache/sling/repoinit/parser/AclParsingException.java
similarity index 96%
rename from src/main/java/org/apache/sling/acldef/parser/AclParsingException.java
rename to src/main/java/org/apache/sling/repoinit/parser/AclParsingException.java
index 1ddc2f0..13325be 100644
--- a/src/main/java/org/apache/sling/acldef/parser/AclParsingException.java
+++ b/src/main/java/org/apache/sling/repoinit/parser/AclParsingException.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.acldef.parser;
+package org.apache.sling.repoinit.parser;
 
 public class AclParsingException extends Exception {
     private static final long serialVersionUID = 1L;
diff --git a/src/main/java/org/apache/sling/acldef/parser/impl/ACLDefinitionsParserService.java b/src/main/java/org/apache/sling/repoinit/parser/impl/ACLDefinitionsParserService.java
similarity index 86%
rename from src/main/java/org/apache/sling/acldef/parser/impl/ACLDefinitionsParserService.java
rename to src/main/java/org/apache/sling/repoinit/parser/impl/ACLDefinitionsParserService.java
index c78441b..5315b65 100644
--- a/src/main/java/org/apache/sling/acldef/parser/impl/ACLDefinitionsParserService.java
+++ b/src/main/java/org/apache/sling/repoinit/parser/impl/ACLDefinitionsParserService.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.acldef.parser.impl;
+package org.apache.sling.repoinit.parser.impl;
 
 import java.io.IOException;
 import java.io.Reader;
@@ -24,9 +24,9 @@ import java.util.List;
 
 import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.Service;
-import org.apache.sling.acldef.parser.AclDefinitionsParser;
-import org.apache.sling.acldef.parser.AclParsingException;
-import org.apache.sling.acldef.parser.operations.Operation;
+import org.apache.sling.repoinit.parser.AclDefinitionsParser;
+import org.apache.sling.repoinit.parser.AclParsingException;
+import org.apache.sling.repoinit.parser.operations.Operation;
 
 /** ACL definitions parser service */
 @Component
@@ -46,4 +46,4 @@ public class ACLDefinitionsParserService implements AclDefinitionsParser {
             }
         }
     }
-}
\ No newline at end of file
+}
diff --git a/src/main/java/org/apache/sling/acldef/parser/operations/AclGroupBase.java b/src/main/java/org/apache/sling/repoinit/parser/operations/AclGroupBase.java
similarity index 96%
rename from src/main/java/org/apache/sling/acldef/parser/operations/AclGroupBase.java
rename to src/main/java/org/apache/sling/repoinit/parser/operations/AclGroupBase.java
index 995d00b..3e67eae 100644
--- a/src/main/java/org/apache/sling/acldef/parser/operations/AclGroupBase.java
+++ b/src/main/java/org/apache/sling/repoinit/parser/operations/AclGroupBase.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.sling.acldef.parser.operations;
+package org.apache.sling.repoinit.parser.operations;
 
 import java.util.Collection;
 import java.util.Collections;
@@ -40,4 +40,4 @@ import java.util.List;
     public Collection<AclLine> getLines() {
         return lines;
     }
-}
\ No newline at end of file
+}
diff --git a/src/main/java/org/apache/sling/acldef/parser/operations/AclLine.java b/src/main/java/org/apache/sling/repoinit/parser/operations/AclLine.java
similarity index 97%
rename from src/main/java/org/apache/sling/acldef/parser/operations/AclLine.java
rename to src/main/java/org/apache/sling/repoinit/parser/operations/AclLine.java
index cdb39d9..dc4da8a 100644
--- a/src/main/java/org/apache/sling/acldef/parser/operations/AclLine.java
+++ b/src/main/java/org/apache/sling/repoinit/parser/operations/AclLine.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.sling.acldef.parser.operations;
+package org.apache.sling.repoinit.parser.operations;
 
 import java.util.ArrayList;
 import java.util.Collections;
diff --git a/src/main/java/org/apache/sling/acldef/parser/operations/CreateServiceUser.java b/src/main/java/org/apache/sling/repoinit/parser/operations/CreateServiceUser.java
similarity index 95%
rename from src/main/java/org/apache/sling/acldef/parser/operations/CreateServiceUser.java
rename to src/main/java/org/apache/sling/repoinit/parser/operations/CreateServiceUser.java
index fcf60a1..ef10180 100644
--- a/src/main/java/org/apache/sling/acldef/parser/operations/CreateServiceUser.java
+++ b/src/main/java/org/apache/sling/repoinit/parser/operations/CreateServiceUser.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.sling.acldef.parser.operations;
+package org.apache.sling.repoinit.parser.operations;
 
 public class CreateServiceUser extends ServiceUserOperation {
     public CreateServiceUser(String username) {
diff --git a/src/main/java/org/apache/sling/acldef/parser/operations/DeleteServiceUser.java b/src/main/java/org/apache/sling/repoinit/parser/operations/DeleteServiceUser.java
similarity index 95%
rename from src/main/java/org/apache/sling/acldef/parser/operations/DeleteServiceUser.java
rename to src/main/java/org/apache/sling/repoinit/parser/operations/DeleteServiceUser.java
index 378fdd4..f8cce8c 100644
--- a/src/main/java/org/apache/sling/acldef/parser/operations/DeleteServiceUser.java
+++ b/src/main/java/org/apache/sling/repoinit/parser/operations/DeleteServiceUser.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.sling.acldef.parser.operations;
+package org.apache.sling.repoinit.parser.operations;
 
 public class DeleteServiceUser extends ServiceUserOperation {
     public DeleteServiceUser(String username) {
diff --git a/src/main/java/org/apache/sling/acldef/parser/operations/Operation.java b/src/main/java/org/apache/sling/repoinit/parser/operations/Operation.java
similarity index 95%
rename from src/main/java/org/apache/sling/acldef/parser/operations/Operation.java
rename to src/main/java/org/apache/sling/repoinit/parser/operations/Operation.java
index 3c5c6cc..693cfc9 100644
--- a/src/main/java/org/apache/sling/acldef/parser/operations/Operation.java
+++ b/src/main/java/org/apache/sling/repoinit/parser/operations/Operation.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.sling.acldef.parser.operations;
+package org.apache.sling.repoinit.parser.operations;
 
 public abstract class Operation {
     public abstract void accept(OperationVisitor v);
diff --git a/src/main/java/org/apache/sling/acldef/parser/operations/OperationVisitor.java b/src/main/java/org/apache/sling/repoinit/parser/operations/OperationVisitor.java
similarity index 95%
rename from src/main/java/org/apache/sling/acldef/parser/operations/OperationVisitor.java
rename to src/main/java/org/apache/sling/repoinit/parser/operations/OperationVisitor.java
index 898310f..d6e500c 100644
--- a/src/main/java/org/apache/sling/acldef/parser/operations/OperationVisitor.java
+++ b/src/main/java/org/apache/sling/repoinit/parser/operations/OperationVisitor.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.sling.acldef.parser.operations;
+package org.apache.sling.repoinit.parser.operations;
 
 public interface OperationVisitor {
     void visitCreateServiceUser(CreateServiceUser s);
diff --git a/src/main/java/org/apache/sling/acldef/parser/operations/ServiceUserOperation.java b/src/main/java/org/apache/sling/repoinit/parser/operations/ServiceUserOperation.java
similarity index 95%
rename from src/main/java/org/apache/sling/acldef/parser/operations/ServiceUserOperation.java
rename to src/main/java/org/apache/sling/repoinit/parser/operations/ServiceUserOperation.java
index 0965536..7f055e2 100644
--- a/src/main/java/org/apache/sling/acldef/parser/operations/ServiceUserOperation.java
+++ b/src/main/java/org/apache/sling/repoinit/parser/operations/ServiceUserOperation.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.sling.acldef.parser.operations;
+package org.apache.sling.repoinit.parser.operations;
 
 public abstract class ServiceUserOperation extends Operation {
     protected final String username;
diff --git a/src/main/java/org/apache/sling/acldef/parser/operations/SetAclPaths.java b/src/main/java/org/apache/sling/repoinit/parser/operations/SetAclPaths.java
similarity index 96%
rename from src/main/java/org/apache/sling/acldef/parser/operations/SetAclPaths.java
rename to src/main/java/org/apache/sling/repoinit/parser/operations/SetAclPaths.java
index 9b2a4c6..b2673dc 100644
--- a/src/main/java/org/apache/sling/acldef/parser/operations/SetAclPaths.java
+++ b/src/main/java/org/apache/sling/repoinit/parser/operations/SetAclPaths.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.sling.acldef.parser.operations;
+package org.apache.sling.repoinit.parser.operations;
 
 import java.util.Collections;
 import java.util.List;
@@ -47,4 +47,4 @@ public class SetAclPaths extends AclGroupBase {
     public void accept(OperationVisitor v) {
         v.visitSetAclPaths(this);
     }
-}
\ No newline at end of file
+}
diff --git a/src/main/java/org/apache/sling/acldef/parser/operations/SetAclPrincipals.java b/src/main/java/org/apache/sling/repoinit/parser/operations/SetAclPrincipals.java
similarity index 96%
rename from src/main/java/org/apache/sling/acldef/parser/operations/SetAclPrincipals.java
rename to src/main/java/org/apache/sling/repoinit/parser/operations/SetAclPrincipals.java
index 8c79a31..b3bb548 100644
--- a/src/main/java/org/apache/sling/acldef/parser/operations/SetAclPrincipals.java
+++ b/src/main/java/org/apache/sling/repoinit/parser/operations/SetAclPrincipals.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.sling.acldef.parser.operations;
+package org.apache.sling.repoinit.parser.operations;
 
 import java.util.Collections;
 import java.util.List;
@@ -47,4 +47,4 @@ public class SetAclPrincipals extends AclGroupBase {
     public void accept(OperationVisitor v) {
         v.visitSetAclPrincipal(this);
     }
-}
\ No newline at end of file
+}
diff --git a/src/main/java/org/apache/sling/acldef/parser/operations/package-info.java b/src/main/java/org/apache/sling/repoinit/parser/operations/package-info.java
similarity index 91%
rename from src/main/java/org/apache/sling/acldef/parser/operations/package-info.java
rename to src/main/java/org/apache/sling/repoinit/parser/operations/package-info.java
index 7587c6d..fad0a42 100644
--- a/src/main/java/org/apache/sling/acldef/parser/operations/package-info.java
+++ b/src/main/java/org/apache/sling/repoinit/parser/operations/package-info.java
@@ -16,6 +16,6 @@
  ******************************************************************************/
 
 @Version("1.0.0")
-package org.apache.sling.acldef.parser.operations;
+package org.apache.sling.repoinit.parser.operations;
 
-import aQute.bnd.annotation.Version;
\ No newline at end of file
+import aQute.bnd.annotation.Version;
diff --git a/src/main/java/org/apache/sling/acldef/parser/package-info.java b/src/main/java/org/apache/sling/repoinit/parser/package-info.java
similarity index 92%
rename from src/main/java/org/apache/sling/acldef/parser/package-info.java
rename to src/main/java/org/apache/sling/repoinit/parser/package-info.java
index d74cfb7..3c9ed48 100644
--- a/src/main/java/org/apache/sling/acldef/parser/package-info.java
+++ b/src/main/java/org/apache/sling/repoinit/parser/package-info.java
@@ -16,6 +16,6 @@
  ******************************************************************************/
 
 @Version("1.0.0")
-package org.apache.sling.acldef.parser;
+package org.apache.sling.repoinit.parser;
 
-import aQute.bnd.annotation.Version;
\ No newline at end of file
+import aQute.bnd.annotation.Version;
diff --git a/src/main/javacc/ACLDefinitions.jjt b/src/main/javacc/ACLDefinitions.jjt
index 06ecb48..d539f28 100644
--- a/src/main/javacc/ACLDefinitions.jjt
+++ b/src/main/javacc/ACLDefinitions.jjt
@@ -10,12 +10,12 @@ options
 
 PARSER_BEGIN(ACLDefinitionsParserImpl)
 
-package org.apache.sling.acldef.parser.impl;
+package org.apache.sling.repoinit.parser.impl;
 
 import java.util.List;
 import java.util.ArrayList;
 
-import org.apache.sling.acldef.parser.operations.*;
+import org.apache.sling.repoinit.parser.operations.*;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -242,4 +242,4 @@ void setAclPrincipals(List<Operation> result) :
     {
         result.add(new SetAclPrincipals(principals, lines));
     }
-}
\ No newline at end of file
+}
diff --git a/src/test/java/org/apache/sling/acldef/parser/test/OperationToStringVisitor.java b/src/test/java/org/apache/sling/repoinit/parser/test/OperationToStringVisitor.java
similarity index 82%
rename from src/test/java/org/apache/sling/acldef/parser/test/OperationToStringVisitor.java
rename to src/test/java/org/apache/sling/repoinit/parser/test/OperationToStringVisitor.java
index fb27655..b6b704a 100644
--- a/src/test/java/org/apache/sling/acldef/parser/test/OperationToStringVisitor.java
+++ b/src/test/java/org/apache/sling/repoinit/parser/test/OperationToStringVisitor.java
@@ -15,17 +15,17 @@
  * limitations under the License.
  */
 
-package org.apache.sling.acldef.parser.test;
+package org.apache.sling.repoinit.parser.test;
 
 import java.io.PrintWriter;
 import java.util.Collection;
 
-import org.apache.sling.acldef.parser.operations.AclLine;
-import org.apache.sling.acldef.parser.operations.CreateServiceUser;
-import org.apache.sling.acldef.parser.operations.DeleteServiceUser;
-import org.apache.sling.acldef.parser.operations.OperationVisitor;
-import org.apache.sling.acldef.parser.operations.SetAclPaths;
-import org.apache.sling.acldef.parser.operations.SetAclPrincipals;
+import org.apache.sling.repoinit.parser.operations.AclLine;
+import org.apache.sling.repoinit.parser.operations.CreateServiceUser;
+import org.apache.sling.repoinit.parser.operations.DeleteServiceUser;
+import org.apache.sling.repoinit.parser.operations.OperationVisitor;
+import org.apache.sling.repoinit.parser.operations.SetAclPaths;
+import org.apache.sling.repoinit.parser.operations.SetAclPrincipals;
 
 /** OperationVisitor that dumps the operations using
  *  their toString() methods
@@ -78,4 +78,4 @@ class OperationToStringVisitor implements OperationVisitor {
             out.println(line);
         }
     }
-}
\ No newline at end of file
+}
diff --git a/src/test/java/org/apache/sling/acldef/parser/test/ParserServiceTest.java b/src/test/java/org/apache/sling/repoinit/parser/test/ParserServiceTest.java
similarity index 87%
rename from src/test/java/org/apache/sling/acldef/parser/test/ParserServiceTest.java
rename to src/test/java/org/apache/sling/repoinit/parser/test/ParserServiceTest.java
index 2c0d27b..6a45986 100644
--- a/src/test/java/org/apache/sling/acldef/parser/test/ParserServiceTest.java
+++ b/src/test/java/org/apache/sling/repoinit/parser/test/ParserServiceTest.java
@@ -15,13 +15,13 @@
  * limitations under the License.
  */
 
-package org.apache.sling.acldef.parser.test;
+package org.apache.sling.repoinit.parser.test;
 
 import java.io.Reader;
 import java.io.StringReader;
 
-import org.apache.sling.acldef.parser.AclParsingException;
-import org.apache.sling.acldef.parser.impl.ACLDefinitionsParserService;
+import org.apache.sling.repoinit.parser.AclParsingException;
+import org.apache.sling.repoinit.parser.impl.ACLDefinitionsParserService;
 import org.junit.Test;
 
 public class ParserServiceTest {
@@ -36,4 +36,4 @@ public class ParserServiceTest {
         final Reader r = new StringReader("not a valid statement");
         new ACLDefinitionsParserService().parse(r);
     }
-}
\ No newline at end of file
+}
diff --git a/src/test/java/org/apache/sling/acldef/parser/test/ParserTest.java b/src/test/java/org/apache/sling/repoinit/parser/test/ParserTest.java
similarity index 92%
rename from src/test/java/org/apache/sling/acldef/parser/test/ParserTest.java
rename to src/test/java/org/apache/sling/repoinit/parser/test/ParserTest.java
index 5779711..8a096e7 100644
--- a/src/test/java/org/apache/sling/acldef/parser/test/ParserTest.java
+++ b/src/test/java/org/apache/sling/repoinit/parser/test/ParserTest.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.sling.acldef.parser.test;
+package org.apache.sling.repoinit.parser.test;
 
 import static org.junit.Assert.assertEquals;
 
@@ -28,10 +28,10 @@ import java.util.Collection;
 import java.util.List;
 
 import org.apache.commons.io.IOUtils;
-import org.apache.sling.acldef.parser.impl.ACLDefinitionsParserImpl;
-import org.apache.sling.acldef.parser.impl.ParseException;
-import org.apache.sling.acldef.parser.operations.Operation;
-import org.apache.sling.acldef.parser.operations.OperationVisitor;
+import org.apache.sling.repoinit.parser.impl.ACLDefinitionsParserImpl;
+import org.apache.sling.repoinit.parser.impl.ParseException;
+import org.apache.sling.repoinit.parser.operations.Operation;
+import org.apache.sling.repoinit.parser.operations.OperationVisitor;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -122,4 +122,4 @@ public class ParserTest {
             tc.close();
         }
     }
-}
\ No newline at end of file
+}
diff --git a/src/test/java/org/apache/sling/acldef/parser/test/ParsingErrorsTest.java b/src/test/java/org/apache/sling/repoinit/parser/test/ParsingErrorsTest.java
similarity index 93%
rename from src/test/java/org/apache/sling/acldef/parser/test/ParsingErrorsTest.java
rename to src/test/java/org/apache/sling/repoinit/parser/test/ParsingErrorsTest.java
index 30c4eea..1a7d3cb 100644
--- a/src/test/java/org/apache/sling/acldef/parser/test/ParsingErrorsTest.java
+++ b/src/test/java/org/apache/sling/repoinit/parser/test/ParsingErrorsTest.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.sling.acldef.parser.test;
+package org.apache.sling.repoinit.parser.test;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
@@ -26,9 +26,9 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 
-import org.apache.sling.acldef.parser.impl.ACLDefinitionsParserImpl;
-import org.apache.sling.acldef.parser.impl.ParseException;
-import org.apache.sling.acldef.parser.impl.TokenMgrError;
+import org.apache.sling.repoinit.parser.impl.ACLDefinitionsParserImpl;
+import org.apache.sling.repoinit.parser.impl.ParseException;
+import org.apache.sling.repoinit.parser.impl.TokenMgrError;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -86,4 +86,4 @@ public class ParsingErrorsTest {
             r.close();
         }
     }
-}
\ No newline at end of file
+}

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-repoinit-parser] 20/22: SLING-5449 - fix scm strings

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.repoinit.parser-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-repoinit-parser.git

commit ab733150be25c1ea78087027da7fb1b387e0387d
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Thu May 19 13:03:08 2016 +0000

    SLING-5449 - fix scm strings
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/repoinit/parser@1744566 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index 2df3f3c..431e845 100644
--- a/pom.xml
+++ b/pom.xml
@@ -34,9 +34,9 @@
   <description>Parser for the Repository Initialization language used in Sling</description>
 
   <scm>
-    <connection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/commons/repoinit/parser</connection>
-    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/commons/repoinit/parser</developerConnection>
-    <url>https://svn.apache.org/repos/asf/sling/trunk/bundles/commons/repoinit/parser</url>
+    <connection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/repoinit/parser</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/repoinit/parser</developerConnection>
+    <url>https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/repoinit/parser</url>
   </scm>
   
   <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-repoinit-parser] 22/22: [maven-release-plugin] copy for tag org.apache.sling.repoinit.parser-1.0.0

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.repoinit.parser-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-repoinit-parser.git

commit 00e8be98690f29439f378a67781cc8b5331169bd
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Tue Jun 21 14:41:52 2016 +0000

    [maven-release-plugin] copy for tag org.apache.sling.repoinit.parser-1.0.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.repoinit.parser-1.0.0@1749536 13f79535-47bb-0310-9956-ffa450edef68

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-repoinit-parser] 07/22: Switch to parent pom 26

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.repoinit.parser-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-repoinit-parser.git

commit 69e27072daf13d7a881fdfb727e794afb13c56ad
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Sun Jan 3 14:07:46 2016 +0000

    Switch to parent pom 26
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/acldef/parser@1722720 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 8c758e4..2b183e1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.sling</groupId>
     <artifactId>sling</artifactId>
-    <version>25</version>
+    <version>26</version>
     <relativePath/>
   </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-repoinit-parser] 19/22: SLING-5449 - move the repoinit modules under extensions, they do contain Sling-specific stuff

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.repoinit.parser-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-repoinit-parser.git

commit 73201e57638cacea3049210b649f18aeea91ff28
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Thu May 19 12:50:58 2016 +0000

    SLING-5449 - move the repoinit modules under extensions, they do contain Sling-specific stuff
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/repoinit/parser@1744564 13f79535-47bb-0310-9956-ffa450edef68

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-repoinit-parser] 18/22: SLING-5449 - Implement CreatePath in oak-jcr module

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.repoinit.parser-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-repoinit-parser.git

commit 69753a9b092f7651c357eebbbe16d61dc4165519
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Tue May 17 15:35:15 2016 +0000

    SLING-5449 - Implement CreatePath in oak-jcr module
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/commons/repoinit/parser@1744286 13f79535-47bb-0310-9956-ffa450edef68
---
 .../org/apache/sling/repoinit/parser/operations/CreatePath.java     | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/sling/repoinit/parser/operations/CreatePath.java b/src/main/java/org/apache/sling/repoinit/parser/operations/CreatePath.java
index ae1e313..d1b87d0 100644
--- a/src/main/java/org/apache/sling/repoinit/parser/operations/CreatePath.java
+++ b/src/main/java/org/apache/sling/repoinit/parser/operations/CreatePath.java
@@ -18,7 +18,7 @@
 package org.apache.sling.repoinit.parser.operations;
 
 import java.util.ArrayList;
-import java.util.Iterator;
+import java.util.Collections;
 import java.util.List;
 
 public class CreatePath extends Operation {
@@ -62,7 +62,7 @@ public class CreatePath extends Operation {
         }
     }
     
-    public Iterator<PathSegmentDefinition> getDefinitions() {
-        return pathDef.iterator();
+    public List<PathSegmentDefinition> getDefinitions() {
+        return Collections.unmodifiableList(pathDef);
     }
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-repoinit-parser] 08/22: SLING-5449 - rename the modules to 'jcrinit'

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.repoinit.parser-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-repoinit-parser.git

commit 464dd0386f63dc95c1af0749d844c8e210818f18
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Fri Jan 22 15:33:26 2016 +0000

    SLING-5449 - rename the modules to 'jcrinit'
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/jcrinit/parser@1726235 13f79535-47bb-0310-9956-ffa450edef68

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-repoinit-parser] 04/22: fix build by setting commons-io’s version to 2.4

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.repoinit.parser-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-repoinit-parser.git

commit 230fdf76d98b302f8edf4379d7b978001bf5f3e4
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Mon Dec 21 18:42:24 2015 +0000

    fix build by setting commons-io’s version to 2.4
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/acldef/parser@1721230 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index ec88c3c..8c758e4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -86,7 +86,7 @@
     <dependency>
       <groupId>commons-io</groupId>
       <artifactId>commons-io</artifactId>
-      <version>2.5</version>
+      <version>2.4</version>
     </dependency>
   </dependencies>
 </project>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-repoinit-parser] 12/22: SLING-5449 - rename the remaining things from ACL to 'repoinit'

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.repoinit.parser-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-repoinit-parser.git

commit 927bc9e9f58ab4a7336d2a0f6f63e99d461d563f
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Fri Jan 22 18:33:42 2016 +0000

    SLING-5449 - rename the remaining things from ACL to 'repoinit'
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/repoinit/parser@1726273 13f79535-47bb-0310-9956-ffa450edef68
---
 .../{AclDefinitionsParser.java => RepoInitParser.java}     |  4 ++--
 ...ParsingException.java => RepoInitParsingException.java} |  4 ++--
 ...itionsParserService.java => RepoInitParserService.java} | 14 +++++++-------
 .../javacc/{ACLDefinitions.jjt => RepoInitGrammar.jjt}     |  9 +++++----
 .../sling/repoinit/parser/test/ParserServiceTest.java      | 14 +++++++-------
 .../org/apache/sling/repoinit/parser/test/ParserTest.java  |  4 ++--
 .../sling/repoinit/parser/test/ParsingErrorsTest.java      |  4 ++--
 7 files changed, 27 insertions(+), 26 deletions(-)

diff --git a/src/main/java/org/apache/sling/repoinit/parser/AclDefinitionsParser.java b/src/main/java/org/apache/sling/repoinit/parser/RepoInitParser.java
similarity index 92%
rename from src/main/java/org/apache/sling/repoinit/parser/AclDefinitionsParser.java
rename to src/main/java/org/apache/sling/repoinit/parser/RepoInitParser.java
index a2c50c0..8fe70eb 100644
--- a/src/main/java/org/apache/sling/repoinit/parser/AclDefinitionsParser.java
+++ b/src/main/java/org/apache/sling/repoinit/parser/RepoInitParser.java
@@ -24,11 +24,11 @@ import java.util.List;
 import org.apache.sling.repoinit.parser.operations.Operation;
 
 /** ACL definitions parser service interface */
-public interface AclDefinitionsParser {
+public interface RepoInitParser {
     /** Parse the supplied input.
      * @param r Input in ACL definitions format. The reader is closed
      *  by this method. 
      * @throws AclParsingException on parsing errors
      */
-    List<Operation> parse(Reader r) throws AclParsingException;
+    List<Operation> parse(Reader r) throws RepoInitParsingException;
 }
diff --git a/src/main/java/org/apache/sling/repoinit/parser/AclParsingException.java b/src/main/java/org/apache/sling/repoinit/parser/RepoInitParsingException.java
similarity index 88%
rename from src/main/java/org/apache/sling/repoinit/parser/AclParsingException.java
rename to src/main/java/org/apache/sling/repoinit/parser/RepoInitParsingException.java
index 13325be..fa40e52 100644
--- a/src/main/java/org/apache/sling/repoinit/parser/AclParsingException.java
+++ b/src/main/java/org/apache/sling/repoinit/parser/RepoInitParsingException.java
@@ -18,10 +18,10 @@
  */
 package org.apache.sling.repoinit.parser;
 
-public class AclParsingException extends Exception {
+public class RepoInitParsingException extends Exception {
     private static final long serialVersionUID = 1L;
 
-    public AclParsingException(String reason, Throwable cause) {
+    public RepoInitParsingException(String reason, Throwable cause) {
         super(reason, cause);
     }
 }
diff --git a/src/main/java/org/apache/sling/repoinit/parser/impl/ACLDefinitionsParserService.java b/src/main/java/org/apache/sling/repoinit/parser/impl/RepoInitParserService.java
similarity index 75%
rename from src/main/java/org/apache/sling/repoinit/parser/impl/ACLDefinitionsParserService.java
rename to src/main/java/org/apache/sling/repoinit/parser/impl/RepoInitParserService.java
index 5315b65..d599f55 100644
--- a/src/main/java/org/apache/sling/repoinit/parser/impl/ACLDefinitionsParserService.java
+++ b/src/main/java/org/apache/sling/repoinit/parser/impl/RepoInitParserService.java
@@ -24,21 +24,21 @@ import java.util.List;
 
 import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.Service;
-import org.apache.sling.repoinit.parser.AclDefinitionsParser;
-import org.apache.sling.repoinit.parser.AclParsingException;
+import org.apache.sling.repoinit.parser.RepoInitParser;
+import org.apache.sling.repoinit.parser.RepoInitParsingException;
 import org.apache.sling.repoinit.parser.operations.Operation;
 
 /** ACL definitions parser service */
 @Component
-@Service(value=AclDefinitionsParser.class)
-public class ACLDefinitionsParserService implements AclDefinitionsParser {
+@Service(value=RepoInitParser.class)
+public class RepoInitParserService implements RepoInitParser {
 
     @Override
-    public List<Operation> parse(Reader r) throws AclParsingException {
+    public List<Operation> parse(Reader r) throws RepoInitParsingException {
         try {
-            return new ACLDefinitionsParserImpl(r).parse();
+            return new RepoInitParserImpl(r).parse();
         } catch (ParseException pe) {
-            throw new AclParsingException(pe.getMessage(), pe);
+            throw new RepoInitParsingException(pe.getMessage(), pe);
         } finally {
             try {
                 r.close();
diff --git a/src/main/javacc/ACLDefinitions.jjt b/src/main/javacc/RepoInitGrammar.jjt
similarity index 96%
rename from src/main/javacc/ACLDefinitions.jjt
rename to src/main/javacc/RepoInitGrammar.jjt
index d539f28..60e84d8 100644
--- a/src/main/javacc/ACLDefinitions.jjt
+++ b/src/main/javacc/RepoInitGrammar.jjt
@@ -1,4 +1,5 @@
-/* JavaCC grammar for the SLING-5355 ACL definitions language
+/* JavaCC grammar for the SLING-5449 content repository 
+ * initialization language
  * See https://javacc.java.net/doc/docindex.html for the JavaCC docs
  */
  
@@ -8,7 +9,7 @@ options
     STATIC=false;
 }
 
-PARSER_BEGIN(ACLDefinitionsParserImpl)
+PARSER_BEGIN(RepoInitParserImpl)
 
 package org.apache.sling.repoinit.parser.impl;
 
@@ -34,10 +35,10 @@ import org.apache.sling.repoinit.parser.operations.*;
  * limitations under the License.
  */
 
-public class ACLDefinitionsParserImpl 
+public class RepoInitParserImpl 
 {
 }
-PARSER_END(ACLDefinitionsParserImpl)
+PARSER_END(RepoInitParserImpl)
 
 SKIP :
 {
diff --git a/src/test/java/org/apache/sling/repoinit/parser/test/ParserServiceTest.java b/src/test/java/org/apache/sling/repoinit/parser/test/ParserServiceTest.java
index 6a45986..41a0495 100644
--- a/src/test/java/org/apache/sling/repoinit/parser/test/ParserServiceTest.java
+++ b/src/test/java/org/apache/sling/repoinit/parser/test/ParserServiceTest.java
@@ -20,20 +20,20 @@ package org.apache.sling.repoinit.parser.test;
 import java.io.Reader;
 import java.io.StringReader;
 
-import org.apache.sling.repoinit.parser.AclParsingException;
-import org.apache.sling.repoinit.parser.impl.ACLDefinitionsParserService;
+import org.apache.sling.repoinit.parser.RepoInitParsingException;
+import org.apache.sling.repoinit.parser.impl.RepoInitParserService;
 import org.junit.Test;
 
 public class ParserServiceTest {
     @Test
-    public void noErrors() throws AclParsingException {
+    public void noErrors() throws RepoInitParsingException {
         final Reader r = new StringReader("create service user foo");
-        new ACLDefinitionsParserService().parse(r);
+        new RepoInitParserService().parse(r);
     }
     
-    @Test(expected = AclParsingException.class)
-    public void syntaxError() throws AclParsingException {
+    @Test(expected = RepoInitParsingException.class)
+    public void syntaxError() throws RepoInitParsingException {
         final Reader r = new StringReader("not a valid statement");
-        new ACLDefinitionsParserService().parse(r);
+        new RepoInitParserService().parse(r);
     }
 }
diff --git a/src/test/java/org/apache/sling/repoinit/parser/test/ParserTest.java b/src/test/java/org/apache/sling/repoinit/parser/test/ParserTest.java
index 8a096e7..8c75643 100644
--- a/src/test/java/org/apache/sling/repoinit/parser/test/ParserTest.java
+++ b/src/test/java/org/apache/sling/repoinit/parser/test/ParserTest.java
@@ -28,8 +28,8 @@ import java.util.Collection;
 import java.util.List;
 
 import org.apache.commons.io.IOUtils;
-import org.apache.sling.repoinit.parser.impl.ACLDefinitionsParserImpl;
 import org.apache.sling.repoinit.parser.impl.ParseException;
+import org.apache.sling.repoinit.parser.impl.RepoInitParserImpl;
 import org.apache.sling.repoinit.parser.operations.Operation;
 import org.apache.sling.repoinit.parser.operations.OperationVisitor;
 import org.junit.Test;
@@ -112,7 +112,7 @@ public class ParserTest {
         try {
             final StringWriter sw = new StringWriter();
             final OperationVisitor v = new OperationToStringVisitor(new PrintWriter(sw)); 
-            final List<Operation> result = new ACLDefinitionsParserImpl(tc.input).parse(); 
+            final List<Operation> result = new RepoInitParserImpl(tc.input).parse(); 
             for(Operation o : result) {
                 o.accept(v);
             }
diff --git a/src/test/java/org/apache/sling/repoinit/parser/test/ParsingErrorsTest.java b/src/test/java/org/apache/sling/repoinit/parser/test/ParsingErrorsTest.java
index 1a7d3cb..fb46eef 100644
--- a/src/test/java/org/apache/sling/repoinit/parser/test/ParsingErrorsTest.java
+++ b/src/test/java/org/apache/sling/repoinit/parser/test/ParsingErrorsTest.java
@@ -26,8 +26,8 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 
-import org.apache.sling.repoinit.parser.impl.ACLDefinitionsParserImpl;
 import org.apache.sling.repoinit.parser.impl.ParseException;
+import org.apache.sling.repoinit.parser.impl.RepoInitParserImpl;
 import org.apache.sling.repoinit.parser.impl.TokenMgrError;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -74,7 +74,7 @@ public class ParsingErrorsTest {
     public void checkResult() throws ParseException, IOException {
         final StringReader r = new StringReader(input);
         try {
-            new ACLDefinitionsParserImpl(r).parse();
+            new RepoInitParserImpl(r).parse();
             if(expected != null) {
                 fail("Expected a " + expected.getSimpleName() + " for [" + input + "]");
             }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-repoinit-parser] 02/22: SLING-5355 - make space for more acldef modules

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.repoinit.parser-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-repoinit-parser.git

commit 73dc48724a81da9d8410fd2ab193a83d09873283
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Thu Dec 17 12:00:58 2015 +0000

    SLING-5355 - make space for more acldef modules
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/acldef/parser@1720527 13f79535-47bb-0310-9956-ffa450edef68
---
 .../{OperationVisitor.java => AclGroupBase.java}   |  28 +++-
 .../sling/acldef/parser/operations/AclLine.java    |  66 ++++++++
 .../acldef/parser/operations/OperationVisitor.java |   2 +
 .../{OperationVisitor.java => SetAclPaths.java}    |  35 +++-
 ...OperationVisitor.java => SetAclPrincipals.java} |  35 +++-
 src/main/javacc/ACLDefinitions.jjt                 | 179 ++++++++++++++++++---
 .../parser/test/OperationToStringVisitor.java      |  81 ++++++++++
 .../sling/acldef/parser/test/ParserTest.java       |  17 +-
 .../acldef/parser/test/ParsingErrorsTest.java      |  89 ++++++++++
 src/test/resources/testcases/test-10-output.txt    |   5 +
 src/test/resources/testcases/test-10.txt           |  10 ++
 src/test/resources/testcases/test-11-output.txt    |   5 +
 src/test/resources/testcases/test-11.txt           |   8 +
 src/test/resources/testcases/test-30-output.txt    |   6 +
 src/test/resources/testcases/test-30.txt           |  12 ++
 src/test/resources/testcases/test-99-output.txt    |  17 ++
 src/test/resources/testcases/test-99.txt           |  28 ++++
 17 files changed, 581 insertions(+), 42 deletions(-)

diff --git a/src/main/java/org/apache/sling/acldef/parser/operations/OperationVisitor.java b/src/main/java/org/apache/sling/acldef/parser/operations/AclGroupBase.java
similarity index 56%
copy from src/main/java/org/apache/sling/acldef/parser/operations/OperationVisitor.java
copy to src/main/java/org/apache/sling/acldef/parser/operations/AclGroupBase.java
index 2c46128..995d00b 100644
--- a/src/main/java/org/apache/sling/acldef/parser/operations/OperationVisitor.java
+++ b/src/main/java/org/apache/sling/acldef/parser/operations/AclGroupBase.java
@@ -17,7 +17,27 @@
 
 package org.apache.sling.acldef.parser.operations;
 
-public interface OperationVisitor {
-    void visitCreateServiceUser(CreateServiceUser s);
-    void visitDeleteServiceUser(DeleteServiceUser s);
-}
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+/** Base class for operations that group AclLines */
+ abstract class AclGroupBase extends Operation {
+    private final List<AclLine> lines;
+    
+    protected AclGroupBase(List<AclLine> lines) {
+        this.lines = Collections.unmodifiableList(lines);
+    }
+    
+    protected String getParametersDescription() {
+        final StringBuilder sb = new StringBuilder();
+        for(AclLine line : lines) {
+            sb.append("\n  ").append(line.toString());
+        }
+        return sb.toString(); 
+    }
+    
+    public Collection<AclLine> getLines() {
+        return lines;
+    }
+}
\ No newline at end of file
diff --git a/src/main/java/org/apache/sling/acldef/parser/operations/AclLine.java b/src/main/java/org/apache/sling/acldef/parser/operations/AclLine.java
new file mode 100644
index 0000000..0e47dcd
--- /dev/null
+++ b/src/main/java/org/apache/sling/acldef/parser/operations/AclLine.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.sling.acldef.parser.operations;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
+/** A single "set ACL" line */
+public class AclLine {
+    
+    private final Action action;
+    private static final List<String> EMPTY_LIST = Collections.unmodifiableList(new ArrayList<String>());
+    
+    public enum Action {
+        REMOVE,
+        REMOVE_ALL,
+        DENY,
+        ALLOW
+    };
+    
+    private final Map<String, List<String>> properties;
+    
+    public AclLine(Action a) {
+        action = a;
+        properties = new TreeMap<String, List<String>>();
+    }
+    
+    public Action getAction() {
+        return action;
+    }
+    
+    /** Return the named multi-value property, or an empty list
+     *  if not found. 
+     */
+    public List<String> getProperty(String name) {
+        List<String> value = properties.get(name);
+        return value != null ? value : EMPTY_LIST;
+    }
+    
+    public void setProperty(String name, List<String> values) {
+        properties.put(name, Collections.unmodifiableList(values));
+    }
+    
+    @Override
+    public String toString() {
+        return getClass().getSimpleName() + " " + action + " " + properties;
+    }
+}
diff --git a/src/main/java/org/apache/sling/acldef/parser/operations/OperationVisitor.java b/src/main/java/org/apache/sling/acldef/parser/operations/OperationVisitor.java
index 2c46128..898310f 100644
--- a/src/main/java/org/apache/sling/acldef/parser/operations/OperationVisitor.java
+++ b/src/main/java/org/apache/sling/acldef/parser/operations/OperationVisitor.java
@@ -20,4 +20,6 @@ package org.apache.sling.acldef.parser.operations;
 public interface OperationVisitor {
     void visitCreateServiceUser(CreateServiceUser s);
     void visitDeleteServiceUser(DeleteServiceUser s);
+    void visitSetAclPrincipal(SetAclPrincipals s);
+    void visitSetAclPaths(SetAclPaths s);
 }
diff --git a/src/main/java/org/apache/sling/acldef/parser/operations/OperationVisitor.java b/src/main/java/org/apache/sling/acldef/parser/operations/SetAclPaths.java
similarity index 51%
copy from src/main/java/org/apache/sling/acldef/parser/operations/OperationVisitor.java
copy to src/main/java/org/apache/sling/acldef/parser/operations/SetAclPaths.java
index 2c46128..9b2a4c6 100644
--- a/src/main/java/org/apache/sling/acldef/parser/operations/OperationVisitor.java
+++ b/src/main/java/org/apache/sling/acldef/parser/operations/SetAclPaths.java
@@ -17,7 +17,34 @@
 
 package org.apache.sling.acldef.parser.operations;
 
-public interface OperationVisitor {
-    void visitCreateServiceUser(CreateServiceUser s);
-    void visitDeleteServiceUser(DeleteServiceUser s);
-}
+import java.util.Collections;
+import java.util.List;
+
+/** Set ACL statement that groups a set of AclLines
+ *  that all refer to the same set of paths.
+ */
+public class SetAclPaths extends AclGroupBase {
+    
+    private final List<String> paths;
+    
+    public SetAclPaths(List<String> paths, List<AclLine> lines) {
+        super(lines);
+        this.paths = Collections.unmodifiableList(paths);
+    }
+    
+    protected String getParametersDescription() {
+        final StringBuilder sb = new StringBuilder();
+        sb.append(paths);
+        sb.append(super.getParametersDescription());
+        return sb.toString(); 
+    }
+    
+    public List<String> getPaths() {
+        return paths;
+    }
+
+    @Override
+    public void accept(OperationVisitor v) {
+        v.visitSetAclPaths(this);
+    }
+}
\ No newline at end of file
diff --git a/src/main/java/org/apache/sling/acldef/parser/operations/OperationVisitor.java b/src/main/java/org/apache/sling/acldef/parser/operations/SetAclPrincipals.java
similarity index 50%
copy from src/main/java/org/apache/sling/acldef/parser/operations/OperationVisitor.java
copy to src/main/java/org/apache/sling/acldef/parser/operations/SetAclPrincipals.java
index 2c46128..8c79a31 100644
--- a/src/main/java/org/apache/sling/acldef/parser/operations/OperationVisitor.java
+++ b/src/main/java/org/apache/sling/acldef/parser/operations/SetAclPrincipals.java
@@ -17,7 +17,34 @@
 
 package org.apache.sling.acldef.parser.operations;
 
-public interface OperationVisitor {
-    void visitCreateServiceUser(CreateServiceUser s);
-    void visitDeleteServiceUser(DeleteServiceUser s);
-}
+import java.util.Collections;
+import java.util.List;
+
+/** Set ACL statement that groups a set of AclLines
+ *  that all refer to the same set of principals.
+ */
+public class SetAclPrincipals extends AclGroupBase {
+    
+    private final List<String> principals;
+    
+    public SetAclPrincipals(List<String> principals, List<AclLine> lines) {
+        super(lines);
+        this.principals = Collections.unmodifiableList(principals);
+    }
+    
+    protected String getParametersDescription() {
+        final StringBuilder sb = new StringBuilder();
+        sb.append(principals);
+        sb.append(super.getParametersDescription());
+        return sb.toString(); 
+    }
+    
+    public List<String> getPrincipals() {
+        return principals;
+    }
+
+    @Override
+    public void accept(OperationVisitor v) {
+        v.visitSetAclPrincipal(this);
+    }
+}
\ No newline at end of file
diff --git a/src/main/javacc/ACLDefinitions.jjt b/src/main/javacc/ACLDefinitions.jjt
index e3ede86..1de9b00 100644
--- a/src/main/javacc/ACLDefinitions.jjt
+++ b/src/main/javacc/ACLDefinitions.jjt
@@ -4,7 +4,7 @@
  
 options
 {
-    LOOKAHEAD=2;
+    LOOKAHEAD=3;
     STATIC=false;
 }
 
@@ -36,7 +36,10 @@ import org.apache.sling.acldef.parser.operations.*;
 
 public class ACLDefinitions
 {
-    private List<Operation> result = null;
+    public static final String PROP_PATHS = "paths";
+    public static final String PROP_PRINCIPALS = "principals";
+    public static final String PROP_PRIVILEGES = "privileges";
+    public static final String PROP_NODETYPES = "nodetypes";
 }
 
 PARSER_END(ACLDefinitions)
@@ -51,9 +54,7 @@ SKIP :
 
 TOKEN:
 {
-    < NUMBER: (<DIGIT>)+ ( "." (<DIGIT>)+ )? >
-|   < DIGIT: ["0"-"9"] >
-|   < SET: "set" >
+    < SET: "set" >
 |   < ACL: "ACL" >
 |   < ON: "on" >
 |   < REMOVE: "remove" >
@@ -63,23 +64,29 @@ TOKEN:
 |   < CREATE: "create" >
 |   < DELETE: "delete" >
 |   < SERVICE: "service" >
+|   < END: "end" >
 |   < USER: "user" >
-|   < USERNAME: (["a"-"z"] | ["A"-"Z"] | ["0"-"9"] | "_" | "-")+ >
+|   < NODETYPES: "nodetypes" >
+|   < PRINCIPAL: (["a"-"z"] | ["A"-"Z"] | ["0"-"9"] | "_" | "-")+ >
 |   < COMMA: "," >
+|   < STAR: "*" >
+|   < NAMESPACED_ITEM: (["a"-"z"] | ["A"-"Z"])+ ":" (["a"-"z"] | ["A"-"Z"])+ >
+|   < PATH: "/" (["a"-"z"] | ["A"-"Z"] | ["0"-"9"] | ["-"] | ["_"] | ["."] | ["/"]) * >
 |   < EOL: "\n" >
 }
 
 List<Operation> parse() :
 {}
 {
-    {
-        if(result != null) {
-            throw new IllegalStateException("This parser cannot be reused, please create a new one");
-        }
-        result = new ArrayList<Operation>();
-    }
+    { final List<Operation> result = new ArrayList<Operation>(); }
     
-    ( blankLine() | serviceUserStatement() ) * <EOF>
+    ( 
+        serviceUserStatement(result) 
+        | setAclPaths(result) 
+        | setAclPrincipals(result) 
+        | blankLine() 
+    ) * 
+    <EOF>
     
     { return result; }
 }
@@ -90,32 +97,154 @@ void blankLine() :
     <EOL>
 }
 
-List<String> usernameList() :
+List<String> principalsList() :
 {
     Token t = null;
-    List<String> usernames = new ArrayList<String>(); 
-    
+    List<String> principals = new ArrayList<String>(); 
 }
 {
-    t = <USERNAME> { usernames.add(t.image); } 
-    ( <COMMA> t = <USERNAME> { usernames.add(t.image); } )* 
-    { return usernames; }
+    t = <PRINCIPAL> { principals.add(t.image); } 
+    ( <COMMA> t = <PRINCIPAL> { principals.add(t.image); } )* 
+    { return principals; }
 }
 
-void serviceUserStatement() :
+void serviceUserStatement(List<Operation> result) :
 {
     Token t;
-    List<String> usernames;
+    List<String> principals;
 }
 {
-    (t=<CREATE> | t=<DELETE>) <SERVICE> <USER> usernames = usernameList() (<EOL> | <EOF>)
+    (t=<CREATE> | t=<DELETE>) 
+    <SERVICE> <USER> 
+    principals = principalsList() 
+    (<EOL> | <EOF>)
+    
     {
-        for(String username : usernames) {
+        for(String PRINCIPAL : principals) {
             if(CREATE == t.kind) {
-                result.add(new CreateServiceUser(username));
+                result.add(new CreateServiceUser(PRINCIPAL));
             } else {
-                result.add(new DeleteServiceUser(username));
+                result.add(new DeleteServiceUser(PRINCIPAL));
             }
         } 
     }
+}
+
+List<String> namespacedItemsList() :
+{
+    Token t = null;
+    List<String> priv = new ArrayList<String>(); 
+    
+}
+{
+    t = <NAMESPACED_ITEM> { priv.add(t.image); } 
+    ( <COMMA> t = <NAMESPACED_ITEM> { priv.add(t.image); } )* 
+    { return priv; }
+}
+
+List<String> pathsList() :
+{
+    Token t = null;
+    List<String> paths = new ArrayList<String>(); 
+    
+}
+{
+    t = <PATH> { paths.add(t.image); } 
+    ( <COMMA> t = <PATH> { paths.add(t.image); } )* 
+    { return paths; }
+}
+
+void setAclPaths(List<Operation> result) :
+{
+    List<String> paths;
+    List<AclLine> lines = new ArrayList<AclLine>();
+} 
+{
+    <SET> <ACL> <ON> paths  = pathsList() <EOL>
+    ( removeStarLine(lines) | userPrivilegesLine(lines) | blankLine() ) +
+    <END> 
+    ( <EOL> | <EOF> )
+    
+    {
+        result.add(new SetAclPaths(paths, lines));
+    }
+}
+
+void removeStarLine(List<AclLine> lines) : 
+{
+    List<String> tmp = null;
+    AclLine line = new AclLine(AclLine.Action.REMOVE_ALL);
+}
+{
+    <REMOVE> <STAR> 
+    (
+        <FOR> tmp = principalsList() { line.setProperty(PROP_PRINCIPALS, tmp); }
+        
+        | <ON> tmp = pathsList() { line.setProperty(PROP_PATHS, tmp); }
+    )     
+    <EOL>
+    
+    {
+        lines.add(line);
+    }
+}
+
+AclLine privilegesLineOperation() :
+{}
+{
+    ( 
+        <REMOVE>        { return new AclLine(AclLine.Action.REMOVE); }
+        | ( <ALLOW>     { return new AclLine(AclLine.Action.ALLOW); } )
+        | ( <DENY>      { return new AclLine(AclLine.Action.DENY); } )    
+    ) 
+}
+
+void userPrivilegesLine(List<AclLine> lines) :
+{
+    AclLine line;
+    List<String> tmp;
+}
+{
+    line = privilegesLineOperation()
+    tmp = namespacedItemsList() { line.setProperty(PROP_PRIVILEGES, tmp); } 
+    <FOR>
+    tmp = principalsList() { line.setProperty(PROP_PRINCIPALS, tmp); }
+    <EOL>
+
+    {   
+        lines.add(line); 
+    }
+}
+
+void pathPrivilegesLine(List<AclLine> lines) : 
+{
+    AclLine line;
+    List<String> tmp;
+}
+{
+    line = privilegesLineOperation()
+    tmp = namespacedItemsList() { line.setProperty(PROP_PRIVILEGES, tmp); } 
+    <ON> tmp = pathsList() { line.setProperty(PROP_PATHS, tmp); }
+    ( <NODETYPES> tmp = namespacedItemsList() { line.setProperty(PROP_NODETYPES, tmp); }) ?
+    <EOL>
+    
+    {    
+        lines.add(line); 
+    }
+}
+
+void setAclPrincipals(List<Operation> result) :
+{
+    List <String> principals;
+    List<AclLine> lines = new ArrayList<AclLine>();
+}
+{
+    <SET> <ACL> <FOR> principals = principalsList() <EOL>
+    ( removeStarLine(lines) | pathPrivilegesLine(lines) | blankLine() ) +
+    <END> 
+    ( <EOL> | <EOF> )
+    
+    {
+        result.add(new SetAclPrincipals(principals, lines));
+    }
 }
\ No newline at end of file
diff --git a/src/test/java/org/apache/sling/acldef/parser/test/OperationToStringVisitor.java b/src/test/java/org/apache/sling/acldef/parser/test/OperationToStringVisitor.java
new file mode 100644
index 0000000..fb27655
--- /dev/null
+++ b/src/test/java/org/apache/sling/acldef/parser/test/OperationToStringVisitor.java
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.sling.acldef.parser.test;
+
+import java.io.PrintWriter;
+import java.util.Collection;
+
+import org.apache.sling.acldef.parser.operations.AclLine;
+import org.apache.sling.acldef.parser.operations.CreateServiceUser;
+import org.apache.sling.acldef.parser.operations.DeleteServiceUser;
+import org.apache.sling.acldef.parser.operations.OperationVisitor;
+import org.apache.sling.acldef.parser.operations.SetAclPaths;
+import org.apache.sling.acldef.parser.operations.SetAclPrincipals;
+
+/** OperationVisitor that dumps the operations using
+ *  their toString() methods
+ */
+class OperationToStringVisitor implements OperationVisitor {
+
+    private final PrintWriter out;
+    
+    OperationToStringVisitor(PrintWriter pw) {
+        out = pw;
+    }
+    
+    @Override
+    public void visitCreateServiceUser(CreateServiceUser s) {
+        out.println(s.toString());
+    }
+
+    @Override
+    public void visitDeleteServiceUser(DeleteServiceUser s) {
+        out.println(s.toString());
+    }
+
+    @Override
+    public void visitSetAclPrincipal(SetAclPrincipals s) {
+        out.print(s.getClass().getSimpleName());
+        out.print(" for ");
+        for(String p : s.getPrincipals()) {
+            out.print(p);
+            out.print(' ');
+        }
+        out.println();
+        dumpAclLines(s.getLines());
+    }
+    
+    @Override
+    public void visitSetAclPaths(SetAclPaths s) {
+        out.print(s.getClass().getSimpleName());
+        out.print(" on ");
+        for(String p : s.getPaths()) {
+            out.print(p);
+            out.print(' ');
+        }
+        out.println();
+        dumpAclLines(s.getLines());
+    }
+    
+    private void dumpAclLines(Collection<AclLine> c) {
+        for(AclLine line : c) {
+            out.print("  ");
+            out.println(line);
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/test/java/org/apache/sling/acldef/parser/test/ParserTest.java b/src/test/java/org/apache/sling/acldef/parser/test/ParserTest.java
index caccf99..c76fe20 100644
--- a/src/test/java/org/apache/sling/acldef/parser/test/ParserTest.java
+++ b/src/test/java/org/apache/sling/acldef/parser/test/ParserTest.java
@@ -21,6 +21,8 @@ import static org.junit.Assert.assertEquals;
 
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
@@ -29,13 +31,16 @@ import org.apache.commons.io.IOUtils;
 import org.apache.sling.acldef.parser.ACLDefinitions;
 import org.apache.sling.acldef.parser.ParseException;
 import org.apache.sling.acldef.parser.operations.Operation;
+import org.apache.sling.acldef.parser.operations.OperationVisitor;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 import org.junit.runners.Parameterized.Parameters;
 
-/** Test the parser using our test-* 
- *  input/expected output files.
+/** Test the parser using our test-* input/expected output files. 
+ *  The code of this class doesn't contain any actual tests, it
+ *  just looks for test-*.txt files, parses them and verifies the
+ *  results according to the test-*-output.txt files.
  */
 @RunWith(Parameterized.class)
 public class ParserTest {
@@ -105,12 +110,14 @@ public class ParserTest {
     public void checkResult() throws ParseException, IOException {
         final String expected = IOUtils.toString(tc.expected, DEFAULT_ENCODING).trim();
         try {
-            final StringBuilder sb = new StringBuilder();
+            final StringWriter sw = new StringWriter();
+            final OperationVisitor v = new OperationToStringVisitor(new PrintWriter(sw)); 
             final List<Operation> result = new ACLDefinitions(tc.input).parse(); 
             for(Operation o : result) {
-                sb.append(o.toString()).append("\n");
+                o.accept(v);
             }
-            assertEquals(expected, sb.toString().trim());
+            sw.flush();
+            assertEquals(expected, sw.toString().trim());
         } finally {
             tc.close();
         }
diff --git a/src/test/java/org/apache/sling/acldef/parser/test/ParsingErrorsTest.java b/src/test/java/org/apache/sling/acldef/parser/test/ParsingErrorsTest.java
new file mode 100644
index 0000000..37cdbd4
--- /dev/null
+++ b/src/test/java/org/apache/sling/acldef/parser/test/ParsingErrorsTest.java
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.sling.acldef.parser.test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.sling.acldef.parser.ACLDefinitions;
+import org.apache.sling.acldef.parser.ParseException;
+import org.apache.sling.acldef.parser.TokenMgrError;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+/** Test various parsing errors */
+@RunWith(Parameterized.class)
+public class ParsingErrorsTest {
+
+    private String input;
+    private Class<? extends Throwable> expected;
+    
+    @Parameters
+    public static Collection<Object[]> data() {
+        @SuppressWarnings("serial")
+        final List<Object []> result = new ArrayList<Object []>() {{
+            add(new Object[] { "foo", ParseException.class  });
+            add(new Object[] { "12", ParseException.class  });
+            
+            add(new Object[] { "set ACL on /apps \n remove * for u \n end", null });
+            add(new Object[] { "set ACL on /apps \n badkeyword * for u \n end", ParseException.class });
+            add(new Object[] { "set ACL on appsWithoutSlash \n remove * for u \n end", ParseException.class  });
+            add(new Object[] { "set ACL", ParseException.class  });
+            add(new Object[] { "set ACL \n end", ParseException.class  });
+            
+            add(new Object[] { "create service user bob, alice, tom21", null  });
+            add(new Object[] { "create service user bob-221_BOB", null  });
+            add(new Object[] { "create service user bob/221", ParseException.class  });
+            add(new Object[] { "create service user bob,/alice, tom21", ParseException.class  });
+            add(new Object[] { "create service user bob,alice,tom21 # comment not allowed here", TokenMgrError.class  });
+            add(new Object[] { "CREATE service user bob, alice, tom21", ParseException.class });
+            add(new Object[] { "create SERVICE user bob, alice, tom21", ParseException.class });
+        }};
+        return result;
+    }
+    
+    public ParsingErrorsTest(String input, Class<? extends Throwable> expected) {
+        this.input = input;
+        this.expected = expected;
+    }
+
+    @Test
+    public void checkResult() throws ParseException, IOException {
+        final StringReader r = new StringReader(input);
+        try {
+            new ACLDefinitions(r).parse();
+            if(expected != null) {
+                fail("Expected a " + expected.getSimpleName() + " for [" + input + "]");
+            }
+        } catch(Exception e) {
+            assertEquals(expected, e.getClass());
+        } catch(Error err) {
+            assertEquals(expected, err.getClass());
+        } finally {
+            r.close();
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/test/resources/testcases/test-10-output.txt b/src/test/resources/testcases/test-10-output.txt
new file mode 100644
index 0000000..c9106ac
--- /dev/null
+++ b/src/test/resources/testcases/test-10-output.txt
@@ -0,0 +1,5 @@
+SetAclPaths on /libs /apps / /content/example.com/some-other_path 
+  AclLine REMOVE_ALL {principals=[user1, user2]}
+  AclLine ALLOW {principals=[user1, user2], privileges=[jcr:read]}
+  AclLine DENY {principals=[user2], privileges=[jcr:write, something:else, another:one]}
+  AclLine DENY {principals=[user1], privileges=[jcr:lockManagement]}
\ No newline at end of file
diff --git a/src/test/resources/testcases/test-10.txt b/src/test/resources/testcases/test-10.txt
new file mode 100644
index 0000000..db91e9f
--- /dev/null
+++ b/src/test/resources/testcases/test-10.txt
@@ -0,0 +1,10 @@
+# Set ACL example from SLING-5355
+# Without the "with glob" option, we're not planning to support
+# that at this time. 
+set ACL on /libs,/apps, /, /content/example.com/some-other_path
+    remove * for user1,user2
+    allow jcr:read for user1,user2
+
+    deny jcr:write,something:else,another:one for user2
+    deny jcr:lockManagement for user1
+end
\ No newline at end of file
diff --git a/src/test/resources/testcases/test-11-output.txt b/src/test/resources/testcases/test-11-output.txt
new file mode 100644
index 0000000..aceed38
--- /dev/null
+++ b/src/test/resources/testcases/test-11-output.txt
@@ -0,0 +1,5 @@
+SetAclPaths on /libs /apps 
+  AclLine REMOVE_ALL {principals=[user1, user2]}
+  AclLine ALLOW {principals=[user1, user2], privileges=[jcr:read]}
+  AclLine REMOVE_ALL {principals=[another]}
+  AclLine ALLOW {principals=[another], privileges=[x:y]}
\ No newline at end of file
diff --git a/src/test/resources/testcases/test-11.txt b/src/test/resources/testcases/test-11.txt
new file mode 100644
index 0000000..7d27a2a
--- /dev/null
+++ b/src/test/resources/testcases/test-11.txt
@@ -0,0 +1,8 @@
+# Test multiple remove lines
+set ACL on /libs,/apps
+    remove * for user1,user2
+    allow jcr:read for user1,user2
+
+    remove * for another
+    allow x:y for another
+end
\ No newline at end of file
diff --git a/src/test/resources/testcases/test-30-output.txt b/src/test/resources/testcases/test-30-output.txt
new file mode 100644
index 0000000..e619a2f
--- /dev/null
+++ b/src/test/resources/testcases/test-30-output.txt
@@ -0,0 +1,6 @@
+SetAclPrincipals for user1 u2 
+  AclLine REMOVE_ALL {paths=[/libs, /apps]}
+  AclLine ALLOW {paths=[/content], privileges=[jcr:read]}
+  AclLine DENY {paths=[/apps], privileges=[jcr:write]}
+  AclLine DENY {nodetypes=[sling:Folder, nt:unstructured], paths=[/apps, /content], privileges=[jcr:lockManagement]}
+  AclLine REMOVE {paths=[/apps], privileges=[jcr:understand, some:other]}
\ No newline at end of file
diff --git a/src/test/resources/testcases/test-30.txt b/src/test/resources/testcases/test-30.txt
new file mode 100644
index 0000000..c70f928
--- /dev/null
+++ b/src/test/resources/testcases/test-30.txt
@@ -0,0 +1,12 @@
+# Test the principal-centered ACL syntax
+
+set ACL for user1,u2
+    remove * on /libs,/apps
+    allow jcr:read on /content
+
+    deny jcr:write on /apps
+    
+    # Optional nodetypes clause 
+    deny jcr:lockManagement on /apps, /content nodetypes sling:Folder, nt:unstructured   
+    remove jcr:understand,some:other on /apps
+end
\ No newline at end of file
diff --git a/src/test/resources/testcases/test-99-output.txt b/src/test/resources/testcases/test-99-output.txt
new file mode 100644
index 0000000..ec98fc4
--- /dev/null
+++ b/src/test/resources/testcases/test-99-output.txt
@@ -0,0 +1,17 @@
+CreateServiceUser user1
+CreateServiceUser u-ser_2
+SetAclPaths on /libs /apps 
+  AclLine REMOVE_ALL {principals=[user1, u-ser_2]}
+  AclLine ALLOW {principals=[user1, u-ser_2], privileges=[jcr:read]}
+  AclLine DENY {principals=[u-ser_2], privileges=[jcr:write]}
+  AclLine DENY {principals=[user1], privileges=[jcr:lockManagement]}
+  AclLine REMOVE {principals=[u3], privileges=[jcr:understand, some:other]}
+CreateServiceUser bob_the_service
+SetAclPaths on /tmp 
+  AclLine ALLOW {principals=[bob_the_service], privileges=[some:otherPrivilege]}
+SetAclPrincipals for alice bob fred 
+  AclLine REMOVE_ALL {paths=[/]}
+  AclLine ALLOW {paths=[/content, /var], privileges=[jcr:read]}
+  AclLine DENY {paths=[/content/example.com], privileges=[jcr:write]}
+  AclLine DENY {nodetypes=[example:Page], paths=[/], privileges=[jcr:all]}
+CreateServiceUser the-last-one
\ No newline at end of file
diff --git a/src/test/resources/testcases/test-99.txt b/src/test/resources/testcases/test-99.txt
new file mode 100644
index 0000000..67e0949
--- /dev/null
+++ b/src/test/resources/testcases/test-99.txt
@@ -0,0 +1,28 @@
+# Complete example with several intermixed statement types
+
+create service user user1, u-ser_2
+set ACL on /libs,/apps
+    remove * for user1,u-ser_2
+    allow jcr:read for user1,u-ser_2
+
+    deny jcr:write for u-ser_2
+    deny jcr:lockManagement for user1
+    remove jcr:understand,some:other for u3
+end
+
+create service user bob_the_service
+
+# Verify that indent is not required
+set ACL on /tmp
+allow some:otherPrivilege for bob_the_service
+end
+
+set ACL for alice, bob,fred
+    remove * on /
+    allow jcr:read on /content,/var
+    deny jcr:write on /content/example.com
+    deny jcr:all on / nodetypes example:Page
+    
+end
+
+create service user the-last-one
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.