Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-dev] Error when using AbstractTychoMojoTestCase

Hi Martin,

Without having looked into the details, I think that we don't have AbstractTychoMojoTestCase tests in the p2-modules of Tycho because this would require that Tycho's OSGi runtime is fired up. AFAIK, this would not work with the test harness. This also would explain the error message because "tycho-bundles-external" builds a zip file with the non-Tycho bundles in Tycho's OSGi runtime.

Note however that I haven't tried all this out myself. The tycho-p2-repository-plugin was contributed by Jan and myself when we were quite new to the project. So we may just not have been aware of this test harness, and you may in fact get it to work.

However before investing more into this, I wonder if it wouldn't be possible to test what you want by initializing the Mojo class yourself instead using the test harness.


> -----Original Message-----
> From: tycho-dev-bounces@xxxxxxxxxxx [mailto:tycho-dev-
> bounces@xxxxxxxxxxx] On Behalf Of SCHREIBER.Martin
> Sent: Donnerstag, 2. Oktober 2014 12:45
> To: tycho-dev@xxxxxxxxxxx
> Subject: [tycho-dev] Error when using AbstractTychoMojoTestCase
> Hi,
> within a tycho-plugin I tried to add a Unit test. This plugin (p2-
> repository-plugin) did not had any test till now, so I added the 2
> dependencies:
> <dependency>
>    <groupId>org.eclipse.tycho</groupId>
>    <artifactId>tycho-testing-harness</artifactId>
>    <version>${project.version}</version>
>    <scope>test</scope>
> </dependency>
> <dependency>
>    <groupId>org.apache.maven</groupId>
>   <artifactId>maven-compat</artifactId>
>   <scope>test</scope>
> </dependency>
> When I run the test which does
>         File basedir = getBasedir("additionalFiles");
>         getSortedProjects(basedir, null);
> ("additionalFiles" is a directory containing a pom.xml file within the
> "src/test/resources/" directory), the test fails complaining that the
> "tycho-bundles-external" is missing (see attachment).
> I tried to look at other plugins but could not find any difference in the
> dependencies or in the settings.
> Any suggestions?
> Thanks
> Martin

Back to the top