如何在 eclipse 内的 junit4 测试运行程序中设置 -noloading 选项

发布于 2024-11-28 11:53:35 字数 127 浏览 12 评论 0原文

为了从 eclipse 内部运行我的 apache axis 集成测试,我需要在 eclipse junit 测试运行程序上设置 -noloading 选项。有谁知道我该怎么做?

我正在使用 eclipse 版本:3.5.1

In order to run my apache axis integration tests from inside eclipse, I need to set the -noloading option on the eclipse junit test runner. Does anyone know how I can do this??

I am using eclipse Version: 3.5.1

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

甜妞爱困 2024-12-05 11:53:35

您可以通过添加条目loading=false来配置junit.properties文件。找到的文件应该位于“user.home”中。

有关更多信息,请查看 jUnit 主页 [http://junit.sourceforge.net/junit3.8.1/index.html]。是的,我知道这个问题与 jUnit4 有关。我仔细检查了 junit.runner.BaseTestRunner 并且加载属性选项仍然存在。

You can configure a junit.properties file by adding an entry loading=false. The file located should be located in the "user.home".

For more information check out the jUnit homepage [http://junit.sourceforge.net/junit3.8.1/index.html]. Yes I know this question is related to jUnit4. I double checked the junit.runner.BaseTestRunner and the loading properties option is still present.

疧_╮線 2024-12-05 11:53:35

不要设置 -noloading 参数(我认为当前的 Junit TestRunner 不支持该参数),而是在 junit 类中添加此方法。它将直接解决您的问题

@BeforeClass
public static void beforeClass() {
 System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.Log4JLogger");
 System.setProperty("org.apache.commons.logging.LogFactory", "org.apache.commons.logging.impl.LogFactoryImpl");
}

rather than set the -noloading parameter (which I don't believe is supported in the current Junit TestRunner), add this method in your junit class. It will solve your issue directly

@BeforeClass
public static void beforeClass() {
 System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.Log4JLogger");
 System.setProperty("org.apache.commons.logging.LogFactory", "org.apache.commons.logging.impl.LogFactoryImpl");
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文