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 或回归测试在 Jenkins 上运行,在每个测试类之后删除堆上的所有变量(在它开始新的测试类之前)?还是最后被删除?
只要 JUnit 运行,它就会保留对每个测试的引用。这意味着您可以为每个测试方法获得一(1) 个测试用例类实例,并且这些实例会一直存在,直到 JUnit 打印测试结果。
如果内存不足,则需要在方法中设置测试实例的null字段@After。
null
@After