是否可以将tycho-surefire配置为在测试阶段运行? [英] Is it possible to configure tycho-surefire to run in the test phase?

查看:93
本文介绍了是否可以将tycho-surefire配置为在测试阶段运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Maven并没有做很多事情,但是我了解一些基础知识.我们正在使用Tycho来构建RCP插件,我想知道为什么Tycho使用integration-test阶段来捆绑执行测试.

I haven't done a lot with Maven, but I understand the basics. We're using Tycho to build RCP plugins and I'm wondering why Tycho uses the integration-test phase to execute the tests in a bundle.

是否可以将某些类型的测试绑定到Maven的Tycho的test阶段而不是integration-test阶段?

Is it possible to bind some types of tests to the test phase of Maven for Tycho instead of the integration-test phase?

如果是,怎么办?

推荐答案

Tycho在OSGi容器中执行测试,这要求已编译的类已作为OSGi捆绑包打包.打包仅发生在package阶段,因此测试需要稍后执行.因此,默认情况下,tycho-surefire-pluginintegration-test阶段执行测试.

Tycho executes tests in an OSGi container, and this requires that the compiled classes are already packed as OSGi bundles. Packing only happens in the package phase, so the tests need to be executed later. Therefore, the tycho-surefire-plugin by default executes tests in the integration-test phase.

如果您可以在Eclipse中以"JUnit测试"(而不是"JUnit插件测试")运行测试,那么您的代码和所有依赖项都不需要OSGi容器.在这种情况下,您也可以使用maven-surefire-plugin运行测试.默认情况下,此插件在test阶段运行.我发现此博客描述了配置这是必要的.

If you can run your tests as "JUnit Test" in Eclipse (instead of as "JUnit Plug-in Test"), then your code and none of your dependencies require an OSGi container. In this case, you may also be able to run the tests with the maven-surefire-plugin. This plugin by default runs in the test phase. I've found this blog that describes the configuration which is necessary to do this.

这篇关于是否可以将tycho-surefire配置为在测试阶段运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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