The JUnit (4.5.0) documentation states that if you annotate a static method with @BeforeClass
, it will be called after any similarly annotated methods in superclasses. This normally works, but if the method in the subclass happens to use the same name as that in a superclass (setUpClass for example), the superclass method will not be invoked first.