Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/349.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
Java 测试方法的自定义运行程序,而不是在类级别-是否可能?_Java_Junit_Powermock_Junit Runner_Powermockrunner - Fatal编程技术网

Java 测试方法的自定义运行程序,而不是在类级别-是否可能?

Java 测试方法的自定义运行程序,而不是在类级别-是否可能?,java,junit,powermock,junit-runner,powermockrunner,Java,Junit,Powermock,Junit Runner,Powermockrunner,是否可以在测试类中为每个测试方法指定一个自定义运行程序?即: Class SomeTests { public void test1() { } public void test2() { } // For this test only, is it possible // to specify a different runner, for // example : `PowerMockRunner` public void test3() { } } 您是否尝试过使用

是否可以在测试类中为每个测试方法指定一个
自定义运行程序
?即:


Class SomeTests {

public void test1() {

}

public void test2() {
}


// For this test only, is it possible
// to specify a different runner, for 
// example : `PowerMockRunner`
public void test3() {  
}

}


您是否尝试过使用JUnit5的
@ExtendWith
注释?@Progman:谢谢您的回复。我正在使用JUnit4。因此,询问是否有可能根据试验方法指定转轮。