I've done a lot of work in the past writing unit tests that run in "conventional" Maven
builds,
using JUnit and Mockito (and PowerMock). I'm now working on an Eclipse plugin codebase, which builds with Maven Tycho.
Overall, it's a multiproject build, but I'm only adding unit tests to one of the plugin projects (for now).
I've heard of tycho-surefire
, but that seems pretty complicated, and it really sounds more like it supports integration tests instead of unit tests. I'm guessing I'll probably have no choice but to use this, but so far I haven't tried to integrate it.
I tried getting the JUnit and Mockito artifacts from Maven, and then using the maven-dependency-plugin
to get the artifacts available to be referenced in the Bundle-Classpath
property of the manifest.
When I run the build, the tycho-compiler-plugin
I see it compiling 105 source files, which includes all of the classes in src/main/java
and src/test/java
.
It fails to compile
the test class because it can't find the Mockito
classes, even though when I run the build with -X
, it shows the mockito-all
artifact in the dependency tree.
What can I do here?
eclipse-test-plugin
packaging? On in a non-Tycho maven module? – Impressionable