Eclipse调试配置中的默认VM参数? [英] Default VM arguments in Eclipse debug configuration?
问题描述
当我使用TDD实现新功能时,我经常使用快捷键 Shift + Alt + DT
仅运行我当前正在使用的jUnit测试用例(而不是整个测试套件,这需要几分钟).
When I implement new features using TDD, I often use the shortcut Shift + Alt + D T
to run only the jUnit test case I am currently working on (and not the whole test suite, which takes a few minutes).
这将为当前Java源创建一个新的调试配置,并立即运行它.现在,我想在启用断言的情况下运行测试(VM选项 -ea
).
This creates a new Debug Configuration for the current Java source and runs it immediately. Now I would like to run the test with assertions enabled (VM option -ea
).
不幸的是,新调试配置的VM参数开始为空.我总是必须进入 Debug Configurations ...
→ Arguments
,然后将 -ea
添加到VM参数输入框中.
Unfortunately, the VM arguments for the new debug configuration starts empty. I always have to go into Debug Configurations...
→ Arguments
and add -ea
to the VM arguments input box.
是否有任何方法可以使Eclipse这些参数填充(在项目或工作空间范围内)默认选项?
Is there any way to have Eclipse these arguments populated with (project or workspace wide) default options?
推荐答案
Windows
→首选项
→ JUnit
可以选择在每次创建新的启动配置时添加 -ea
.还将 -ea
选项添加到调试配置"中.
Windows
→ Preferences
→ JUnit
has an option to add -ea
every time a new launch configuration is created. It adds the -ea
option to the Debug Configuration as well.
复选框旁边的全文为:
在创建新的JUnit启动配置时在VM参数中添加
-ea
Add
-ea
to VM arguments when creating a new JUnit launch configuration
这篇关于Eclipse调试配置中的默认VM参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!