Issue #10606 - Bump build to JDK 21 (#10607)

* Issue #10606 - Bump build to JDK 21
* Fix tests that fail on JDK 21
* better use of `@EnabledForJreRange`
* Disable JAASLdapLoginServiceTest on JDK 20+ via maven profile

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: Olivier Lamy <olamy@apache.org>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Olivier Lamy <olamy@apache.org>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
Joakim Erdfelt 2023-09-28 16:19:36 -05:00 committed by GitHub
parent 551ad8bba0
commit 1e1bc5adff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 4 deletions

6
Jenkinsfile vendored
View File

@ -11,13 +11,13 @@ pipeline {
stages {
stage("Parallel Stage") {
parallel {
stage("Build / Test - JDK19") {
stage("Build / Test - JDK21") {
agent { node { label 'linux' } }
steps {
timeout( time: 180, unit: 'MINUTES' ) {
checkout scm
mavenBuild( "jdk19", "clean install -Dspotbugs.skip=true -Djacoco.skip=true", "maven3")
recordIssues id: "jdk19", name: "Static Analysis jdk19", aggregatingResults: true, enabledForFailure: true, tools: [mavenConsole(), java(), checkStyle()]
mavenBuild( "jdk21", "clean install -Dspotbugs.skip=true -Djacoco.skip=true", "maven3")
recordIssues id: "jdk21", name: "Static Analysis jdk21", aggregatingResults: true, enabledForFailure: true, tools: [mavenConsole(), java(), checkStyle()]
}
}
}

View File

@ -166,6 +166,28 @@
</pluginManagement>
</build>
</profile>
<profile>
<id>jdk20</id>
<activation>
<jdk>[20,)</jdk>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<!-- sun.security.x509.X509CertInfo.set not present in Java 20, needs a Java 20 compatible version of Apache Directory Server -->
<exclude>**/JAASLdapLoginServiceTest*</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
</profiles>
</project>

View File

@ -31,6 +31,8 @@ import org.eclipse.jetty.security.DefaultIdentityService;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.UserIdentity;
import org.junit.Test;
import org.junit.jupiter.api.condition.EnabledForJreRange;
import org.junit.jupiter.api.condition.JRE;
import org.junit.runner.RunWith;
import static org.junit.Assert.assertFalse;
@ -41,6 +43,7 @@ import static org.junit.Assert.assertTrue;
/**
* JAASLdapLoginServiceTest
*/
@EnabledForJreRange(max = JRE.JAVA_17, disabledReason = "sun.security.x509.X509CertInfo.set not present in Java 21, needs a Java 21 compatible version of Apache Directory Server")
@RunWith(FrameworkRunner.class)
@CreateLdapServer(transports = {@CreateTransport(protocol = "LDAP")})
@CreateDS(allowAnonAccess = false, partitions = {

View File

@ -1436,7 +1436,7 @@ public class DistributionTests extends AbstractJettyHomeTest
}
@Test
@DisabledForJreRange(max = JRE.JAVA_18)
@EnabledForJreRange(min = JRE.JAVA_19, max = JRE.JAVA_20)
public void testVirtualThreadPoolPreview() throws Exception
{
String jettyVersion = System.getProperty("jettyVersion");