junit-vintage-engine 与哪些版本的 junit 兼容?

junit-vintage-engine is compatible with which versions of junit?

junit-vintage 引擎是否与早于 4 的 junit 版本兼容。12.x?

在我的例子中,在 intellij idea 中使用 junit 4.7 和 运行 时,在测试发现期间似乎存在问题。

我目前 运行 版本的 idea 2017.3.3、junit-jupiter '5.0.3'、junit-vintage-engine '4.12.3' 和 junit 4.7

当 运行 模块中的所有测试时,我看到以下异常。

Exception in thread "main" java.lang.NoClassDefFoundError: org/junit/experimental/categories/Category at org.junit.vintage.engine.descriptor.VintageTestDescriptor.addCategoriesAsTags(VintageTestDescriptor.java:86) at org.junit.vintage.engine.descriptor.VintageTestDescriptor.getTags(VintageTestDescriptor.java:77) at org.junit.platform.launcher.TestIdentifier.from(TestIdentifier.java:60) at org.junit.platform.launcher.TestPlan.lambda$from[=11=](TestPlan.java:80) at org.junit.platform.engine.TestDescriptor.accept(TestDescriptor.java:239) at org.junit.platform.engine.TestDescriptor.lambda$accept[=11=](TestDescriptor.java:241) at java.lang.Iterable.forEach(Iterable.java:75) at org.junit.platform.engine.TestDescriptor.accept(TestDescriptor.java:241) at org.junit.platform.launcher.TestPlan.lambda$from(TestPlan.java:81) at java.util.LinkedHashMap$LinkedValues.forEach(LinkedHashMap.java:608) at org.junit.platform.launcher.TestPlan.from(TestPlan.java:81) at org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:82) at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:48) at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70) Caused by: java.lang.ClassNotFoundException: org.junit.experimental.categories.Category at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 16 more

我将异常的来源缩小到 VintageTestDescriptor.java 中的几行(盯着第 86 行)

    private void addCategoriesAsTags(Set<TestTag> tags) {
    Category annotation = (Category)this.description.getAnnotation(Category.class);

类别在 junit 4.12 的实验包中,似乎在 junit 4.7 中缺失。我找不到关于老式引擎与哪些版本的 junit 兼容的文档。

junit-vintage-engine 与 JUnit 4.12 兼容。

有什么理由不更新到 4.12 吗?