在 junit5 上使用测试服测试多个 类 等待处理

testing multiple classes using test suit on junit5 gets pending

我编写了多个测试 classes 来使用 junit 5 测试我的方法。 当我 运行 他们单独进行时,所有测试 classes 都成功通过 但是当我尝试使用如下所示的测试套件一次 运行 它们时,我的一些测试会挂起并且测试不会完成。它甚至不会跳去测试其他 classes

由于所有方法都成功通过,我认为 class ParametrizedMethodTest

是否有任何问题

我正在使用 junit-platform-运行ner 版本 1-6-2

从当前JavaDoc开始:

Please note that test classes and suites annotated with @RunWith(JUnitPlatform.class) cannot be executed directly on the JUnit Platform (or as a "JUnit 5" test as documented in some IDEs). Such classes and suites can only be executed using JUnit 4 infrastructure.

换句话说,JUnit 5 不支持您希望在您的示例中执行测试套件的方式。如果您想 运行 所有测试 类 只需 select 包并从上下文菜单中选择 运行 测试。