9
我想知道是否可以在定义参数化测试时以编程方式并行运行JUnit测试。这个想法将能够像Eclipse中的常规JUnit测试一样运行它们。在Eclipse中并行运行JUnit参数化测试
我当前的代码是类似于:
@RunWith(Parameterized.class)
public class JUnitDivideClassTests {
@Parameters
public static Collection<Object[]> data() {
return Arrays.asList(new Object[][] { { 12, 3, 4 }, { 12, 2, 6}, { 12, 4, 3 }});
}
private int n;
private int d;
private int q;
public JUnitDivideClassTests(int n, int d, int q) {
this.n = n;
this.d = d;
this.q = q;
}
@Test
public void test() {
Assert.assertEquals(q, n/d);
}
}
如发现@http://codemadesimple.wordpress.com/2012/01/17/paramtest_with_junit/
它的工作原理,谢谢 –