views:

37

answers:

1

For example, a test case named ExampleTest

ExampleTest {
    testA{};
    testB{};
    testC();
}

I could run all this class with TestSuite.addTestSuite(ExampleTest.class);

but, how to select testA and testB run into TestSuite?

+2  A: 

2 Ideas:

  • See if it makes sense to split ExampleTest into 2 test classes based on your partition
  • Otherwise use Categories to tag your tests and then run tests which belong to a specific category. Its simpler in NUnit, JUnit seems to require you to create an empty/ marker interface to get this done. A sample link with code.
Gishu
+1 for categories, but it looks as if question is for JUnit 3
grigory