-
Notifications
You must be signed in to change notification settings - Fork 354
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
Tests requiring AssertJ Swing as a Maven dependency encounter a NoClassDefFoundError under Pit #881
Comments
Hi @ben-clegg Could you provide the full stack trace of the NoClassDefFoundError? Pitest uses |
Hi Stefan, Thanks for the reply. Here are the logs with the headless setting enabled and disabled, the issue seems to occur with or without this setting. In case it helps, I'm using Linux. Default : https://gist.github.com/ben-clegg/975ffbd09e0850e2b0208884e308d7ab Thanks |
As your stacktraces tell HeadlessGraphicsEnvironment will be used which fails with HeadlessException in either gist. You cannot disable headless for test minions due to #581 . The change merged in #601 adds So far so good. The problems seems the new default introduced in #601 . @hcoles |
To my opinion, it would be nice to get a suggestion for the CLI when a headless exception is thrown. I spent little time to figure out where the problem came from (I dropped the solution here for others). |
This will work differently in pitest 1.9.3. once #1054 is merged. Auto adding of the jvm arg can be disabled with -Dfeatures="-macos_focus" |
I have some JUnit tests for my Swing GUI using AssertJ-Swing, which work fine under other Maven
test
goals, but they crash out when running Pit. In addition, my other (non-AssertJ) tests work fine with Pit.This issue occurs for both OpenJDK 11 and OpenJDK 8.
The exact issue I am facing is that a
java.lang.NoClassDefFoundError
is thrown when running anyAssertJSwingJUnitTestCase
, when it tries to accessorg.assertj.swing.core.BasicRobot
.I have all of my testing dependencies included in my
pom.xml
, under thetest
scope.I have also tried explicitly including AssertJ JAR as additional classpath elements.
I've uploaded a gist of my
pom.xml
here: https://gist.github.com/ben-clegg/c73660b2cdbc82d01dbdcd038fd23adbSince this works fine with other Maven goals, I believe this is an issue with Pit.
Does Pit have similar issues with other Maven dependencies, or is this unique to AssertJ?
Can you suggest any workarounds?
Thanks
The text was updated successfully, but these errors were encountered: