Junit:更改测试运行顺序 [英] Junit: changing sequence of test running
问题描述
我在一堂课中进行了100项测试,然后单击测试项目(...)"来运行所有测试.它们以随机的顺序运行,我希望它们以特定的顺序运行-从一开始到最后,与我编写它们的顺序相同.在eclipse中这不是问题,因为eclipse就是这样工作的,如何在netbeans中做到这一点?
I have a big mess with 100 tests in one class and running all of them by clicking "Test project (...). They run in a random order and I would like them to run in a specific order - from beginning to the end, the same order that I wrote them. In eclipse it's not a problem because eclipse just works like that, how to do it in netbeans?
任何帮助将不胜感激.
编辑(由于回答):需要测试顺序才能清除日志.他们是独立的.
Edit (due to answers): Tests order is required for the clearance of the log. They are independent.
推荐答案
如果您的测试需要以特定的顺序运行,则说明您的设计有问题. 需要一个接一个地运行的2个测试是1个测试.在寻找解决方案之前,请考虑一下这一点.
If your tests needs to run in a specific order, something is wrong with your design. 2 test that needs to run one after another are 1 test. Consider this before searching for a solution.
选中此 https://blogs.oracle.com/mindless/entry/controlling_the_order_of_junit
这篇关于Junit:更改测试运行顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!