无法 运行 使用 JUnit5 控制台启动器进行测试

Unable to run tests with JUnit5 Console Launcher

我正在尝试 运行 使用 JUnit5 控制台启动器进行简单测试。我尝试了几种选择,但它不起作用。谁能告诉我哪里出了问题?

java -jar .\junit-platform-console-standalone-1.0.0-RC3.jar -c AFirstTest.class

java -jar .\junit-platform-console-standalone-1.0.0-RC3.jar -c AFirstTest

给我一个警告

WARNUNG: TestEngine with ID 'junit-jupiter' failed to discover tests

我试过运行目录下的所有测试,但是这个好像找不到测试:

java -jar .\junit-platform-console-standalone-1.0.0-RC3.jar -d .

结果是这样的:

. +-- JUnit Jupiter [OK]
'-- JUnit Vintage [OK]

Test run finished after 11 ms [ 2 containers found ]
[ 0 containers skipped ] [ 2 containers started ]
[ 0 containers aborted ] [ 2 containers successful ]
[ 0 containers failed ] [ 0 tests found ]
[ 0 tests skipped ] [ 0 tests started ]
[ 0 tests aborted ] [ 0 tests successful ]
[ 0 tests failed ]

我在 Windows 10,我成功地 运行 测试了 IntelliJ。

这是我的测试class:

import org.junit.jupiter.api.Test;
 
import static org.junit.jupiter.api.Assertions.assertEquals;
 
class AFirstTest {
 
    @Test
    void helloJUnit5() {
        assertEquals(2, 3 - 1);
    }

}

您必须在类路径中包含当前目录。喜欢:

java -jar junit-platform-console-standalone-1.5.2.jar --class-path . -c AFirstTest

它应该可以不包含它。我认为。您介意在 https://github.com/junit-team/junit5/issues 提出问题吗?