You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ol...@apache.org on 2021/06/22 10:23:30 UTC

[sling-org-apache-sling-scripting-groovy] branch master updated (626e2fb -> 0a2d14a)

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

olli pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-groovy.git.


    from 626e2fb  suppress warnings for rule java:S1149
     new 1a8c829  SLING-10521 Update to Sling Bundle Parent 43
     new 0a2d14a  SLING-9702 Enable code coverage with JaCoCo

The 2 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.


Summary of changes:
 pom.xml                                            | 45 ++--------------------
 .../scripting/groovy/it/GroovyTestSupport.java     | 14 ++++++-
 2 files changed, 17 insertions(+), 42 deletions(-)

[sling-org-apache-sling-scripting-groovy] 02/02: SLING-9702 Enable code coverage with JaCoCo

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

olli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-groovy.git

commit 0a2d14a97011c6db149f9d544142dd13fbea20df
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Tue Jun 22 12:23:03 2021 +0200

    SLING-9702 Enable code coverage with JaCoCo
    
    inherit system properties from parent and check command
---
 pom.xml                                            | 35 ++--------------------
 .../scripting/groovy/it/GroovyTestSupport.java     | 14 ++++++++-
 2 files changed, 16 insertions(+), 33 deletions(-)

diff --git a/pom.xml b/pom.xml
index 58ccef5..093d6bf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -64,41 +64,12 @@
         </executions>
         <configuration>
           <redirectTestOutputToFile>true</redirectTestOutputToFile>
-          <systemProperties>
-            <property>
-              <name>bundle.filename</name>
-              <value>${basedir}/target/${project.build.finalName}.jar</value>
-            </property>
-            <property>
-              <name>jacoco.command</name>
-              <value>${jacoco.command}</value>
-            </property>
-          </systemProperties>
+          <systemPropertyVariables combine.children="append">
+            <bundle.filename>${basedir}/target/${project.build.finalName}.jar</bundle.filename>
+          </systemPropertyVariables>
         </configuration>
       </plugin>
       <plugin>
-        <groupId>org.jacoco</groupId>
-        <artifactId>jacoco-maven-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>prepare-agent</id>
-            <configuration>
-              <propertyName>jacoco.command</propertyName>
-            </configuration>
-            <goals>
-              <goal>prepare-agent</goal>
-            </goals>
-          </execution>
-          <execution>
-            <id>report</id>
-            <phase>post-integration-test</phase>
-            <goals>
-              <goal>report</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
         <groupId>org.apache.servicemix.tooling</groupId>
         <artifactId>depends-maven-plugin</artifactId>
       </plugin>
diff --git a/src/test/java/org/apache/sling/scripting/groovy/it/GroovyTestSupport.java b/src/test/java/org/apache/sling/scripting/groovy/it/GroovyTestSupport.java
index ba2e338..19cdbac 100644
--- a/src/test/java/org/apache/sling/scripting/groovy/it/GroovyTestSupport.java
+++ b/src/test/java/org/apache/sling/scripting/groovy/it/GroovyTestSupport.java
@@ -18,6 +18,8 @@
  */
 package org.apache.sling.scripting.groovy.it;
 
+import java.util.Objects;
+
 import javax.inject.Inject;
 import javax.script.ScriptEngineFactory;
 
@@ -32,6 +34,8 @@ import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.ProbeBuilder;
 import org.ops4j.pax.exam.TestProbeBuilder;
 import org.ops4j.pax.exam.options.ModifiableCompositeOption;
+import org.ops4j.pax.exam.options.OptionalCompositeOption;
+import org.ops4j.pax.exam.options.extra.VMOption;
 import org.ops4j.pax.exam.util.Filter;
 import org.osgi.service.http.HttpService;
 
@@ -43,6 +47,7 @@ import static org.ops4j.pax.exam.CoreOptions.composite;
 import static org.ops4j.pax.exam.CoreOptions.junitBundles;
 import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
 import static org.ops4j.pax.exam.CoreOptions.vmOption;
+import static org.ops4j.pax.exam.CoreOptions.when;
 
 public class GroovyTestSupport extends TestSupport {
 
@@ -84,10 +89,17 @@ public class GroovyTestSupport extends TestSupport {
             mavenBundle().groupId("org.jsoup").artifactId("jsoup").versionAsInProject(),
             mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.hamcrest").versionAsInProject(),
             junitBundles(),
-            vmOption(System.getProperty("jacoco.command"))
+            jacoco() // remove with Testing PaxExam 4.0
         );
     }
 
+    // remove with Testing PaxExam 4.0
+    protected OptionalCompositeOption jacoco() {
+        final String jacocoCommand = System.getProperty("jacoco.command");
+        final VMOption option = Objects.nonNull(jacocoCommand) && !jacocoCommand.trim().isEmpty() ? vmOption(jacocoCommand) : null;
+        return when(Objects.nonNull(option)).useOptions(option);
+    }
+
     @ProbeBuilder
     public TestProbeBuilder probeConfiguration(final TestProbeBuilder testProbeBuilder) {
         testProbeBuilder.setHeader(Constants.EXPORT_PACKAGE, "org.apache.sling.scripting.groovy.it.app");

[sling-org-apache-sling-scripting-groovy] 01/02: SLING-10521 Update to Sling Bundle Parent 43

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

olli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-groovy.git

commit 1a8c829540eb8df98c00a974e0b98e525ccc8dc3
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Tue Jun 22 12:15:35 2021 +0200

    SLING-10521 Update to Sling Bundle Parent 43
---
 pom.xml | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/pom.xml b/pom.xml
index d0940a4..58ccef5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.apache.sling</groupId>
     <artifactId>sling-bundle-parent</artifactId>
-    <version>38</version>
+    <version>43</version>
     <relativePath />
   </parent>
 
@@ -52,14 +52,6 @@
   <build>
     <plugins>
       <plugin>
-        <groupId>biz.aQute.bnd</groupId>
-        <artifactId>bnd-maven-plugin</artifactId>
-      </plugin>
-      <plugin>
-        <groupId>biz.aQute.bnd</groupId>
-        <artifactId>bnd-baseline-maven-plugin</artifactId>
-      </plugin>
-      <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-failsafe-plugin</artifactId>
         <executions>