In Sun, 25 Dec 2016 05:23:14 +0100, Christian Schulte <[email protected]> wrote:

Am 12/24/16 um 18:40 schrieb Guillaume Boué:
Why would the PMD plugin care about what Doxia require transitively?
Christian, can you explain a bit more why those changes are needed?

Classpath consistency. Running the unit tests with a completely
different classpath than what the plugin is using at runtime makes those
unit tests meaningless, so to say.


We're talking about *unittests*, they should test one unit. In those cases there should be no issue which such dependencies, because if that unit requires a certain dependency, it should already have been defined as direct dependency. If a test framework requires a newer version of some dependency also required at compile time, it is weird to be forced to upgrade this dependency just for testing (and what if this dependency is compiled with a newer version of Java compared to the max of the project). Maybe it is also caused by the current implementation of test tools. JUnit is using its own classpath for everything. I've been talking with them if it would make sense to give the JUnit engine, the test classes and the main classes all their own classloader. That would make it possible to have better separation.

I understand the statement of classpath consistency, I used to think like that in the past too, but for *unit*testing this shouldn't matter. That's why integration tests are just as important.

Robert


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to