You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by kw...@apache.org on 2020/11/09 18:34:42 UTC

[sling-slingfeature-maven-plugin] 01/01: SLING-9886 convert ITs post-execution script from Beanshell to Groovy

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

kwin pushed a commit to branch feature/it-verify-with-groovy
in repository https://gitbox.apache.org/repos/asf/sling-slingfeature-maven-plugin.git

commit 07edad87daf9089987886e421662dd9b02876961
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Mon Nov 9 19:34:24 2020 +0100

    SLING-9886 convert ITs post-execution script from Beanshell to Groovy
    
    Only the array initializers were converted from Java to Groovy style,
    the rest was left untouched.
    
    The changes exposes some actual IT failures
---
 .../{verify.bsh => verify.groovy}                  |  0
 .../{verify.bsh => verify.groovy}                  |  0
 src/it/apis-jar-cnd/{verify.bsh => verify.groovy}  |  0
 .../{verify.bsh => verify.groovy}                  |  0
 .../{verify.bsh => verify.groovy}                  |  0
 .../{verify.bsh => verify.groovy}                  |  4 ++--
 src/it/apis-jar/{verify.bsh => verify.groovy}      | 24 +++++++++++-----------
 .../{verify.bsh => verify.groovy}                  |  4 ++--
 .../{verify.bsh => verify.groovy}                  |  4 ++--
 .../{verify.bsh => verify.groovy}                  |  4 ++--
 .../{verify.bsh => verify.groovy}                  |  4 ++--
 .../{verify.bsh => verify.groovy}                  |  4 ++--
 .../{verify.bsh => verify.groovy}                  |  4 ++--
 .../{verify.bsh => verify.groovy}                  |  4 ++--
 .../{verify.bsh => verify.groovy}                  |  4 ++--
 15 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/src/it/analyzer-apiregions-errors-detected/verify.bsh b/src/it/analyzer-apiregions-errors-detected/verify.groovy
similarity index 100%
rename from src/it/analyzer-apiregions-errors-detected/verify.bsh
rename to src/it/analyzer-apiregions-errors-detected/verify.groovy
diff --git a/src/it/analyzer-errors-detected/verify.bsh b/src/it/analyzer-errors-detected/verify.groovy
similarity index 100%
rename from src/it/analyzer-errors-detected/verify.bsh
rename to src/it/analyzer-errors-detected/verify.groovy
diff --git a/src/it/apis-jar-cnd/verify.bsh b/src/it/apis-jar-cnd/verify.groovy
similarity index 100%
rename from src/it/apis-jar-cnd/verify.bsh
rename to src/it/apis-jar-cnd/verify.groovy
diff --git a/src/it/apis-jar-exported-package-no-classes/verify.bsh b/src/it/apis-jar-exported-package-no-classes/verify.groovy
similarity index 100%
rename from src/it/apis-jar-exported-package-no-classes/verify.bsh
rename to src/it/apis-jar-exported-package-no-classes/verify.groovy
diff --git a/src/it/apis-jar-wrapped-flattened-classes/verify.bsh b/src/it/apis-jar-wrapped-flattened-classes/verify.groovy
similarity index 100%
rename from src/it/apis-jar-wrapped-flattened-classes/verify.bsh
rename to src/it/apis-jar-wrapped-flattened-classes/verify.groovy
diff --git a/src/it/apis-jar-wrapper-bundle/verify.bsh b/src/it/apis-jar-wrapper-bundle/verify.groovy
similarity index 97%
rename from src/it/apis-jar-wrapper-bundle/verify.bsh
rename to src/it/apis-jar-wrapper-bundle/verify.groovy
index de37f51..8a37926 100644
--- a/src/it/apis-jar-wrapper-bundle/verify.bsh
+++ b/src/it/apis-jar-wrapper-bundle/verify.groovy
@@ -45,13 +45,13 @@ import org.codehaus.plexus.util.*;
                 return false;
             }
 
