Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/342.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为什么cucumber会找到“runTest.java”来运行测试?_Java_Junit_Cucumber - Fatal编程技术网

为什么cucumber会找到“runTest.java”来运行测试?

为什么cucumber会找到“runTest.java”来运行测试?,java,junit,cucumber,Java,Junit,Cucumber,当我编写一些cucumber测试时,我从一些文档中发现我需要在src/test/java/somepackage下创建一个runTest.java文件,其中包含配置cucumber的内容,如: import cucumber.api.CucumberOptions; import cucumber.api.junit.Cucumber; import org.junit.runner.RunWith; @RunWith(Cucumber.class) @CucumberOptions(plug

当我编写一些cucumber测试时,我从一些文档中发现我需要在src/test/java/somepackage下创建一个runTest.java文件,其中包含配置cucumber的内容,如:

import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
import org.junit.runner.RunWith;

@RunWith(Cucumber.class)
@CucumberOptions(plugin = {"pretty"})
public class runTest {
}
我发现类名runTest很有趣,因为如果我将它重命名为任何其他名称,mvn-test将无法再找到它


我搜索了junit站点的名称转换,但没有找到任何相关文档。我只是想知道更多关于它的信息。

我认为公约是:

测试*.java或 *java或 *TestCase.java 它不是JUnit约定,而是定义它的Maven surefire插件:


参考:

我认为公约是:

测试*.java或 *java或 *TestCase.java 它不是JUnit约定,而是定义它的Maven surefire插件:

参考: