0

I have two tests in different classes but both are inherited from the same abstract base class. The base class has only one test. And these tests have been used in both the class using different kind of request & input file.

For each entry in File1.csv, test in Class1 creates an entry in File2.csv file. This will be the input for the test in Class2.

I am trying to do some clean up due to the previous test-run using @BeforeClass as this is specific to class level. But @BeforeClass is not being executed. I have tried by having @BeforeClass in both Base Class & Class1. None of them are working. Any other alternative suggestion are also welcome.

dg99
  • 5,456
  • 3
  • 37
  • 49
  • 1
    Could you post some code showing how you are using `@BeforeClass`? – khelwood Apr 10 '15 at 22:07
  • Also, are you using `JUnit` or `TestNG`? If you are using `TestNG`, seems like it has some weird ordering of execution, here is solution to that maybe: [Before class and inheritance](http://stackoverflow.com/questions/2132734/beforeclass-and-inheritance-order-of-execution) – Damir Ciganović-Janković Apr 10 '15 at 22:19
  • @BeforeClass(alwaysRun = true) public void cleanUpDatasets() {} – user2680325 Apr 10 '15 at 23:03

0 Answers0