0

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

Amit Singh
  • 31
  • 1
  • 7
  • when you say "all at once" can you be more specific, please? Do you mean in parallel or one after the other in a specific order? – Tom Mac Oct 27 '17 at 10:20
  • I mean all the tests in a single run just like running all the test cases from a class as we do in IntelliJ and jUnit configuration. – Amit Singh Oct 27 '17 at 12:21

0 Answers0