我正在尝试使用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 [确定]
'-JUnit Vintage [确定]11毫秒后测试运行完成[找到2个容器]
[跳过0个容器] [2个容器
中止] [0个容器中止] [2个容器成功]
[0个容器失败] [找到0个测试]
[0个测试被跳过] [0个测试开始]
[0测试中止] [0测试成功]
[0测试失败]
我在Windows 10上,并且成功运行了IntelliJ的测试。
这是我的测试课:
导入org.junit.jupiter.api.Test;
导入静态org.junit.jupiter.api.Assertions.assertEquals;
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提出问题吗?
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句