-            for (String expectedEntry : new String[] {
+            for (String expectedEntry : [
                 "com/google/gson/stream/JsonReader.class",
                 "com/google/gson/stream/JsonScope.class",
                 "com/google/gson/stream/JsonToken.class",
                 "com/google/gson/stream/JsonWriter.class",
                 "com/google/gson/stream/MalformedJsonException.class"
-            }) {
+            ]) {
                 if (jarFile.getJarEntry(expectedEntry) == null) {
                     System.out.println("FAILED!");
                     System.out.println("Entry '" + expectedEntry + "' does not exist in bundle " + baseApiJar);
diff --git a/src/it/apis-jar/verify.bsh b/src/it/apis-jar/verify.groovy
similarity index 91%
rename from src/it/apis-jar/verify.bsh
rename to src/it/apis-jar/verify.groovy
index d45936b..a792edc 100644
--- a/src/it/apis-jar/verify.bsh
+++ b/src/it/apis-jar/verify.groovy
@@ -62,24 +62,24 @@ import org.codehaus.plexus.util.*;
 
         File baseApiJar = new File(apisJarDir, "slingfeature-maven-plugin-test-1.0.0-SNAPSHOT-base-apis.jar");
         if (!checkBundle(baseApiJar,
-                         new String[] {
+                        [
                              "org.apache.felix.inventory;version=1.0",
                              "org.apache.felix.metatype;uses:=\"org.osgi.framework,org.osgi.service.metatype\";version=1.2.0"
-                         },
-                         new String[] {
+                         ],
+                         [
                              "org/apache/felix/metatype/",
                              "org/apache/felix/inventory/"
-                         })) {
+                         ])) {
             return false;
         }
 
         File baseSourcesJar = new File(apisJarDir, "slingfeature-maven-plugin-test-1.0.0-SNAPSHOT-base-sources.jar");
         if (!checkBundle(baseSourcesJar,
                          null,
-                         new String[] {
+                         [
                              "org/apache/felix/metatype/",
                              "org/apache/felix/inventory/"
-                         })) {
+                         ])) {
             return false;
         }
 
@@ -87,30 +87,30 @@ import org.codehaus.plexus.util.*;
 
         File extendedApiJar = new File(apisJarDir, "slingfeature-maven-plugin-test-1.0.0-SNAPSHOT-extended-apis.jar");
         if (!checkBundle(extendedApiJar,
-                         new String[] {
+                         [
                              "org.apache.felix.inventory;version=1.0",
                              "org.apache.felix.metatype;uses:=\"org.osgi.framework,org.osgi.service.metatype\";version=1.2.0",
                              "org.apache.felix.scr.component;uses:=org.osgi.service.component;version=1.1.0",
                              "org.apache.felix.scr.info;version=1.0.0"
-                         },
-                         new String[] {
+                         ],
+                         [
                              "org/apache/felix/metatype/",
                              "org/apache/felix/inventory/",
                              "org/apache/felix/scr/component/",
                              "org/apache/felix/scr/info/"
-                         })) {
+                         ])) {
             return false;
         }
 
         File extendedSourcesJar = new File(apisJarDir, "slingfeature-maven-plugin-test-1.0.0-SNAPSHOT-extended-sources.jar");
         if (!checkBundle(extendedApiJar,
                          null,
-                         new String[] {
+                         [
                              "org/apache/felix/metatype/",
                              "org/apache/felix/inventory/",
                              "org/apache/felix/scr/component/",
                              "org/apache/felix/scr/info/"
-                         })) {
+                         ])) {
             return false;
         }
 
