I have multi module project that has a test module specifically for running integration tests. I've noticed the test classpath changes significantly when running a single class vs running all the same package.
From inspection I can see another project module (and it's dependencies) are being added to the classpath that is not a dependency of the test module (direct or transitive) - it is fact a database migration library that is not depended on by anything else.
Can anyone rationalise why a test classpath would change when running a single class vs all 3 classes in that same package?
Background: IntelliJ 14.1.3 Tests pass when running via Maven
The difference could be seen in the Run...
Run Configurations sections.
When using the Run...
option for a package, the Test kind
defaults to All in Package however the Package
does not default to the package used when invoking Run...
. The default Use classpath of module
was greyed out (and will remain that way until you select a Package
), so it looks like the classpath of all modules was used.
Use classpath of module
was the option I needed to correct the classpath when running all tests in a package.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments