-
-
Notifications
You must be signed in to change notification settings - Fork 765
Open
Labels
theme: module systemAn issue related to the Java module systemAn issue related to the Java module system
Milestone
Description
Describe the bug
- AssertJ Core version: 3.23.1
- Java version: 11.0.16+8 Temurin
- Test framework version:
From #1504 (comment) by @beatngu13 and @aepfli:
We are facing similar issues since we test on the module path, see:
https://github.com/junit-pioneer/junit-pioneer/runs/8060473637?check_suite_focus=true#step:4:68
This is one of the failing tests:
Looks like the problematic path comes from
extractingResultOf, @aepfli made it work switching toextracting:We are using AssertJ 3.22.0. Note that the changes are not on
main, this is the corresponding PR:
Test case reproducing the bug
which yields:
> Task :test
WARNING: module-info.class ignored in patch: /home/runner/work/junit-pioneer/junit-pioneer/build/classes/java/main
WARNING: module-info.class ignored in patch: /home/runner/work/junit-pioneer/junit-pioneer/build/classes/java/main
Pioneer Annotation utilities > getting annotated annotations > finds annotated annotations on a method FAILED
java.lang.IllegalStateException: java.lang.IllegalAccessException: class org.assertj.core.util.introspection.MethodSupport (in module org.assertj.core) cannot access class com.sun.proxy.jdk.proxy2.$Proxy30 (in module jdk.proxy2) because module jdk.proxy2 does not export com.sun.proxy.jdk.proxy2 to module org.assertj.core
at org.assertj.core@3.23.1/org.assertj.core.util.introspection.MethodSupport.invokeMethod(MethodSupport.java:60)
at org.assertj.core@3.23.1/org.assertj.core.util.introspection.MethodSupport.methodResultFor(MethodSupport.java:53)
at org.assertj.core@3.23.1/org.assertj.core.extractor.ResultOfExtractor.apply(ResultOfExtractor.java:39)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
at org.assertj.core@3.23.1/org.assertj.core.groups.FieldsOrPropertiesExtractor.extract(FieldsOrPropertiesExtractor.java:64)
at org.assertj.core@3.23.1/org.assertj.core.api.AbstractIterableAssert.extractingResultOf(AbstractIterableAssert.java:1118)
at org.junitpioneer/org.junitpioneer.internal.PioneerAnnotationUtilsTests$AnnotatedAnnotations.onMethods(PioneerAnnotationUtilsTests.java:509)
Caused by:
java.lang.IllegalAccessException: class org.assertj.core.util.introspection.MethodSupport (in module org.assertj.core) cannot access class com.sun.proxy.jdk.proxy2.$Proxy30 (in module jdk.proxy2) because module jdk.proxy2 does not export com.sun.proxy.jdk.proxy2 to module org.assertj.core
at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:361)
at java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:591)
at java.base/java.lang.reflect.Method.invoke(Method.java:558)
at org.assertj.core@3.23.1/org.assertj.core.util.introspection.MethodSupport.invokeMethod(MethodSupport.java:58)
... 12 more
Additional tasks
- Identify an equivalent test case to be added as an integration test after Add integration test infrastructure for the module path #2759 is merged.
Metadata
Metadata
Assignees
Labels
theme: module systemAn issue related to the Java module systemAn issue related to the Java module system