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

bdelacretaz pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-repoinit-parser.git


The following commit(s) were added to refs/heads/master by this push:
     new 5c979d3  SLING-10252 Add automated tests to the repoinit parser
     new 44a75b0  Merge pull request #8 from enapps-enorman/issue/SLING-10252
5c979d3 is described below

commit 5c979d381d4b9bfee95b0b7b85de75408794c422
Author: Eric Norman <[email protected]>
AuthorDate: Mon Mar 22 12:59:51 2021 -0700

    SLING-10252 Add automated tests to the repoinit parser
    
    To test changes needed for SLING-10192
---
 src/test/resources/testcases/test-67-output.txt | 10 +++++++++-
 src/test/resources/testcases/test-67.txt        | 17 ++++++++++++++++-
 src/test/resources/testcases/test-99-output.txt |  6 ++++++
 src/test/resources/testcases/test-99.txt        | 11 +++++++++++
 4 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/src/test/resources/testcases/test-67-output.txt 
b/src/test/resources/testcases/test-67-output.txt
index 3a0165d..76ae32c 100644
--- a/src/test/resources/testcases/test-67-output.txt
+++ b/src/test/resources/testcases/test-67-output.txt
@@ -17,4 +17,12 @@ SetProperties on /test/curly/brackets
   PropertyLine curlyBracketsAndSingleQuotes{String}=[{String}{'five, 
six':'seven,eight'}]
 SetProperties on /endkeyword
   PropertyLine endS{String}=[{String}one]
-  PropertyLine two{String}=[{String}endS]
\ No newline at end of file
+  PropertyLine two{String}=[{String}endS]
+SetProperties on :authorizable:bob#
+  PropertyLine stringProp{String}=[{String}hello, you!]
+SetProperties on :authorizable:bob#/nested
+  PropertyLine stringProp{String}=[{String}hello, you nested!]
+SetProperties on :authorizable:bob# :authorizable:alice#
+  PropertyLine stringProp{String}=[{String}hello, you again!]
+SetProperties on :authorizable:bob#/nested :authorizable:alice#/nested
+  PropertyLine stringProp{String}=[{String}hello, you nested again!]
diff --git a/src/test/resources/testcases/test-67.txt 
b/src/test/resources/testcases/test-67.txt
index 35c2046..5fc7358 100644
--- a/src/test/resources/testcases/test-67.txt
+++ b/src/test/resources/testcases/test-67.txt
@@ -26,4 +26,19 @@ set properties on /endkeyword
   # using "end" instead of "endS" below causes parsing to fail
   set endS to one
   set two to endS
-end
\ No newline at end of file
+end
+
+# SLING-10252 set properties on the user or group profile
+set properties on authorizable(bob)
+  set stringProp to "hello, you!"
+end
+set properties on authorizable(bob)/nested
+  set stringProp to "hello, you nested!"
+end
+
+set properties on authorizable(bob), authorizable(alice)
+  set stringProp to "hello, you again!"
+end
+set properties on authorizable(bob)/nested, authorizable(alice)/nested
+  set stringProp to "hello, you nested again!"
+end
diff --git a/src/test/resources/testcases/test-99-output.txt 
b/src/test/resources/testcases/test-99-output.txt
index 7def1e7..f721235 100644
--- a/src/test/resources/testcases/test-99-output.txt
+++ b/src/test/resources/testcases/test-99-output.txt
@@ -64,3 +64,9 @@ SetProperties on /pathA /path/B
   PropertyLine someFlag{Boolean}=[{Boolean}true]
   PropertyLine default 
someDate{Date}=[{GregorianCalendar}2020-03-19T11:39:33.437+05:30]
   PropertyLine quotedMix{String}=[{String}quoted, {String}non-quoted, 
{String}the last " one]
+SetProperties on :authorizable:bob# :authorizable:grpB#/nested
+  PropertyLine someString{String}=[{String}/x/y/z]
+  PropertyLine default someInteger{Long}=[{Long}42]
+  PropertyLine someFlag{Boolean}=[{Boolean}true]
+  PropertyLine default 
someDate{Date}=[{GregorianCalendar}2020-03-19T11:39:33.437+05:30]
+  PropertyLine quotedMix{String}=[{String}quoted, {String}non-quoted, 
{String}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
index 227adef..d95637c 100644
--- a/src/test/resources/testcases/test-99.txt
+++ b/src/test/resources/testcases/test-99.txt
@@ -118,3 +118,14 @@ set properties on /pathA, /path/B
   set quotedMix to "quoted", non-quoted, "the last \" one"
 end
 
+# Set properties on users or groups, since V1.6.8
+# 'set' overwrites any existing value while
+# 'default' only sets the property if not set yet
+set properties on authorizable(bob), authorizable(grpB)/nested
+  set someString{String} to /x/y/z
+  default someInteger{Long} to 42
+  set someFlag{Boolean} to true
+  default someDate{Date} to "2020-03-19T11:39:33.437+05:30"
+  set quotedMix to "quoted", non-quoted, "the last \" one"
+end
+

Reply via email to