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

gnodet pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-karaf.git


The following commit(s) were added to refs/heads/main by this push:
     new 7650eaa  [CAMEL-16379] Support for JDK 16
7650eaa is described below

commit 7650eaabccd96b426c1798884bba4af7578cfe28
Author: Guillaume Nodet <gno...@gmail.com>
AuthorDate: Mon Jun 21 10:25:19 2021 +0200

    [CAMEL-16379] Support for JDK 16
---
 .../osgi/activator/CamelOsgiActivatorIT.java       | 28 ++++++++++++++++++++++
 tests/camel-itest-osgi/pom.xml                     |  3 +++
 2 files changed, 31 insertions(+)

diff --git 
a/components/camel-osgi-activator/src/test/java/org/apache/camel/component/osgi/activator/CamelOsgiActivatorIT.java
 
b/components/camel-osgi-activator/src/test/java/org/apache/camel/component/osgi/activator/CamelOsgiActivatorIT.java
index 98a9bb5..b2cac9b 100644
--- 
a/components/camel-osgi-activator/src/test/java/org/apache/camel/component/osgi/activator/CamelOsgiActivatorIT.java
+++ 
b/components/camel-osgi-activator/src/test/java/org/apache/camel/component/osgi/activator/CamelOsgiActivatorIT.java
@@ -36,6 +36,8 @@ import org.junit.runner.RunWith;
 import org.ops4j.pax.exam.Configuration;
 import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.karaf.container.internal.JavaVersionUtil;
+import org.ops4j.pax.exam.options.extra.VMOption;
 import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
 import org.ops4j.pax.exam.spi.reactors.PerClass;
 import org.ops4j.pax.tinybundles.core.TinyBundles;
@@ -48,6 +50,7 @@ import static org.junit.Assert.assertTrue;
 import static org.ops4j.pax.exam.CoreOptions.junitBundles;
 import static org.ops4j.pax.exam.CoreOptions.options;
 import static org.ops4j.pax.exam.CoreOptions.streamBundle;
+import static org.ops4j.pax.exam.CoreOptions.when;
 
 @RunWith(PaxExam.class)
 @ExamReactorStrategy(PerClass.class)
@@ -60,6 +63,31 @@ public class CamelOsgiActivatorIT {
         return options(
                 PaxExamOptions.KARAF.option(),
                 PaxExamOptions.CAMEL_CORE_OSGI.option(),
+                when(JavaVersionUtil.getMajorVersion() >= 16)
+                        .useOptions(
+                                new VMOption("--add-opens"),
+                                new VMOption("java.base/java.net=ALL-UNNAMED"),
+                                new VMOption("--add-opens"),
+                                new 
VMOption("java.base/sun.net.www.protocol.file=ALL-UNNAMED"),
+                                new VMOption("--add-opens"),
+                                new 
VMOption("java.base/sun.net.www.protocol.ftp=ALL-UNNAMED"),
+                                new VMOption("--add-opens"),
+                                new 
VMOption("java.base/sun.net.www.protocol.http=ALL-UNNAMED"),
+                                new VMOption("--add-opens"),
+                                new 
VMOption("java.base/sun.net.www.protocol.https=ALL-UNNAMED"),
+                                new VMOption("--add-opens"),
+                                new 
VMOption("java.base/sun.net.www.protocol.jar=ALL-UNNAMED"),
+                                new VMOption("--add-opens"),
+                                new 
VMOption("java.base/sun.net.www.protocol.jmod=ALL-UNNAMED"),
+                                new VMOption("--add-opens"),
+                                new 
VMOption("java.base/sun.net.www.protocol.mailto=ALL-UNNAMED"),
+                                new VMOption("--add-opens"),
+                                new 
VMOption("java.base/sun.net.www.protocol.jrt=ALL-UNNAMED"),
+                                new VMOption("--add-opens"),
+                                new 
VMOption("java.base/jdk.internal.loader=ALL-UNNAMED"),
+                                new VMOption("--add-opens"),
+                                new 
VMOption("java.base/java.security=ALL-UNNAMED")
+                        ),
                 streamBundle(
                         TinyBundles.bundle()
                             .read(
diff --git a/tests/camel-itest-osgi/pom.xml b/tests/camel-itest-osgi/pom.xml
index b0c3b46..1ad6c91 100644
--- a/tests/camel-itest-osgi/pom.xml
+++ b/tests/camel-itest-osgi/pom.xml
@@ -88,6 +88,9 @@
             <plugin>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
+                    <argLine>--add-opens 
java.base/java.nio.charset=ALL-UNNAMED</argLine>
+                    <forkCount>1</forkCount>
+                    <reuseForks>true</reuseForks>
                     <rerunFailingTestsCount>0</rerunFailingTestsCount>
                     <systemPropertyVariables>
                         <karafVersion>${karaf4-version}</karafVersion>

Reply via email to