2017-04-12 24 views
0

我想为eclipse插件编写单元测试用例。通过http://www.vogella.com/tutorials/EclipseTycho/article.html#run-the-build-with-the-tests,并创建了一个eclipse-test-plugin。使用mvn-tycho传递参数到依赖eclipse插件

所以,测试插件(我们称之为plugin-b)对另一个插件的插件(插件-a)有依赖性。 当我运行mvn clean install时,我可以看到tycho-surefire正在尝试运行测试,并且正在尝试启动插件-a。但是,插件-a需要一组虚拟机参数才能正确启动。我试图通过如下参数: mvn -Dabc.properties = bridge \ bundles \ com.blah.blah.blah.blah.bridge \ abc.properties clean install

但他们没有通过插件-一个。

任何帮助,非常感谢。

回答

0

终于想通了这一点:

MVN全新安装-Dtycho.testArgLine =“ - Dabc.properties = ../.. /包/ com.blah.blah.blah.blah.bridge/abc.properties “

这会将系统属性传递给测试运行时。

+0

从命令行(使用'-D')设置分叉测试VM的系统属性时,这是正确的选项。但是,您也可以将系统属性直接保存在POM中;只需将['元素](https://eclipse.org/tycho/sitedocs/tycho-surefire/tycho-surefire-plugin/test-mojo.html#systemProperties)添加到''的'tycho-surefire-plugin'。 –