简体   繁体   中英

How to determine which tests were run using JUnit Vintage vs. JUnit Jupiter

I'm trying to determine which unit tests are executed using JUnit 5 (Jupiter) and which tests are executed with JUnit 4 (Vintage)

I've already tried to see through IntelliJ, but it doesn't show.

Is there any plugin that shows this?

I'm not aware of such a plugin, but that doesn't mean one doesn't exist.

In any case, running your test "suite" via @RunWith(JUnitPlatform.class) should present a hierarchical view in your IDE with the engines as the top-level nodes. Though, Jupiter's dynamic tests will show up as "Unrooted Tests" (at least in Eclipse).

Another option is to execute the JUnit Platform Console Launcher using tree for the details mode. That will present a hierarchical view in the console with the engines as the top-level nodes.

Note, however, that neither of those approaches will provide a test count per test engine. If that's what you're specifically looking for, you'll want to implement your own org.junit.platform.launcher.TestExecutionListener .

You'll find details on all of these options in the JUnit 5 User Guide .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM