通过 Eclipse 运行 JUnit
我通过 Eclipse(Helios,1.3.0)通过 ant 构建文件和外部 ant 构建器运行 JUnit 测试。我想知道在运行它们时是否可以使用 Eclipes 的 JUnit UI,以便我可以看到其中的“绿色”或“红色”栏,而不是在控制台中看到成功/失败消息。非常感谢任何指点。谢谢!
I run my JUnit tests through Eclipse (Helios, 1.3.0) through an ant build file and an external ant builder. I was wondering if it's possible to use Eclipes's JUnit UI when running them so that I can see the 'green' or 'red' bar in there instead of seeing success/failure messages in the console. Any pointers are greatly appreciated. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您必须通过 ant 运行测试,则没有直接方法可以在 JUnit 视图中查看进度。但是,如果您使用 JUnit ant 任务并将测试结果的输出格式设置为
xml
:然后,您可以在 JUnit 窗口中打开该文件。单击最右侧的按钮并选择
导入
。然后导航到您要打开的文件:If you must run your tests via ant, then there is no direct way to see the progress in the JUnit view. However, if you are using the JUnit ant task and set the output format of your test results to
xml
:Then, you can open this file up in the JUnit window. Click on the button on the far right and select
Import
. Then navigate to the file you want to open:如果您有项目的 JUnit 参考,我认为您可以右键单击项目并选择
Run As > JUnit Test
将运行项目中的所有测试。查看这个帖子If you have JUnit reference for a project, I think you can right click on a project and select
Run As > JUnit Test
and that will run all the tests in the Project. Check out this postEclipse:编写和运行 JUnit 测试
Eclipse: Writing and running JUnit tests