How to get a Fragment-Bundle into Tycho test runtime?

倖福魔咒の 提交于 2019-12-12 10:50:50

问题


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

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?

EDIT: 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 of the fragment bundle:

    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

extract from reactor pom.xml:

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

Thank you!


回答1:


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.



来源:https://stackoverflow.com/questions/13454654/how-to-get-a-fragment-bundle-into-tycho-test-runtime

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