如何在运行测试时使Netbeans使用特定的JVM参数? [英] How to make Netbeans use specific JVM parameters when running tests?

查看:375
本文介绍了如何在运行测试时使Netbeans使用特定的JVM参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Netbeans与Maven和TestNG。使用maven surefire插件运行测试时,我可以设置一些配置参数,特别是用于我的测试的记录级别(跟踪):

  -Dorg.slf4j.simpleLogger.defaultLogLevel = trace 
-Dorg.slf4j.simpleLogger.logFile = System.out

但是,在运行特定测试文件(CTRL + F6)或测试方法(运行聚焦测试方法)时,Netbeans不使用surefire(这是好的),因此忽略这些参数。 / p>

有没有办法在Netbeans运行测试时更改Netbeans使用的JVM参数?



这有点类似于这篇文章但我的问题是针对Netbeans的。

解决方案

来自Netbeans 7.2的文档(参见 Netbeans 7.2更改,部分Maven ):


...现在测试文件默认运行Maven,只是像Test Project ...


你使用的是哪个版本的Netbeans?可能你应该升级到7.2。


I'm using Netbeans with Maven and TestNG. When running tests with the maven surefire plugin, I can setup some configuration parameters, in particular the logging level used for my tests (trace):

-Dorg.slf4j.simpleLogger.defaultLogLevel=trace
-Dorg.slf4j.simpleLogger.logFile=System.out

However, when running a specific test file (CTRL + F6) or test method ("run focused test method"), Netbeans does not use surefire (which is good) and therefore ignores those parameters.

Is there a way to change the JVM parameters used by Netbeans when it runs tests that way?

This is somewhat similar to this other post but my question is specific to Netbeans.

解决方案

From the documentation of Netbeans 7.2 (see Netbeans 7.2 changes, section Maven) :

... Now Test File always runs Maven by default, just like Test Project ...

What version of Netbeans are you using? Probably you should just upgrade to 7.2.

这篇关于如何在运行测试时使Netbeans使用特定的JVM参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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