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!

Anna
  • 233
  • 2
  • 8
  • Adding a dependency in the configuration of the tycho-surefire-plugin is the right way. Can you provide details of the configuration you tried? – oberlies Nov 19 '12 at 13:43
  • 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. – Anna Nov 19 '12 at 14:26
  • 1
    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. – oberlies Nov 21 '12 at 13:33

1 Answers1

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.

Anna
  • 233
  • 2
  • 8