vendredi 27 octobre 2017

jUnit run certain test cases from different test classes each having multiple tests

How do I run certain selected test cases from different test classes each of which has multiple tests in it?

For example, I have 3 test classes TestClassA, TestClassB and TestClassC. Each of these test classes is having 3 tests.

public class TestClassA {
  @Test
  public void testA1() {
    //test method
  }

  @Test
  public void testA2() {
    //test method
  }

  @Test
  public void testA3() {
    //test method
  }
}


public class TestClassB {
  @Test
  public void testB1() {
    //test method
  }

  @Test
  public void testB2() {
    //test method
  }

  @Test
  public void testB3() {
    //test method
  }
}


public class TestClassC {
  @Test
  public void testC1() {
    //test method
  }

  @Test
  public void testC2() {
    //test method
  }

  @Test
  public void testC3() {
    //test method
  }
}

With reference to the above sample code, I would like to run tests testA1, testA2, testB2, testC2 and testC3 all at once. Is there any configuration for the same? Thank you

Aucun commentaire:

Enregistrer un commentaire