在Eclipse中运行单个JUnit测试 [英] Running a single JUnit test in Eclipse
问题描述
在包资源管理器中展开类。它应该告诉你所有的方法。右键单击要运行的一种方法,然后从上下文菜单中选择Run As - > JUnit(仅使用Eclipse 3.4.1测试)。在JUnit结果视图中的单个条目上也选择运行以重新运行测试工作方式相同。
If I have a test suite with multiple tests, when I try to run a single unit test, either from the context menu of the code editor, or from the JUnit view, it seems to insist on always running the entire suite, rather than the single test. Is there a way to disable to change this behavior so that I can ask to to run that, and only that, test.
In the package explorer unfold the class. It should show you all methods. Right click on the one method you want to run, then select Run As -> JUnit from the context menu (just tested with Eclipse 3.4.1). Also selecting "Run" on a single entry in the JUnit-results view to re-run a test works in the same way.
这篇关于在Eclipse中运行单个JUnit测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!