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 2019/06/15 19:21:07 UTC

[sling-org-apache-sling-scripting-core] branch master updated: SLING-8512 Make testing compliant with Java 9 and higher

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-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 56284b5  SLING-8512 Make testing compliant with Java 9 and higher
56284b5 is described below

commit 56284b5eab2090b9f0456579e8de0a00b657074d
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Sat Jun 15 21:19:34 2019 +0200

    SLING-8512 Make testing compliant with Java 9 and higher
    
    * Update Pax Exam to 4.13.1
    * Update Testing PaxExam to 3.0.0
    * Update Felix Framework to 6.0.3
    * Remove workaround
---
 pom.xml                                            |  6 ++---
 .../core/it/ScriptingCoreTestSupport.java          | 31 +---------------------
 2 files changed, 4 insertions(+), 33 deletions(-)

diff --git a/pom.xml b/pom.xml
index cea607d..e7d0e42 100644
--- a/pom.xml
+++ b/pom.xml
@@ -36,7 +36,7 @@
     </description>
 
     <properties>
-        <org.ops4j.pax.exam.version>4.11.0</org.ops4j.pax.exam.version>
+        <org.ops4j.pax.exam.version>4.13.1</org.ops4j.pax.exam.version>
     </properties>
 
     <scm>
@@ -151,7 +151,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.paxexam</artifactId>
-            <version>0.0.4</version>
+            <version>3.0.0</version>
             <scope>test</scope>
         </dependency>
         <!-- OSGi -->
@@ -215,7 +215,7 @@
         <dependency>
             <groupId>org.apache.felix</groupId>
             <artifactId>org.apache.felix.framework</artifactId>
-            <version>5.6.10</version>
+            <version>6.0.3</version>
             <scope>test</scope>
         </dependency>
 
diff --git a/src/test/java/org/apache/sling/scripting/core/it/ScriptingCoreTestSupport.java b/src/test/java/org/apache/sling/scripting/core/it/ScriptingCoreTestSupport.java
index c5c9fd7..9fd446c 100644
--- a/src/test/java/org/apache/sling/scripting/core/it/ScriptingCoreTestSupport.java
+++ b/src/test/java/org/apache/sling/scripting/core/it/ScriptingCoreTestSupport.java
@@ -18,8 +18,6 @@
  */
 package org.apache.sling.scripting.core.it;
 
-import java.util.Arrays;
-
 import org.apache.sling.testing.paxexam.TestSupport;
 import org.ops4j.pax.exam.Configuration;
 import org.ops4j.pax.exam.Option;
@@ -28,10 +26,8 @@ import static org.apache.sling.testing.paxexam.SlingOptions.sling;
 import static org.apache.sling.testing.paxexam.SlingOptions.versionResolver;
 import static org.apache.sling.testing.paxexam.SlingOptions.webconsole;
 import static org.ops4j.pax.exam.CoreOptions.composite;
-import static org.ops4j.pax.exam.CoreOptions.frameworkProperty;
 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.cm.ConfigurationAdminOptions.factoryConfiguration;
 import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.newConfiguration;
 
@@ -39,7 +35,7 @@ public class ScriptingCoreTestSupport extends TestSupport {
 
     @Configuration
     public Option[] configuration() {
-        Option[] configuration = new Option[]{
+        return new Option[]{
             baseConfiguration(),
             launchpad(),
             // Sling Scripting Core
@@ -56,35 +52,10 @@ public class ScriptingCoreTestSupport extends TestSupport {
             // testing
             junitBundles()
         };
-        try {
-            int javaVersion = Integer.parseInt(System.getProperty("java.specification.version"));
-            if (javaVersion >= 9 && javaVersion < 11) {
-                configuration = Arrays.copyOf(configuration, configuration.length + 1);
-                configuration[configuration.length - 1] = vmOption("--add-modules=java.se.ee");
-            }
-            if (javaVersion >= 11) {
-                configuration = Arrays.copyOf(configuration, configuration.length + 1);
-                configuration[configuration.length -1] = composite(
-                        frameworkProperty("org.osgi.framework.system.packages.extra")
-                                .value("javax.xml.stream;version=\"1.1.0\",javax.xml.stream.events;" +
-                                        "version=\"1.1.0\""),
-                        mavenBundle("org.apache.geronimo.specs", "geronimo-annotation_1.3_spec", "1.1"),
-                        mavenBundle("org.apache.geronimo.specs", "geronimo-activation_1.1_spec", "1.1"),
-                        mavenBundle("org.apache.servicemix.specs", "org.apache.servicemix.specs.jaxb-api-2.2", "2.9.0"),
-                        mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.jaxb-impl", "2.2.11_1")
-                );
-            }
-        } catch (NumberFormatException e) {
-            // do nothing
-        }
-        return configuration;
     }
 
     private Option launchpad() {
-        versionResolver.setVersion("org.apache.felix", "org.apache.felix.http.jetty", "3.1.6"); // Java 7
-        versionResolver.setVersion("org.apache.felix", "org.apache.felix.http.whiteboard", "2.3.2"); // Java 7
         final int httpPort = findFreePort();
-        System.out.println("http port " + httpPort);
         return composite(
             sling(),
             webconsole(),