Eclipse调试配置中的默认VM参数? [英] Default VM arguments in Eclipse debug configuration?

查看:54
本文介绍了Eclipse调试配置中的默认VM参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用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 选项添加到调试配置"中.

WindowsPreferencesJUnit 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屋!

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