Currently, all of my JUnit tests extend from a common base class that provides methods tagged with @BeforeClass
and @AfterClass
annotations - all thes
You can use the @BeforeClass
and @AfterClass
IN THE SUITE CLASS.
This will run the methods before any of the test classes in the suite execute and after all the test classes finish (respectively)
This way you can run them only once.
//..usual @RunWith etc annotations here
public class MySuite{
@BeforeClass
public static void setup(){
}
@AfterClass
public static void tearDown(){
}
}