Folks,
Say I have a complicated sub-classed test suite that I run regularly. As a part of this, I am trying to ensure that each test class is executed strictly one after the other, and that Test2
's @BeforeClass
method will NOT start before Test1
's @AfterClass
is done. Is this a valid assumption to make?
An Example Scenario:
Class TestBase
has an @BeforeClass
and an @AfterClass
method.
Class T1
derives from TestBase
.
Class T2
derives from `TestBase.
We run T1
and T2
together from Ant / Eclipse. There are some common static objects from TestBase reused between T1
and T2
, meaning I have to be totally sure that these are destroyed completely in AfterClass
before the next round of BeforeClass
start to initialize the same. Can I be sure of this with the basic usage outlined above?
I have a strong suspicion that this is not happening, but simplistic tests are not proving the same. Documentation doesn't talk about this either. So I want to ensure that I am not trying to solve a systemic issue that can be solved otherwise.