Is it possible to configure tycho-surefire to run in the test phase?

痞子三分冷 提交于 2019-12-08 17:28:39

问题


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.

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

If so, how?


回答1:


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.

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.



来源:https://stackoverflow.com/questions/28721925/is-it-possible-to-configure-tycho-surefire-to-run-in-the-test-phase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!