JUnit 4 @BeforeClass & @AfterClass when using Suites
Write a @BeforeClass method in the AllTests class which will be executed when the suite is started. public class MyTests1 { @BeforeClass public static void beforeClass() { System.out.println(“MyTests1.beforeClass”); } @Before public void before() { System.out.println(“MyTests1.before”); } @AfterClass public static void afterClass() { System.out.println(“MyTests1.AfterClass”); } @After public void after() { System.out.println(“MyTests1.after”); } @Test public void test1() … Read more