如何使Fragment-Bundle进入Tycho测试运行时? [英] How to get a Fragment-Bundle into Tycho test runtime?

查看:110
本文介绍了如何使Fragment-Bundle进入Tycho测试运行时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个依赖它的实现捆绑包和片段捆绑包(MANIFEST中的Fragment-Host).此外,还有一些测试包.

I have an implementation bundle and fragment bundle dependent on it (Fragment-Host in MANIFEST). Moreover, there is a bundle with some tests.

现在,我想测试我的实现并使用tycho-surefire-plugin.带有测试的包通过MANIFEST中的Require-Bundle来指代实现包. 到目前为止,一切都很好.问题是如何将片段捆绑包放入测试运行时?我已经在我的eclipse-test-plugin中尝试了tycho-surefire-plugin的配置中的依赖项.但这是行不通的.正确的方法是什么?

Now I want to test my implementation and use the tycho-surefire-plugin. The bundle with tests refers to the implementation bundle by means of Require-Bundle in MANIFEST. So far so good. The question is how do I get the fragment bundle into the test runtime? I have tried the dependency in the configuration of the tycho-surefire-plugin in my eclipse-test-plugin. But it does not work. What is the right way?

我的测试插件的pom.xml

pom.xml of my test plugin

    <plugin>
     <groupId>org.eclipse.tycho</groupId>
     <artifactId>tycho-surefire-plugin</artifactId>
     <version>${tycho-version}</version>
     <configuration>
      <testSuite>com.example.impl.tests</testSuite>
      <testClass>com.example.impl.tests.MyTest</testClass>
      <dependencies>
       <dependency>
       <type>eclipse-plugin</type>
       <artifactId>com.example.impl.config</artifactId>
       <version>1.0.0</version>
      </dependency>         
    </dependencies>
    </configuration>
    </plugin>

片段束的清单:

    Manifest-Version: 1.0
    Bundle-ManifestVersion: 2
    Bundle-Name: com.example.config
    Bundle-SymbolicName: com.example.config
    Bundle-Version: 1.0.0.qualifier
    Bundle-Vendor: example
    Fragment-Host: com.example.impl;bundle-version="1.0.0.qualifier"
    Bundle-ClassPath: resources/
    Bundle-RequiredExecutionEnvironment: JavaSE-1.7

从反应堆pom.xml中提取:

extract from reactor pom.xml:

    <modules>
     <module>../com.example.impl</module> 
     <module>../com.example.impl.config</module>
     <module>../com.example.impl.tests</module>
    </module>

谢谢!

推荐答案

我自己找到了答案.如果有人遇到同样的问题:Typcho不会自动扩展Fragment-Host bundle-version中的.qualifier版本.

It seams I have found an answer myself. In case anyone has the same problem: .qualifier version in Fragment-Host bundle-version is not automatically expanded by Tycho.

这篇关于如何使Fragment-Bundle进入Tycho测试运行时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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