Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经在基于 JUnit(我认为是 3.8.x)的 Groovy 中编写了一些单元测试,并且我注意到测试修改的文件在测试退出后会恢复。它们似乎在tearDown()调用方法后被重写,并恢复到它们之后的状态setUp()。有没有其他人看到过这种行为?可以禁用吗?
tearDown()
setUp()
JUnit 为每个方法创建一个新的 Test 实例,导致 setUp() 和 tearDown() 被多次调用。