jeudi 25 août 2016

JUnit testing - test suite of test suites

Unit tests are organized into feature specific suites, like follows:

@SuiteClasses({TestFeatureA_1.class, TestFeatureA_2.class, TestFeatureA_3.class})
@IncludeCategory(NightlyBuild.class)
@RunWith(Categories.class)
class FeatureATestSuite {}

When executing this with mvn clean install -Dtest=FeatureATestSuite, the test cases annotated with @Category(NightlyBuild.class) are executed. So far so good.

I want to create a suite with name NightlyBuildTestSuite, which refers to FeatureATestSuite, FeatureBTestSuite, FeatureCTestSuite, ..., and executes all the test suites. The point is that I want to avoid listing all the suite classes again, as the lists are long and are changing frequently.

What is the easiest way to do this?

There is a limitation: as we already have thousands of properly categorized test cases, playing around with categories is not an option. Furthermore as it is written in Scala, a Scala-specific solution is also accepted (Java is fine, too). Than you!

Aucun commentaire:

Enregistrer un commentaire