How to run all tests belonging to a certain Category in JUnit 4

Posted by Jennifer | Updated on

Want to run all tests belonging to a certain Category in JUnit 4 I found out one possible way to achieve what I want, but I don’t consider this to be the best possible solution as it relies on ClassPathSuite library that is not part of JUnit.

I define the test suite for slow tests like this:

AllTests class is defined like this:

@RunWith(ClasspathSuite.class)
public class AllTests {
}


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers