我已经下载了 JUnit 5 控制台启动器的独立 jar,但我无法使其与我的代码一起使用。
给定 file/pkg 结构src/test/java/com/fteotini/dummy/SubjectTest.java和以下测试类:
package com.fteotini.dummy;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class SubjectTest {
@Test
void it_runs() {
assertTrue(true);
}
}
Run Code Online (Sandbox Code Playgroud)
当运行这个
java -jar junit-platform-console-standalone-1.5.1.jar -cp ./target/test-classes/com/fteotini/dummy --scan-classpath
Run Code Online (Sandbox Code Playgroud)
它没有找到任何测试
Test run finished after 42 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 ]
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1499 次 |
| 最近记录: |