Skip to content

Commit

Permalink
Merge pull request #2055 from newrelic/java-23
Browse files Browse the repository at this point in the history
Java 23
  • Loading branch information
jasonjkeller committed Sep 20, 2024
2 parents b3669bc + a1cf8e7 commit 544001f
Show file tree
Hide file tree
Showing 30 changed files with 118 additions and 107 deletions.
6 changes: 3 additions & 3 deletions .github/actions/setup-environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ runs:
with:
distribution: 'temurin'
java-version: |
22
23
21
17
11
Expand All @@ -31,7 +31,7 @@ runs:
s|jdk11=11|jdk11=${JAVA_HOME_11_X64}|
s|jdk17=17|jdk17=${JAVA_HOME_17_X64}|
s|jdk21=21|jdk21=${JAVA_HOME_21_X64}|
s|jdk22=22|jdk22=${JAVA_HOME_22_X64}|" gradle.properties.gha
s|jdk23=23|jdk23=${JAVA_HOME_23_X64}|" gradle.properties.gha
cat gradle.properties.gha >> gradle.properties
- name: Setup Gradle
Expand All @@ -41,7 +41,7 @@ runs:

- name: Setup Gradle options
shell: bash
run: echo "GRADLE_OPTIONS=--console=plain --parallel -Porg.gradle.java.installations.auto-detect=false -Porg.gradle.java.installations.fromEnv=JAVA_HOME_8_X64,JAVA_HOME_11_X64,JAVA_HOME_17_X64,JAVA_HOME_21_X64,JAVA_HOME_22_X64" >> $GITHUB_ENV
run: echo "GRADLE_OPTIONS=--console=plain --parallel -Porg.gradle.java.installations.auto-detect=false -Porg.gradle.java.installations.fromEnv=JAVA_HOME_8_X64,JAVA_HOME_11_X64,JAVA_HOME_17_X64,JAVA_HOME_21_X64,JAVA_HOME_23_X64" >> $GITHUB_ENV

