在Eclipse中的单独JVM中运行每个JUnit测试? [英] Running each JUnit test in a separate JVM in Eclipse?
问题描述
我可以在Eclipse中启用测试隔离吗?我不介意运行时间需要更长时间。
长期来看,我会清理不正当的测试,但在短期内我想得到测试工作。
如果在Eclipse中使用Ant,您可以设置JUnit任务为每个测试分配一个新的JVM进程,提供隔离。
http ://ant.apache.org/manual/Tasks/junit.html
I have a project with nearly 500 individual tests in around 200 test classes. Some of these tests don't do a great job of tearing down their own state after they're finished, and in Eclipse this results in some tests failing. The tests all pass when running the test suite from the command line via Ant.
Can I enable 'test isolation' somehow in Eclipse? I don't mind if it takes longer to run.
Long term, I will clean up the misbehaving tests, but in the short term I'd like to get the tests working.
If you use Ant in Eclipse, you can set the JUnit task to fork a new JVM process for each test, providing isolation.
http://ant.apache.org/manual/Tasks/junit.html
这篇关于在Eclipse中的单独JVM中运行每个JUnit测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!