jeudi 28 avril 2016

Make jUnit runner run test class multiple times with different parameters

I have some jUnit4 test classes, which I want to run multiple times with different parameters passed in annotation. For example, like this:

@RunWith(MyClassRunner.class)
@Params("paramFor1stRun", "paramFor2ndRun")
class MyTest {
  @Test
  public void doTest() {..}
}

I assume Runner can help me with it, but I don't know how to implement this. Could you advice please?

Aucun commentaire:

Enregistrer un commentaire