Eclipse:绑定所有单元测试的一些键 [英] Eclipse: bind some key for all unit tests

查看:146
本文介绍了Eclipse:绑定所有单元测试的一些键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我练习TDD并经常运行我的测试。 Eclipse有一个很好的命令来运行最后启动的配置。但是当我在一些单元测试类中调用命令时,Eclipse仅运行当前单元测试类的测试。我想要运行所有的单元测试。
是的,我可以使用鼠标调用运行所有JUnit测试的命令,但要重复:我经常运行测试。

解决方案

您需要更改eclipse的运行模式。默认情况下,它将尝试运行所选或正在编辑的任何内容。你想要它总是运行最后执行的东西。



转到窗口 - >首选项 - >运行/调试 - >启动
选择始终启动以前的应用程序



然后,您可以使用所有测试用例定义TestSuite并运行它,或者为项目运行所有测试用例。一旦运行,您可以继续使用F11或control-F11重新运行。



希望这有帮助!
- Scott


I practice TDD and run my tests very often. Eclipse has a nice command to run the last-launched configuration. But when I invoke the command in some unit test class, Eclipse runs only the tests for current unit test class. I want run all my unit tests instead. Yes, I can use the mouse to invoke the command that runs all JUnit tests, but, to repeat: I run tests very often.

解决方案

You need to change eclipse's run mode. By default, it will try to run whatever is selected or being edited. You want to it always run the "last thing executed".

Go to Window->Preferences->Run/Debug->Launching Choose "Always Launch the Previous Application"

Then you can define a TestSuite with all of your test cases and run it, or run all test cases for the project. Once run, you can just keep re-running with F11 or control-F11.

Hope this helps! -- Scott

这篇关于Eclipse:绑定所有单元测试的一些键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