Skip to content

Commit

Permalink
Use add-opens for LTW aspect tests on JDK 16+ (#5404)
Browse files Browse the repository at this point in the history
This is needed until we upgrade past AspectJ 1.9.21.1 which we can't do as long as we are building with < JDK 17.
  • Loading branch information
shakuzen authored Aug 28, 2024
1 parent 5cf7222 commit 491a824
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 3 additions & 1 deletion micrometer-test-aspectj-ltw/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@ dependencies {

test {
useJUnitPlatform()
jvmArgs '-javaagent:' + configurations.agents.files.find { it.name.startsWith('aspectjweaver') }
jvmArgs '-javaagent:' + configurations.agents.files.find { it.name.startsWith('aspectjweaver') },
// needed for Java 16+, until upgrading to AspectJ 1.9.21.1, see /~https://github.com/eclipse-aspectj/aspectj/blob/master/docs/release/README-1.9.20.adoc#use-ltw-on-java-16
'--add-opens=java.base/java.lang=ALL-UNNAMED'
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,11 @@
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledForJreRange;
import org.junit.jupiter.api.condition.JRE;

import java.util.Collection;

import static org.assertj.core.api.BDDAssertions.then;

@DisabledForJreRange(min = JRE.JAVA_17,
disabledReason = "See /~https://github.com/micrometer-metrics/micrometer/pull/5401#issuecomment-2308440259")
class MeasuredClassTest {

MeterRegistry registry = new SimpleMeterRegistry();
Expand Down

0 comments on commit 491a824

Please sign in to comment.