Cleanup after all junit tests

前端 未结 5 1094
小鲜肉
小鲜肉 2020-12-02 22:38

In my project I have to do some repository setup before all tests. This is done using some tricky static rules. However I\'ve got no clue how to do clean up after all the te

5条回答
  •  萌比男神i
    2020-12-02 23:03

    You can always write your custom TestRunner. However, before you do that you need to evaluate the need for the same. It is better to use @BeforeClass and @AfterClass. Another example I can point to is, the fashion in which hibernate allows users to do unit testing using 'import.sql'.

提交回复
热议问题