天天看点

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.