I saw that JUnit5 is released, and i applied in IntelliJ V2016.2.1 and run some testcase.
so saw below screenshot.
i have just two questions.
Why were JUnit Jupiter and JUnit Vintage separated When I Running TestCase in IntelliJ?
Can i Merge JUnit 4 and 5 TestResults?
The Jupiter sub-project provides a TestEngine for running Jupiter based tests on the platform. JUnit Vintage provides a TestEngine for running JUnit 3 and JUnit 4 based tests on the platform. It requires JUnit 4.12 or later to be present on the class path or module path.
JUnit Vintage ensures that existing JUnit tests can run alongside newer tests created using JUnit Jupiter. JUnit 5's architecture also supports running multiple test engines simultaneously: you can run the JUnit Vintage test engine with virtually any other test engine that is compatible with JUnit 5.
JUnit 5 is more than just a new API (called JUnit Jupiter). It also contains an abstraction layer for tools to run JUnit tests (called JUnit Platform). The platform has no knowledge of either JUnit 4 or Jupiter or anything else really. All it knows are test engines, which will execute the tests they were written for.
(You can read more about this in the user guide or a post I wrote about JUnit 5's architecture.)
- Why were JUnit Jupiter and JUnit Vintage seperated When I Running TestCase in IntelliJ?
What you see is the launcher executing two engines, the one for the new API (Jupiter) and the one for JUnit 4 (Vintage). Each engine represents the tests it ran in its own data structure, which IntelliJ shows as the trees you see.
- Can i Merge JUnit 4 and 5 TestResults?
This would have to be an IDE feature, that - as far as I know - is not implemented.
In case, if you use an annotation @RunWith(SpringRunner.class)
atop of the class, you can remove it and this will work well. This is what I have before the annotation - it shows that the Junit Vintage failed.
This is after I removed the annotation:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With