You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generate and Run tests with mocks + static mocks (default settings)
Expected behavior
Tests classified as Successful should pass.
Actual behavior
3 successful executions generated by Symbolic engine - fail.
The following error is produced by UtUtils.getStaticFieldValue() :
java.lang.reflect.InaccessibleObjectException: Unable to make private native java.lang.reflect.Field[] java.lang.Class.getDeclaredFields0(boolean) accessible: module java.base does not "opens java.lang" to unnamed module @5afa04c
The same tests generated in UTBotJava project pass.
That happens because of specially added list of "--add-opens" keys to jvmArgs.
When the following keys are added to the test run configuration in the new project - the tests pass. -ea --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED
The text was updated successfully, but these errors were encountered:
Description
UtUtils methods using setAccessible doesn't work in Java 17
That results in failing successful executions.
To Reproduce
mixed\LoggerExample.java
into itExpected behavior
Tests classified as Successful should pass.
Actual behavior
3 successful executions generated by Symbolic engine - fail.
The following error is produced by
UtUtils.getStaticFieldValue()
:java.lang.reflect.InaccessibleObjectException: Unable to make private native java.lang.reflect.Field[] java.lang.Class.getDeclaredFields0(boolean) accessible: module java.base does not "opens java.lang" to unnamed module @5afa04c
Visual proofs (screenshots, logs, images)
Environment
IntelliJ IDEA 2022.3.3 Ultimate
JDK 17
Additional context
The same tests generated in UTBotJava project pass.
That happens because of specially added list of "--add-opens" keys to jvmArgs.
When the following keys are added to the test run configuration in the new project - the tests pass.
-ea --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED
The text was updated successfully, but these errors were encountered: