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。因此,询问是否有可能根据试验方法指定转轮。