Skip to content

Commit

Permalink
Fix OSGi tests on JDK 17
Browse files Browse the repository at this point in the history
Signed-off-by: jansupol <[email protected]>
  • Loading branch information
jansupol authored and senivam committed Jan 7, 2022
1 parent 7212b01 commit e84b5e8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2021 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2022 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
Expand Down Expand Up @@ -122,6 +122,11 @@ public List<Option> genericOsgiOptions() {

// do not remove the following line
systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("FINEST"),

JdkVersion.getJdkVersion().getMajor() > 16
? vmOption("--add-opens=java.base/java.net=ALL-UNNAMED")
: null,

// uncomment the following 4 lines should you need to debug from th felix console
// mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.gogo.runtime").version(gogoVersion),
// mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.gogo.shell").version(gogoVersion),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2021 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2022 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
Expand Down Expand Up @@ -47,6 +47,7 @@
import static org.ops4j.pax.exam.CoreOptions.options;
import static org.ops4j.pax.exam.CoreOptions.systemPackage;
import static org.ops4j.pax.exam.CoreOptions.systemProperty;
import static org.ops4j.pax.exam.CoreOptions.vmOption;

/**
* @author Jakub Podlesak
Expand Down Expand Up @@ -86,6 +87,10 @@ public List<Option> genericOsgiOptions() {
systemProperty("jersey.config.test.container.port").value(String.valueOf(port)),
systemProperty("org.osgi.framework.system.packages.extra").value("jakarta.annotation"),

JdkVersion.getJdkVersion().getMajor() > 16
? vmOption("--add-opens=java.base/java.net=ALL-UNNAMED")
: null,

// do not remove the following line
// systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("FINEST"),

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2022 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -27,6 +27,8 @@

import org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory;
import org.glassfish.jersey.grizzly2.servlet.GrizzlyWebContainerFactory;
import org.glassfish.jersey.internal.Version;
import org.glassfish.jersey.internal.util.JdkVersion;
import org.glassfish.jersey.osgi.test.util.Helper;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.server.ServerProperties;
Expand All @@ -41,10 +43,9 @@
import org.ops4j.pax.exam.junit.PaxExam;
import static org.junit.Assert.assertEquals;
import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
import static org.ops4j.pax.exam.CoreOptions.vmOption;

/**
* NOTE: This test is excluded on JDK6 as it requires Servlet 3.1 API that is built against JDK 7.
*
* @author Jakub Podlesak
* @author Michal Gajdos
*/
Expand All @@ -64,6 +65,9 @@ public static Option[] configuration() {

options.addAll(Helper.expandedList(
// vmOption("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"),
JdkVersion.getJdkVersion().getMajor() > 16
? vmOption("--add-opens=java.base/java.net=ALL-UNNAMED")
: null,

mavenBundle().groupId("org.glassfish.jersey.media").artifactId("jersey-media-sse").versionAsInProject(),

Expand Down

0 comments on commit e84b5e8

Please sign in to comment.