title: Java Junit4 Supporting extended base class
body: <p>a question:</p>
  
  <p>When I do something like:</p>
  
  <pre><code>package path.to.common.package.test;
  @BeforeClass
  public class CommonTestSetup {
  
    public void setUp() {
     // Setup Stiff
    }
  }
  </code></pre>
  
  <p>And the other class setup in the same package:</p>
  
  <pre><code>package path.to.common.package.test;
  public class TestTest extends CommonTestSetup {
      @Test
      public void testGetTestReturnsCorrectStrings() {
      // do asserts etc
      }
  }
  </code></pre>
  
  <p>And then executing JUnit test on <code>testGetTestReturnsCorrectStrings</code> I am getting an error:</p>
  
  <pre><code>org.junit.runners.model.InvalidTestClassError: Invalid test class 'org.junit.runner.manipulation.Filter':
    1. No runnable methods
      at org.junit.runners.ParentRunner.validate(ParentRunner.java:456)
      at org.junit.runners.ParentRunner.&lt;init&gt;(ParentRunner.java:99)
      at org.junit.runners.BlockJUnit4ClassRunner.&lt;init&gt;(BlockJUnit4ClassRunner.java:84)
      at org.junit.runners.JUnit4.&lt;init&gt;(JUnit4.java:23)
      at org.junit.internal.builders.JUnit4Builder.runnerForClass(JUnit4Builder.java:10)
      at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:66)
      at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:37)
      at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:66)
      at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:39)
      at org.junit.internal.requests.FilterRequest.getRunner(FilterRequest.java:36)
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createFilteredTest(JUnit4TestLoader.java:80)
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:71)
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:46)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:523)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:761)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:461)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:207)
  </code></pre>
  
  <p>Why is that? Does it mean JUnit 4 does not support Test classes extending a base class?</p>
  
  <p>The idea behind this was to create a single SetUp base class, shared by many other test classes that need it.
  Originally I even tried to have the base class in another package entirely, then moved it to the same package for testing, and got a different error (the one above).</p>