diff --git a/src/it/attach-metadata-from-pom/verify.bsh b/src/it/attach-metadata-from-pom/verify.groovy
similarity index 97%
rename from src/it/attach-metadata-from-pom/verify.bsh
rename to src/it/attach-metadata-from-pom/verify.groovy
index aed053c..9b10f7f 100644
--- a/src/it/attach-metadata-from-pom/verify.bsh
+++ b/src/it/attach-metadata-from-pom/verify.groovy
@@ -20,12 +20,12 @@ import java.util.*;
      boolean check() {
         File file = new File(basedir, "target/slingfeature-tmp/feature-slingtest.json");
         String log = FileUtils.fileRead(file);
-         String[] values = {
+         String[] values = [
             "\"title\":\"Apache Sling Features Maven plugin test\"",
             "\"description\":\"This is just an Apache Sling Features Maven plugin test to verify added metadata\"",
             "\"vendor\":\"The Apache Sling Team\"",
             "\"license\":\"Apache License, Version 2.0\""
-        };
+        ];
          for (String value : values) {
             if (log.indexOf(value) < 0) {
                 System.out.println("FAILED!");
diff --git a/src/it/include-artifact-including-source-features-folder/verify.bsh b/src/it/include-artifact-including-source-features-folder/verify.groovy
similarity index 98%
rename from src/it/include-artifact-including-source-features-folder/verify.bsh
rename to src/it/include-artifact-including-source-features-folder/verify.groovy
index 1e3156f..9b6baab 100644
--- a/src/it/include-artifact-including-source-features-folder/verify.bsh
+++ b/src/it/include-artifact-including-source-features-folder/verify.groovy
@@ -49,13 +49,13 @@ import org.codehaus.plexus.util.*;
         String dependentGroup = "org.codehaus.janino";
         String dependentArtifact = "janino";
         String dependentVersion = "2.7.5";
-        String[] values = {
+        String[] values = [
             "\"id\":\"" + group + ":" + artifact + ":slingosgifeature:" + classifier + ":" + version + "\"",
             "\"bundles\":[",
             group + ":" + artifact + ":" + version + "\"",
             "\"repoinit:TEXT|true\":[",
             "\"create path (rep:AuthorizableFolder) /home/users/system\""
-        };
+        ];
         for (String value : values) {
             if (fmContent.indexOf(value) < 0) {
                 System.out.println("Did not find line: " + value + " -> FAILED!");
diff --git a/src/it/include-artifact-including-source-features/verify.bsh b/src/it/include-artifact-including-source-features/verify.groovy
similarity index 98%
rename from src/it/include-artifact-including-source-features/verify.bsh
rename to src/it/include-artifact-including-source-features/verify.groovy
index 11c32c2..89dc6b4 100644
--- a/src/it/include-artifact-including-source-features/verify.bsh
+++ b/src/it/include-artifact-including-source-features/verify.groovy
@@ -48,13 +48,13 @@ import org.codehaus.plexus.util.*;
         String dependentGroup = "org.codehaus.janino";
         String dependentArtifact = "janino";
         String dependentVersion = "2.7.5";
-        String[] values = {
+        String[] values = [
             "\"id\":\"" + group + ":" + artifact + ":slingosgifeature:" + version + "\"",
             "\"bundles\":[",
             group + ":" + artifact + ":" + version + "\"",
             "\"repoinit:TEXT|true\":[",
             "\"create path (rep:AuthorizableFolder) /home/users/system\""
-        };
+        ];
         for (String value : values) {
             if (fmContent.indexOf(value) < 0) {
                 System.out.println("Did not find line: " + value + " -> FAILED!");
diff --git a/src/it/include-artifact-no-classifier/verify.bsh b/src/it/include-artifact-no-classifier/verify.groovy
similarity index 98%
rename from src/it/include-artifact-no-classifier/verify.bsh
rename to src/it/include-artifact-no-classifier/verify.groovy
index ff20d96..07b9515 100644
--- a/src/it/include-artifact-no-classifier/verify.bsh
+++ b/src/it/include-artifact-no-classifier/verify.groovy
@@ -48,12 +48,12 @@ import org.codehaus.plexus.util.*;
         String dependentGroup = "org.codehaus.janino";
         String dependentArtifact = "janino";
         String dependentVersion = "2.7.5";
-        String[] values = {
+        String[] values = [
             "\"id\":\"" + group + ":" + artifact + ":slingosgifeature:" + version + "\"",
             "\"bundles\":[",
             group + ":" + artifact + ":" + version + "\"",
             dependentGroup + ":" + dependentArtifact + ":" + dependentVersion + "\"",
-        };
+        ];
         for (String value : values) {
             if (fmContent.indexOf(value) < 0) {
                 System.out.println("Did not find line: " + value + " -> FAILED!");
diff --git a/src/it/include-artifact-simple/verify.bsh b/src/it/include-artifact-simple/verify.groovy
similarity index 98%
rename from src/it/include-artifact-simple/verify.bsh
rename to src/it/include-artifact-simple/verify.groovy
index b87c4ea..be2adb1 100644
--- a/src/it/include-artifact-simple/verify.bsh
+++ b/src/it/include-artifact-simple/verify.groovy
@@ -49,12 +49,12 @@ import org.codehaus.plexus.util.*;
         String dependentGroup = "org.codehaus.janino";
         String dependentArtifact = "janino";
         String dependentVersion = "2.7.5";
-        String[] values = {
+        String[] values = [
             "\"id\":\"" + group + ":" + artifact + ":slingosgifeature:" + classifier + ":" + version + "\"",
             "\"bundles\":[",
             group + ":" + artifact + ":" + version + "\"",
             dependentGroup + ":" + dependentArtifact + ":" + dependentVersion + "\"",
-        };
+        ];
         for (String value : values) {
             if (fmContent.indexOf(value) < 0) {
                 System.out.println("Did not find line: " + value + " -> FAILED!");
diff --git a/src/it/include-artifact-start-order/verify.bsh b/src/it/include-artifact-start-order/verify.groovy
similarity index 98%
rename from src/it/include-artifact-start-order/verify.bsh
rename to src/it/include-artifact-start-order/verify.groovy
index 5129e84..9dc6e72 100644
--- a/src/it/include-artifact-start-order/verify.bsh
+++ b/src/it/include-artifact-start-order/verify.groovy
@@ -49,12 +49,12 @@ import org.codehaus.plexus.util.*;
         String dependentGroup = "org.codehaus.janino";
         String dependentArtifact = "janino";
         String dependentVersion = "2.7.5";
-        String[] values = {
+        String[] values = [
             "\"id\":\"" + group + ":" + artifact + ":slingosgifeature:" + classifier + ":" + version + "\"",
             "\"bundles\":[",
             group + ":" + artifact + ":" + version + "\"",
             "\"id\":\"" + dependentGroup + ":" + dependentArtifact + ":" + dependentVersion + "\"",
-        };
+        ];
         for (String value : values) {
             if (fmContent.indexOf(value) < 0) {
                 System.out.println("Did not find line: " + value + " -> FAILED!");
diff --git a/src/it/schema-validation-ko/verify.bsh b/src/it/schema-validation-ko/verify.groovy
similarity index 97%
rename from src/it/schema-validation-ko/verify.bsh
rename to src/it/schema-validation-ko/verify.groovy
index e41e362..c5b26c7 100644
--- a/src/it/schema-validation-ko/verify.bsh
+++ b/src/it/schema-validation-ko/verify.groovy
@@ -20,10 +20,10 @@ import java.util.*;
      boolean check() {
         File file = new File(basedir, "build.log");
         String log = FileUtils.fileRead(file);
-         String[] values = {
+         String[] values = [
             " * /definitions/Bundle: instance type (boolean) does not match any allowed primitive type (allowed: [\"object\",\"string\"])",
             " * /properties/model-version: instance type (integer) does not match any allowed primitive type (allowed: [\"string\"])"
-        };
+         ];
          for (String value : values) {
             if (log.indexOf(value) < 0) {
                 System.out.println("FAILED!");
diff --git a/src/it/variables-interpolator/verify.bsh b/src/it/variables-interpolator/verify.groovy
similarity index 98%
rename from src/it/variables-interpolator/verify.bsh
rename to src/it/variables-interpolator/verify.groovy
index a5a9568..07cad6b 100644
--- a/src/it/variables-interpolator/verify.bsh
+++ b/src/it/variables-interpolator/verify.groovy
@@ -24,7 +24,7 @@ import org.codehaus.plexus.util.*;
         File file = new File(basedir, "target/slingfeature-tmp/feature-slingtest.json");
         String log = FileUtils.fileRead(file);
 
-        String[] values = {
+        String[] values = [
             "\"id\":\"org.apache.sling:slingfeature-maven-plugin-test:slingfeature:slingtest:1.0.0-SNAPSHOT\"",
             "\"title\":\"Apache Sling Features Maven plugin test\"",
             "\"description\":\"This is just an Apache Sling Features Maven plugin test to verify variables interpolation\"",
@@ -36,7 +36,7 @@ import org.codehaus.plexus.util.*;
             "\"sling.framework.install.startlevel\":\"1\"",
             "\"sling.ignoreSystemProperties\":\"true\"",
             "\"id\":\"org.osgi:org.osgi.framework:1.9.0\""
-        };
+        ];
 
         for (String value : values) {
             if (log.indexOf(value) < 0) {