I always enjoyed running only one test of a test class. Now I'm using test suites to order my tests by tested methods into separate classes. However, Eclipse is not running the @BeforeClass-method if I want to run a single test of a test suite.
I have the following test setup:
@RunWith(Suite.class) @SuiteClasses({ Test1.class, Test2.class }) public class TestSuite { @BeforeClass public static void setup (){ // essential stuff for Test1#someTest } public static class Test1{ @Test public void someTest(){} } } When I run someTest, it fails because TestSuite#setup isn't run. Is there a way to fix this?