Skip to end of metadata
Go to start of metadata
It finally seems like the Surefire plugin does handle categories.
Please read this link, it show how to simplify your setup.

At last - categories are possible to use in JUnit

Since the 4.8 version

Hope this will ease the implementation of using test-grouping

Thanks to David Saff for helping us reach this solution.

1. We will need a Suite to be run for each category.

Example for slow tests:

2. "Proxy" to include all tests:

The Challenge: "@Suite.SuiteClasses" need to specify which classes to be included.
What we want is to run all tests that has a given category. This challenge will be solved
by using ClasspathSuite extension to JUnit

3. Example of Test class:

Test annotations on class level includes all test-methods in the class.
If you add
to your test class definition, all test-methods in that class
will be run by the SlowTests category. This will happen even if the method only is marked with the FastTests category.

Category markers

SlowTests category

FastTests category

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.