According to this @BeforeClass document, superclass methods will execute to those of the current class. But this does not happen in my case.
I am using junit 4.8.1.
Could you tell me what I am doing wrong?
My parent class is as follows:
public abstract class AbstractPromoterUnitTest extends TestCase {
@BeforeClass
public static void setUpOnce() {
}
}
These are child elements:
@RunWith(JUnit4.class)
public abstract class NormalPromoterUnitTest extends AbstractPromoterUnitTest{
@BeforeClass
public static void setUpOnce() {
}
}
NormalPromoterUnitTest.setUpOnce () is called. AbstractPromoterUnitTest.setUpOnce () is not.
source
share