Search code examples
javajunittest-suite

JUnit 4 Test Suites


How do I create test suites with JUnit 4?

All the documentation I've seen doesn't seem to be working for me. And if I use the Eclipse wizard it doesn't give me an option to select any of the test classes I have created.


Solution

  • import org.junit.runners.Suite;
    import org.junit.runner.RunWith;
    
    @RunWith(Suite.class)
    @Suite.SuiteClasses({TestClass1.class, TestClass2.class})
    public class TestSuite {
      //nothing
    }