Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runs on JDK 24 #5818

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions core-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,9 @@

<profile>
<id>securityOff</id>
<activation>
<jdk>[24,)</jdk>
</activation>
<properties>
<surefire.security.argline />
</properties>
Expand All @@ -856,12 +859,17 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/SecurityManagerConfiguredTest.java</exclude>
<exclude>**/ReflectionHelperTest.java</exclude>
</excludes>
</configuration>
<executions>
<execution>
<id>default-test</id>
<configuration>
<excludes>
<exclude>**/SecurityManagerConfiguredTest.java</exclude>
<exclude>**/ReflectionHelperTest.java</exclude>
</excludes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2022 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2024 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 @@ -30,11 +30,14 @@

public class ExternalPropertiesConfigurationFactoryTest {

private static boolean isSecurityManager;

/**
* Predefine some properties to be read from config
*/
@BeforeAll
public static void setUp() {
isSecurityManager = System.getSecurityManager() != null;
System.setProperty(CommonProperties.ALLOW_SYSTEM_PROPERTIES_PROVIDER, Boolean.TRUE.toString());

System.setProperty("jersey.config.server.provider.scanning.recursive", "PASSED");
Expand All @@ -53,7 +56,11 @@ public static void tearDown() {
public void readSystemPropertiesTest() {
final Object result =
readExternalPropertiesMap().get("jersey.config.server.provider.scanning.recursive");
Assertions.assertNull(result);
if (isSecurityManager) {
Assertions.assertNull(result);
} else {
Assertions.assertEquals("PASSED", result);
}
Assertions.assertEquals(Boolean.TRUE,
getConfig().isProperty(CommonProperties.JSON_PROCESSING_FEATURE_DISABLE));
Assertions.assertEquals(Boolean.TRUE,
Expand Down Expand Up @@ -81,8 +88,11 @@ public void mergePropertiesTest() {
inputProperties.put("org.jersey.microprofile.config.added", "ADDED");
getConfig().mergeProperties(inputProperties);
final Object result = readExternalPropertiesMap().get("jersey.config.server.provider.scanning.recursive");
Assertions.assertNull(result);
Assertions.assertNull(readExternalPropertiesMap().get("org.jersey.microprofile.config.added"));
final Object resultAdded = readExternalPropertiesMap().get("org.jersey.microprofile.config.added");
if (isSecurityManager) {
Assertions.assertNull(result);
Assertions.assertNull(resultAdded);
}
}

}
3 changes: 3 additions & 0 deletions core-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,9 @@
</profile>
<profile>
<id>securityOff</id>
<activation>
<jdk>[24,)</jdk>
</activation>
<properties>
<surefire.security.argline />
</properties>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2022 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 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 @@ -40,6 +40,8 @@
import static org.junit.jupiter.api.Assertions.assertEquals;

public class ParamConverterDateTest extends AbstractTest {
private final String format = "EEE MMM dd HH:mm:ss Z yyyy";
private final SimpleDateFormat formatter = new SimpleDateFormat(format, new Locale("US"));

@Path("/")
public static class DateResource {
Expand All @@ -55,7 +57,7 @@ public String doGet(@QueryParam("d") final Date d) {
public void testDateResource() throws ExecutionException, InterruptedException {
initiateWebApplication(getBinder(), ParamConverterDateTest.DateResource.class);
final ContainerResponse responseContext = getResponseContext(UriBuilder.fromPath("/")
.queryParam("d", new Date()).build().toString());
.queryParam("d", formatter.format(new Date())).build().toString());

assertEquals(200, responseContext.getStatus());
}
Expand All @@ -80,8 +82,6 @@ public T fromString(final String value) {
);
}
try {
final String format = "EEE MMM dd HH:mm:ss Z yyyy";
final SimpleDateFormat formatter = new SimpleDateFormat(format, new Locale("US"));
return rawType.cast(formatter.parse(value));
} catch (final ParseException ex) {
throw new ExtractorException(ex);
Expand Down
6 changes: 4 additions & 2 deletions examples/groovy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<version>3.0.0</version>
<version>4.0.1</version>
<executions>
<execution>
<id>1</id>
Expand All @@ -99,10 +99,12 @@
<goal>removeTestStubs</goal>
<goal>groovydoc</goal>
</goals>
<configuration>
<targetBytecode>11</targetBytecode>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
Expand Down
21 changes: 13 additions & 8 deletions examples/osgi-helloworld-webapp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,20 @@
<name>jersey-examples-osgi-helloworld-webapp</name>
<packaging>pom</packaging>

<modules>
<module>war-bundle</module>
<module>functional-test</module>
<module>lib-bundle</module>
<module>additional-bundle</module>
<module>alternate-version-bundle</module>
</modules>

<profiles>
<profile>
<id>securityOn</id>
<activation>
<jdk>[1.8,24)</jdk>
</activation>
<modules>
<module>war-bundle</module>
<module>functional-test</module>
<module>lib-bundle</module>
<module>additional-bundle</module>
<module>alternate-version-bundle</module>
</modules>
</profile>
<profile>
<id>pre-release</id>
<build>
Expand Down
12 changes: 11 additions & 1 deletion examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
<!--<module>feed-combiner-java8-webapp</module>-->
<module>freemarker-webapp</module>
<!--<module>flight-mgmt-webapp</module>-->
<module>groovy</module>
<module>helloworld</module>
<module>helloworld-benchmark</module>
<module>helloworld-cdi2-se</module>
Expand Down Expand Up @@ -281,5 +280,16 @@
</resource>
</resources>
</build>
<profiles>
<profile>
<id>GROOVY-EXAMPLE</id>
<activation>
<jdk>[11,)</jdk>
</activation>
<modules>
<module>groovy</module>
</modules>
</profile>
</profiles>

</project>
13 changes: 12 additions & 1 deletion incubator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
<module>cdi-inject-weld</module>
<module>declarative-linking</module>
<module>gae-integration</module>
<module>html-json</module>
<module>injectless-client</module>
<module>kryo</module>
<module>open-tracing</module>
Expand All @@ -53,4 +52,16 @@
<scope>test</scope>
</dependency>
</dependencies>

<profiles>
<profile>
<id>HTML-JSON-FOR-PRE-JDK24</id>
<activation>
<jdk>[1.8, 24)</jdk>
</activation>
<modules>
<module>html-json</module>
</modules>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2024 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 All @@ -23,6 +23,9 @@

import javax.ws.rs.core.Application;

import java.util.List;
import java.util.Arrays;
import java.util.Collections;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class DefaultJsonJacksonProviderForBothModulesTest extends JerseyTest {
Expand All @@ -36,8 +39,12 @@ protected final Application configure() {
public final void testDisabledModule() {
final String response = target("entity/simple")
.request().get(String.class);
String expected = "{\"name\":\"Hello\",\"value\":\"World\"}";
List<String> response_list = Arrays.asList(response.replaceAll("[{}]", "").split(","));
List<String> expected_list = Arrays.asList(expected.replaceAll("[{}]", "").split(","));
Collections.sort(response_list);

assertEquals("{\"name\":\"Hello\",\"value\":\"World\"}", response);
assertEquals(expected_list, response_list);
}

}
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2183,7 +2183,7 @@
<resources.mvn.plugin.version>3.3.1</resources.mvn.plugin.version>
<shade.mvn.plugin.version>3.6.0</shade.mvn.plugin.version>
<source.mvn.plugin.version>3.3.1</source.mvn.plugin.version>
<surefire.mvn.plugin.version>3.3.1</surefire.mvn.plugin.version>
<surefire.mvn.plugin.version>3.5.2</surefire.mvn.plugin.version>
<war.mvn.plugin.version>3.4.0</war.mvn.plugin.version>
<wiremock.mvn.plugin.version>2.11.0</wiremock.mvn.plugin.version>
<xml.mvn.plugin.version>1.1.0</xml.mvn.plugin.version>
Expand All @@ -2209,7 +2209,7 @@
<findbugs.glassfish.version>1.7</findbugs.glassfish.version>
<freemarker.version>2.3.33</freemarker.version>
<gae.version>2.0.29</gae.version>
<groovy.version>4.0.22</groovy.version>
<groovy.version>5.0.0-alpha-11</groovy.version>
<gson.version>2.11.0</gson.version>
<guava.version>33.3.0-jre</guava.version>
<hamcrest.version>3.0</hamcrest.version>
Expand Down
9 changes: 9 additions & 0 deletions tests/integration/microprofile/rest-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,15 @@
</plugins>
</build>
</profile>
<profile>
<id>securityOff</id>
<activation>
<jdk>[24,)</jdk>
</activation>
<properties>
<surefire.security.argline />
</properties>
</profile>
</profiles>

<properties>
Expand Down
10 changes: 9 additions & 1 deletion tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
<module>e2e-testng</module>
<module>e2e-tls</module>
<module>integration</module>
<module>jmockit</module>
<module>mem-leaks</module>
<module>osgi</module>
<module>stress</module>
Expand Down Expand Up @@ -117,5 +116,14 @@
<module>release-test</module>
</modules>
</profile>
<profile>
<id>JMOCKIT-MODULE-FOR-PRE-JDK24</id>
<activation>
<jdk>[1.8,24)</jdk>
</activation>
<modules>
<module>jmockit</module>
</modules>
</profile>
</profiles>
</project>
Loading