Using JUnit categories vs simply organizing tests in separate classes
问题 I have two logical categories of tests: plain functional unit tests (pass/fail) and benchmark performance tests that are just for metrics/diagnostics. Currently, I have all test methods in a single class, call it MyTests : public class MyTests { @Test public void testUnit1() { ... assertTrue(someBool); } @Test public void testUnit2() { ... assertFalse(someBool); } @Test @Category(PerformanceTest.class) public void bmrkPerfTest1() { ... } @Test @Category(PerformanceTest.class) public void