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

1

8

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!

Chlordane answered 19/11, 2012 at 13:20 Comment(3)
Adding a dependency in the configuration of the tycho-surefire-plugin is the right way. Can you provide details of the configuration you tried?Oberland
It seams I have found an answer myself. In case anyone has the same problem: .qualifier version in Fragment-Host bundle-version does not automatically expanded by Tycho.Chlordane
Anna, since you have found the answer to your own question, you should write this into an answer. Stack Overflow explicitly encourages answering your own questions so that others can benefit from your insight.Oberland
C
8

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.

Chlordane answered 28/11, 2012 at 6:39 Comment(1)
How did you figured this out? Cause I think if this is true, that's a bug, isn't it?Devious

© 2022 - 2024 — McMap. All rights reserved.