- name: Download S3 instrumentation jar zip
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/GHA-Functional-Tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
##max-parallel: 1 ## used to force sequential
fail-fast: false
matrix:
java-version: [ 8, 11, 17, 21, 22 ]
java-version: [ 8, 11, 17, 21, 23 ]
steps:
- name: Checkout Java agent
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # pin@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/GHA-Unit-Tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
# max-parallel: 1 ## used to force sequential vs. concurrent
fail-fast: false
matrix:
java-version: [ 8, 11, 17, 21, 22 ]
java-version: [ 8, 11, 17, 21, 23 ]
steps:
- name: Checkout Java agent
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # pin@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Java-Instrumentation-Tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java-version: [ 8, 11, 17, 21, 22 ]
java-version: [ 8, 11, 17, 21, 23 ]
name: Java ${{ matrix.java-version }}
timeout-minutes: 120
# needs: install-all-java
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/Test-AITs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ jobs:
with:
distribution: 'zulu'
java-version: |
22
23
21
17
11
Expand All @@ -212,14 +212,14 @@ jobs:
echo "JDK_zulu_11=${JAVA_HOME_11_X64}" >> $GITHUB_ENV
echo "JDK_zulu_17=${JAVA_HOME_17_X64}" >> $GITHUB_ENV
echo "JDK_zulu_21=${JAVA_HOME_21_X64}" >> $GITHUB_ENV
echo "JDK_zulu_22=${JAVA_HOME_22_X64}" >> $GITHUB_ENV
echo "JDK_zulu_23=${JAVA_HOME_23_X64}" >> $GITHUB_ENV
- name: Set up Javas
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # pin@v4
with:
distribution: 'temurin'
java-version: |
22
23
21
17
11
Expand Down Expand Up @@ -272,10 +272,10 @@ jobs:
<toolchain>
<type>jdk</type>
<provides>
<version>22</version>
<version>23</version>
</provides>
<configuration>
<jdkHome>${JAVA_HOME_22_X64}</jdkHome>
<jdkHome>${JAVA_HOME_23_X64}</jdkHome>
</configuration>
</toolchain>
</toolchains>
Expand Down Expand Up @@ -312,12 +312,12 @@ jobs:
ZULU11=${JDK_zulu_11} \
ZULU17=${JDK_zulu_17} \
ZULU21=${JDK_zulu_21} \
ZULU22=${JDK_zulu_22} \
ZULU23=${JDK_zulu_23} \
JAVA8JRE=${JAVA_HOME_8_X64} \
JAVA11JRE=${JAVA_HOME_11_X64} \
JAVA17JRE=${JAVA_HOME_17_X64} \
JAVA21JRE=${JAVA_HOME_21_X64} \
JAVA22JRE=${JAVA_HOME_22_X64} \
JAVA23JRE=${JAVA_HOME_23_X64} \
conf/autoconfigure
. conf/testenv java
cat conf/java_local_config.yml
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@ ext {
// SynchronizedAnnotationNode, SynchronizedClassNode, SynchronizedFieldNode, SynchronizedInnerClassNode, SynchronizedMethodNode,
// SynchronizedModuleExportNode, SynchronizedModuleNode, SynchronizedModuleOpenNode, SynchronizedModuleProvideNode, SynchronizedModuleRequireNode,
// SynchronizedTypeAnnotationNode
asmVersion="9.6"
asmVersion="9.7"
}
4 changes: 2 additions & 2 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ repositories {
dependencies {
// This is how we do our NR-specific patching. That is, moving Log4jPlugins,
// changing Logger.getLogger, and checking for unmapped dependencies.
implementation("org.ow2.asm:asm:9.6")
implementation("org.ow2.asm:asm-commons:9.6")
implementation("org.ow2.asm:asm:9.7")
implementation("org.ow2.asm:asm-commons:9.7")

// Shadow is used here because several classes implement the Transformer interface
implementation("com.github.jengelman.gradle.plugins:shadow:6.0.0")
Expand Down
2 changes: 1 addition & 1 deletion functional_test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ test {
//testLogging.showStandardStreams = true

// when using an early access Java version, we need to pass an extra param to the agent
if (project.hasProperty("test23")) {
if (project.hasProperty("test24")) {
jvmArgs += ["-Dnewrelic.config.experimental_runtime=true"]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import com.newrelic.test.marker.IBMJ9IncompatibleTest;
import com.newrelic.test.marker.Java17IncompatibleTest;
import com.newrelic.test.marker.Java21IncompatibleTest;
import com.newrelic.test.marker.Java22IncompatibleTest;
import com.newrelic.test.marker.Java23IncompatibleTest;
import org.junit.Assert;
import org.junit.Test;
import org.junit.experimental.categories.Category;
Expand Down Expand Up @@ -69,7 +69,7 @@ public void testMissingNewRelicClass() throws ClassNotFoundException {

// Java 12 no longer lets us access the declared field
@Test
@Category({ IBMJ9IncompatibleTest.class, Java17IncompatibleTest.class, Java21IncompatibleTest.class, Java22IncompatibleTest.class })
@Category({ IBMJ9IncompatibleTest.class, Java17IncompatibleTest.class, Java21IncompatibleTest.class, Java23IncompatibleTest.class })
public void testSetSystemClassLoader() throws Exception {

final ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
import com.newrelic.test.marker.Java11IncompatibleTest;
import com.newrelic.test.marker.Java17IncompatibleTest;
import com.newrelic.test.marker.Java21IncompatibleTest;
import com.newrelic.test.marker.Java22IncompatibleTest;
import com.newrelic.test.marker.Java23IncompatibleTest;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import javax.activation.MimeType;
import java.util.HashMap;
import java.util.Map;

@Category({ Java11IncompatibleTest.class, Java17IncompatibleTest.class, Java21IncompatibleTest.class, Java22IncompatibleTest.class })
@Category({ Java11IncompatibleTest.class, Java17IncompatibleTest.class, Java21IncompatibleTest.class, Java23IncompatibleTest.class })
public class ClassRetransformBootstrapTest {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
import com.newrelic.test.marker.Java11IncompatibleTest;
import com.newrelic.test.marker.Java17IncompatibleTest;
import com.newrelic.test.marker.Java21IncompatibleTest;
import com.newrelic.test.marker.Java22IncompatibleTest;
import com.newrelic.test.marker.Java23IncompatibleTest;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.mockito.Mockito;

import javax.activation.MimeType;

@Category({ Java11IncompatibleTest.class, Java17IncompatibleTest.class, Java21IncompatibleTest.class, Java22IncompatibleTest.class })
@Category({ Java11IncompatibleTest.class, Java17IncompatibleTest.class, Java21IncompatibleTest.class, Java23IncompatibleTest.class })
public class CustomExtensionTestAddition {

@Test
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties.gha
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ jdk8=8
jdk11=11
jdk17=17
jdk21=21
jdk22=22
jdk23=23
8 changes: 4 additions & 4 deletions gradle/script/java.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ test {
ext.configuredWithValidTestJDK = {
if (project.hasProperty("test9") || project.hasProperty("test10") || project.hasProperty("test12") || project.hasProperty("test13") ||
project.hasProperty("test14") || project.hasProperty("test15") || project.hasProperty("test16") || project.hasProperty("test18") ||
project.hasProperty("test19") || project.hasProperty("test20")) {
project.hasProperty("test19") || project.hasProperty("test20") || project.hasProperty("test22")) {
logger.lifecycle("The newrelic-java-agent project does not support testing with the Java version configured by the -PtestN gradle property.")
return false
}
Expand All @@ -113,8 +113,8 @@ test {
configuration.call()
}

if (project.hasProperty("test22")) {
configureTest("jdk22") {
if (project.hasProperty("test23")) {
configureTest("jdk23") {
jvmArgs '--add-opens=java.base/java.lang=ALL-UNNAMED',
'--add-opens=java.base/java.util=ALL-UNNAMED',
'--add-opens=java.base/java.net=ALL-UNNAMED',
Expand All @@ -123,7 +123,7 @@ test {
'--add-exports=java.base/sun.net.spi=ALL-UNNAMED',
'--add-exports=java.xml/com.sun.org.apache.xalan.internal.xsltc.trax=ALL-UNNAMED'
useJUnit {
excludeCategories 'com.newrelic.test.marker.Java22IncompatibleTest'
excludeCategories 'com.newrelic.test.marker.Java23IncompatibleTest'
}
}
// mockito uses a version of bytebuddy that has experimental support for Java 21
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import com.newrelic.agent.introspec.TracedMetricData;
import com.newrelic.test.marker.Java17IncompatibleTest;
import com.newrelic.test.marker.Java21IncompatibleTest;
import com.newrelic.test.marker.Java22IncompatibleTest;
import com.newrelic.test.marker.Java23IncompatibleTest;
import com.nr.instrumentation.akka22.test.actors.broadcasting.ActorA;
import com.nr.instrumentation.akka22.test.actors.broadcasting.ActorB;
import com.nr.instrumentation.akka22.test.actors.broadcasting.ActorC;
Expand All @@ -33,7 +33,7 @@
import static org.junit.Assert.assertTrue;

// Not compatible with Java 11+ and Scala 2.13+ https://github.com/scala/bug/issues/12340
@Category({ Java17IncompatibleTest.class, Java21IncompatibleTest.class, Java22IncompatibleTest.class })
@Category({ Java17IncompatibleTest.class, Java21IncompatibleTest.class, Java23IncompatibleTest.class })
@RunWith(InstrumentationTestRunner.class)
@InstrumentationTestConfig(includePrefixes = {"akka.actor", "akka.dispatch", "akka.pattern", "akka.routing"})
public class AkkaTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import static org.hamcrest.Matchers.containsString;

// Not compatible with Java 11+ and Scala 2.13+ https://github.com/scala/bug/issues/12340
@Category({ Java11IncompatibleTest.class, Java17IncompatibleTest.class, Java21IncompatibleTest.class, Java22IncompatibleTest.class })
@Category({ Java11IncompatibleTest.class, Java17IncompatibleTest.class, Java21IncompatibleTest.class, Java23IncompatibleTest.class })
@RunWith(InstrumentationTestRunner.class)
@InstrumentationTestConfig(includePrefixes = {"akka", "scala", "com.agent", "com.nr"})
public class AkkaHttpRoutesTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import com.newrelic.test.marker.Java11IncompatibleTest;
import com.newrelic.test.marker.Java17IncompatibleTest;
import com.newrelic.test.marker.Java21IncompatibleTest;
import com.newrelic.test.marker.Java22IncompatibleTest;
import com.newrelic.test.marker.Java23IncompatibleTest;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
Expand All @@ -30,7 +30,7 @@
import static org.junit.Assert.assertTrue;

// Not compatible with Java 11+ and Scala 2.13+ https://github.com/scala/bug/issues/12340
@Category({ Java11IncompatibleTest.class, Java17IncompatibleTest.class, Java21IncompatibleTest.class, Java22IncompatibleTest.class })
@Category({ Java11IncompatibleTest.class, Java17IncompatibleTest.class, Java21IncompatibleTest.class, Java23IncompatibleTest.class })
@RunWith(InstrumentationTestRunner.class)
@InstrumentationTestConfig(includePrefixes = {"akka", "scala"})
public class AkkaResponseWrapperTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
import com.newrelic.agent.bridge.logging.AppLoggingUtils;
import com.newrelic.agent.bridge.logging.LogAttributeKey;
import com.newrelic.agent.bridge.logging.LogAttributeType;
import com.newrelic.test.marker.Java21IncompatibleTest;
import com.newrelic.test.marker.Java22IncompatibleTest;
import com.newrelic.test.marker.Java23IncompatibleTest;
import org.apache.log4j.Category;
import org.apache.log4j.MDC;
import org.apache.log4j.Priority;
Expand All @@ -29,8 +28,8 @@
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;

// Log4J1 has a quirk with Java 21(.0.0), maybe this will work when 21.0.1 is released
@org.junit.experimental.categories.Category({ Java21IncompatibleTest.class, Java22IncompatibleTest.class })
// Log4J1 has a quirk with Java 23(.0.0), maybe this will work when 23.0.1 is released
@org.junit.experimental.categories.Category({ Java23IncompatibleTest.class })
public class LoggingEventMapTest {

private static Stream<Arguments> providerParamsForLoggingEventMapTest() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
import com.newrelic.agent.introspec.InstrumentationTestRunner;
import com.newrelic.agent.introspec.Introspector;
import com.newrelic.agent.model.LogEvent;
import com.newrelic.test.marker.Java21IncompatibleTest;
import com.newrelic.test.marker.Java22IncompatibleTest;
import com.newrelic.test.marker.Java23IncompatibleTest;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand All @@ -22,7 +21,7 @@
import static org.junit.Assert.assertEquals;

@RunWith(InstrumentationTestRunner.class)
@org.junit.experimental.categories.Category({ Java21IncompatibleTest.class, Java22IncompatibleTest.class })
@org.junit.experimental.categories.Category({ Java23IncompatibleTest.class })
@InstrumentationTestConfig(includePrefixes = {"org.apache.log4j"}, configName = "application_logging_context_data_enabled.yml")
public class ContextDataTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

@Category({ Java11IncompatibleTest.class, Java17IncompatibleTest.class, Java21IncompatibleTest.class, Java22IncompatibleTest.class })
@Category({ Java11IncompatibleTest.class, Java17IncompatibleTest.class, Java21IncompatibleTest.class, Java23IncompatibleTest.class })
@RunWith(InstrumentationTestRunner.class)
@InstrumentationTestConfig(includePrefixes = {"com.nr.agent.instrumentation.asynchttpclient", "org.asynchttpclient"})
public class AsyncHttpClient2_0_0Tests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

@Category({ Java11IncompatibleTest.class, Java17IncompatibleTest.class, Java21IncompatibleTest.class, Java22IncompatibleTest.class })
@Category({ Java11IncompatibleTest.class, Java17IncompatibleTest.class, Java21IncompatibleTest.class, Java23IncompatibleTest.class })
@RunWith(InstrumentationTestRunner.class)
@InstrumentationTestConfig(includePrefixes = {"com.nr.agent.instrumentation.asynchttpclient", "org.asynchttpclient"})
public class AsyncHttpClient2_1_0Tests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import com.newrelic.test.marker.Java11IncompatibleTest;
import com.newrelic.test.marker.Java17IncompatibleTest;
import com.newrelic.test.marker.Java21IncompatibleTest;
import com.newrelic.test.marker.Java22IncompatibleTest;
import com.newrelic.test.marker.Java23IncompatibleTest;
import org.cassandraunit.CassandraCQLUnit;
import org.cassandraunit.dataset.cql.ClassPathCQLDataSet;
import org.junit.Rule;
Expand All @@ -34,7 +34,7 @@
import static org.junit.Assert.assertNotNull;

// Issue when running cassandra unit on Java 9+ - https://github.com/jsevellec/cassandra-unit/issues/249
@Category({ IBMJ9IncompatibleTest.class, Java11IncompatibleTest.class, Java17IncompatibleTest.class, Java21IncompatibleTest.class, Java22IncompatibleTest.class })
@Category({ IBMJ9IncompatibleTest.class, Java11IncompatibleTest.class, Java17IncompatibleTest.class, Java21IncompatibleTest.class, Java23IncompatibleTest.class })
@RunWith(InstrumentationTestRunner.class)
@InstrumentationTestConfig(includePrefixes = { "com.datastax.oss.driver" })
public class CassandraInstrumented {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import com.newrelic.test.marker.Java11IncompatibleTest;
import com.newrelic.test.marker.Java17IncompatibleTest;
import com.newrelic.test.marker.Java21IncompatibleTest;
import com.newrelic.test.marker.Java22IncompatibleTest;
import com.newrelic.test.marker.Java23IncompatibleTest;
import org.cassandraunit.CassandraCQLUnit;
import org.cassandraunit.dataset.cql.ClassPathCQLDataSet;
import org.junit.Rule;
Expand All @@ -27,7 +27,7 @@
import static org.junit.Assert.assertEquals;

// Issue when running cassandra unit on Java 9+ - https://github.com/jsevellec/cassandra-unit/issues/249
@Category({ IBMJ9IncompatibleTest.class, Java11IncompatibleTest.class, Java17IncompatibleTest.class, Java21IncompatibleTest.class, Java22IncompatibleTest.class })
@Category({ IBMJ9IncompatibleTest.class, Java11IncompatibleTest.class, Java17IncompatibleTest.class, Java21IncompatibleTest.class, Java23IncompatibleTest.class })
@RunWith(InstrumentationTestRunner.class)
@InstrumentationTestConfig(includePrefixes = { "none" })
public class CassandraNoInstrumentation {
Expand Down
14 changes: 12 additions & 2 deletions instrumentation/jms-3/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ dependencies {
implementation(project(":agent-bridge"))
implementation 'jakarta.jms:jakarta.jms-api:3.0.0'

testImplementation('org.apache.activemq:artemis-jakarta-client:2.17.0')
testImplementation("org.apache.activemq:artemis-junit:2.17.0")
testImplementation('org.apache.activemq:artemis-jakarta-client:2.19.0')
testImplementation("org.apache.activemq:artemis-junit:2.19.0")
}

jar {
Expand All @@ -14,6 +14,16 @@ verifyInstrumentation {
passesOnly 'jakarta.jms:jakarta.jms-api:[3.0.0-RC1,)'
}

test {
// ActiveMQ calls javax.security.auth.Subject.getSubject. Java 23 added logic that will
// throw an exception if security manager is not enabled.
// They have a ticket regarding this: https://issues.apache.org/jira/browse/ARTEMIS-4975
// but it is unlikely the fix can be used here because it will likely not be Java 8 compatible.
if (project.hasProperty("test23")) {
jvmArgs += '-Djava.security.manager=allow'
}
}

site {
title 'JMS'
type 'Messaging'
Expand Down
Loading

0 comments on commit 544001f

Please sign in to comment.