You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2021/08/24 15:52:04 UTC

[sling-org-apache-sling-feature-analyser] 01/01: SLING-10749 - update to org.apache.sling.repoinit.parser 1.6.10 and add test statements that fail if not updated

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

bdelacretaz pushed a commit to branch SLING-10749
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-analyser.git

commit 55fd2d01211f42f2ed1b6e0d2b0a706cbc1435c2
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Tue Aug 24 17:50:34 2021 +0200

    SLING-10749 - update to org.apache.sling.repoinit.parser 1.6.10 and add test statements that fail if not updated
---
 pom.xml                                                       |  2 +-
 .../sling/feature/analyser/task/impl/CheckRepoinitTest.java   | 11 +++++++----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/pom.xml b/pom.xml
index 98f65d8..80e16e4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -155,7 +155,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.repoinit.parser</artifactId>
-            <version>1.6.8</version>
+            <version>1.6.10</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
diff --git a/src/test/java/org/apache/sling/feature/analyser/task/impl/CheckRepoinitTest.java b/src/test/java/org/apache/sling/feature/analyser/task/impl/CheckRepoinitTest.java
index 74a87c6..e5168ab 100644
--- a/src/test/java/org/apache/sling/feature/analyser/task/impl/CheckRepoinitTest.java
+++ b/src/test/java/org/apache/sling/feature/analyser/task/impl/CheckRepoinitTest.java
@@ -29,6 +29,9 @@ import org.junit.Test;
 
 public class CheckRepoinitTest {
 
+    public static final String VALID_STATEMENT = "create path /acltest/A/B \n delete ACL for testing";
+    public static final String INVALID_STATEMENT = "create spaceship";
+
     @Test public void testValidExtension() throws Exception {
         final AnalyserTaskContextImpl ctx = new AnalyserTaskContextImpl();
         final AnalyserTask task = new CheckRepoinit();
@@ -40,7 +43,7 @@ public class CheckRepoinitTest {
         // create valid extension
         final Extension ext = new Extension(ExtensionType.TEXT, Extension.EXTENSION_NAME_REPOINIT, ExtensionState.OPTIONAL);
         ctx.getFeature().getExtensions().add(ext);
-        ext.setText("create path /acltest/A/B");
+        ext.setText(VALID_STATEMENT);
 
         task.execute(ctx);
         assertTrue(ctx.getErrors().isEmpty());
@@ -64,7 +67,7 @@ public class CheckRepoinitTest {
 
         // invalid repoinit
         final Extension ext = new Extension(ExtensionType.TEXT, Extension.EXTENSION_NAME_REPOINIT, ExtensionState.OPTIONAL);
-        ext.setText("create spaceship");
+        ext.setText(INVALID_STATEMENT);
         ctx.getFeature().getExtensions().add(ext);
 
         task.execute(ctx);
@@ -76,7 +79,7 @@ public class CheckRepoinitTest {
         final AnalyserTask task = new CheckRepoinit();
 
         final Configuration cfg = new Configuration(CheckRepoinit.FACTORY_PID.concat("~name"));
-        cfg.getProperties().put("scripts", "create path /acltest/A/B");
+        cfg.getProperties().put("scripts", VALID_STATEMENT);
         ctx.getFeature().getConfigurations().add(cfg);
 
         task.execute(ctx);
@@ -88,7 +91,7 @@ public class CheckRepoinitTest {
         final AnalyserTask task = new CheckRepoinit();
 
         final Configuration cfg = new Configuration(CheckRepoinit.FACTORY_PID.concat("~name"));
-        cfg.getProperties().put("scripts", "create spaceship");
+        cfg.getProperties().put("scripts", INVALID_STATEMENT);
         ctx.getFeature().getConfigurations().add(cfg);
 
         task.execute(ctx);