我可以在使用 Parameterized 类运行的 junit 测试类中使用多个 @Parameters 方法吗?
@RunWith(value = Parameterized.class)
public class JunitTest6 {
private String str;
public JunitTest6(String region, String coverageKind,
String majorClass, Integer vehicleAge, BigDecimal factor) {
this.str = region;
}
@Parameters
public static Collection<Object[]> data1() {
Object[][] data = {{some data}}
return Arrays.asList(data);
}
@Test
public void pushTest() {
System.out.println("Parameterized str is : " + str);
str = null;
}
@Parameters
public static Collection<Object[]> data() {
Object[][] data = {{some other data}}
return Arrays.asList(data);
}
@Test
public void pullTest() {
System.out.println("Parameterized new str is : " + str);
str = null;
}
}