天天看點

junit可執行但控制層無法執行,當我在IntelliJ中運作TestCase時,為什麼JUnit Jupiter和JUnit Vintage分離?...

junit可執行但控制層無法執行,當我在IntelliJ中運作TestCase時,為什麼JUnit Jupiter和JUnit Vintage分離?...

I saw that JUnit5 is released, and i applied in IntelliJ V2016.2.1 and run some testcase.

so saw below screenshot.

junit可執行但控制層無法執行,當我在IntelliJ中運作TestCase時,為什麼JUnit Jupiter和JUnit Vintage分離?...

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?

解決方案

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.