-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JAVA] java.lang.ExceptionInInitializerError when running JUnit tests using new CureString("string") #26
Comments
Hai! Thanks for reporting this bug. This bug should be fixed in 3fdf8e7. Sadly, i can't publish the latest results to jitpack because the repository's history went over 500 MB. Currently i am thinking of migrating from jitpack to maven central. |
I've tried it on top of current HEAD (2a1030f) and unfortunately it finished with the same error. |
Huh, alright. Thanks for reporting. |
I can confirm it works on top of ffa31ed, Great work! |
Thank you! ❤️ |
As this bug is fixed, the issue may be closed. Though the fix will officially be released in |
Description
When running JUnit tests that use this library - calling
new CuredString("value")
results in an exceptionI have identified the issue is with the exception for loading the library for JUnit tests.
I assume it was supposed to detect test runs for regression testing of this library. But it does not distinguish it from running it from another project. It goes through the thread stack trace and checks the class name, looking for the first appearence of org.junit
element.getClassName().startsWith("org.junit.")
If I remove the condition for JUnit tests and use the NativeUtils to load the library as is used for the production use. It works well in the unit tests as well.
Would it be possible to create a more sophisticated approach to detecting which unit tests are run?
Steps to Reproduce:
Environment:
OS: Ubuntu 24
Java Version: Java 21
Library Version: v3.2.0
The text was updated successfully, but these errors were encountered: