You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Simon <sc...@gmail.com> on 2011/01/14 17:51:05 UTC

Maven Bundle Plugin and tests

Hello,

I'm recently switched to maven-bundle-plugin to build a project, and I
started porting my integration tests (multi-bundles) to use BND Testing
Harness (I like its simplicity and it's integrated into Eclipse with
BNDTools).

Now, I'm trying to get my tests running using Maven (which we're using for
the "production" build), ideally using mvn integration-test or mvn test.

Bnd already finds the bundles using its MavenRepository plugin, so I believe
I could have all the Bnd instructions to launch the test in the POM... But
how should I execute the tests? The doc doesn't say much about that. As far
as I can see, that's only missing step, since the POM can pass to Bnd the
list of runbundles (that can be retrieved from the local Maven repository),
the testsuites, etc.

Is there a test target in the Maven Bundle Plugin allowing me to just run
them (and ideally as a Surefire provider)? If there isn't, does anyone else
believe it would make sense?

Cheers,

Simon Chemouil

Re: Maven Bundle Plugin and tests

Posted by Peter Kriens <pe...@aqute.biz>.
I think it is MUCH easier to use bnd directly that attempt to re-use it through ant ...

Kind regards,

	Peter Kriens

On 18 jan 2011, at 16:21, Luke Patterson wrote:

> On Tue, Jan 18, 2011 at 7:51 AM, Simon <sc...@gmail.com> wrote:
>> The more complex part is integrating all of that together (I don't know much
>> about writing Maven plugins).
>> 
>> On Tue, Jan 18, 2011 at 2:00 PM, Peter Kriens <pe...@aqute.biz>wrote:
>> 
>>> The maven plugin is just used for packaging so I do not think there is much
>>> support for testing a la bnd. In ant it is quite easy though.
>>> 
>>> I guess someone needs to write a maven plugin for this ...
>>> 
> 
> if you want to quickly wrap ant tasks in a maven plugin, maybe you
> could use the groovy+ant pattern, antbuilder is pretty nice
> http://docs.codehaus.org/display/GROOVY/Using+Ant+from+Groovy
> 
> for example, i'm quickly wrapping the JaCoCo Ant tasks, example here:
> http://code.google.com/p/indoorsdog/source/browse/#svn%2Fjacoco%2Ftrunk%2Fjacoco-maven-plugin
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Maven Bundle Plugin and tests

Posted by Luke Patterson <lu...@gmail.com>.
On Tue, Jan 18, 2011 at 7:51 AM, Simon <sc...@gmail.com> wrote:
> The more complex part is integrating all of that together (I don't know much
> about writing Maven plugins).
>
> On Tue, Jan 18, 2011 at 2:00 PM, Peter Kriens <pe...@aqute.biz>wrote:
>
>> The maven plugin is just used for packaging so I do not think there is much
>> support for testing a la bnd. In ant it is quite easy though.
>>
>> I guess someone needs to write a maven plugin for this ...
>>

if you want to quickly wrap ant tasks in a maven plugin, maybe you
could use the groovy+ant pattern, antbuilder is pretty nice
http://docs.codehaus.org/display/GROOVY/Using+Ant+from+Groovy

for example, i'm quickly wrapping the JaCoCo Ant tasks, example here:
http://code.google.com/p/indoorsdog/source/browse/#svn%2Fjacoco%2Ftrunk%2Fjacoco-maven-plugin

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Maven Bundle Plugin and tests

Posted by Simon <sc...@gmail.com>.
Hi Peter,

That was my guess but I prefer to make sure it's not a "hidden feature"
before starting to work on it... (like those component properties ;)).

I think the task is pretty simple in terms of feature, it's "just" writing a
Maven surefire provider for the maven-bundle-plugin that just spawns a Bnd
test task (similar to the ant bnd test task)... The test instructions can be
passed in the <instructions> tag in the POM just like other Bnd instructions
(or, improved version would map surefire configuration to bnd instructions).

The more complex part is integrating all of that together (I don't know much
about writing Maven plugins).

Anyway, as I really need this quickly, I already started investigating and
I'm going to do it and add the feature to the maven-bundle-plugin. If I can
make it work, I'll submit a patch.

Cheers,

Simon

On Tue, Jan 18, 2011 at 2:00 PM, Peter Kriens <pe...@aqute.biz>wrote:

> The maven plugin is just used for packaging so I do not think there is much
> support for testing a la bnd. In ant it is quite easy though.
>
> I guess someone needs to write a maven plugin for this ...
>
> Kind regards,
>
>        Peter Kriens
>
> On 14 jan 2011, at 17:51, Simon wrote:
>
> > Hello,
> >
> > I'm recently switched to maven-bundle-plugin to build a project, and I
> > started porting my integration tests (multi-bundles) to use BND Testing
> > Harness (I like its simplicity and it's integrated into Eclipse with
> > BNDTools).
> >
> > Now, I'm trying to get my tests running using Maven (which we're using
> for
> > the "production" build), ideally using mvn integration-test or mvn test.
> >
> > Bnd already finds the bundles using its MavenRepository plugin, so I
> believe
> > I could have all the Bnd instructions to launch the test in the POM...
> But
> > how should I execute the tests? The doc doesn't say much about that. As
> far
> > as I can see, that's only missing step, since the POM can pass to Bnd the
> > list of runbundles (that can be retrieved from the local Maven
> repository),
> > the testsuites, etc.
> >
> > Is there a test target in the Maven Bundle Plugin allowing me to just run
> > them (and ideally as a Surefire provider)? If there isn't, does anyone
> else
> > believe it would make sense?
> >
> > Cheers,
> >
> > Simon Chemouil
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: Maven Bundle Plugin and tests

Posted by Peter Kriens <pe...@aqute.biz>.
The maven plugin is just used for packaging so I do not think there is much support for testing a la bnd. In ant it is quite easy though.

I guess someone needs to write a maven plugin for this ...

Kind regards,

	Peter Kriens

On 14 jan 2011, at 17:51, Simon wrote:

> Hello,
> 
> I'm recently switched to maven-bundle-plugin to build a project, and I
> started porting my integration tests (multi-bundles) to use BND Testing
> Harness (I like its simplicity and it's integrated into Eclipse with
> BNDTools).
> 
> Now, I'm trying to get my tests running using Maven (which we're using for
> the "production" build), ideally using mvn integration-test or mvn test.
> 
> Bnd already finds the bundles using its MavenRepository plugin, so I believe
> I could have all the Bnd instructions to launch the test in the POM... But
> how should I execute the tests? The doc doesn't say much about that. As far
> as I can see, that's only missing step, since the POM can pass to Bnd the
> list of runbundles (that can be retrieved from the local Maven repository),
> the testsuites, etc.
> 
> Is there a test target in the Maven Bundle Plugin allowing me to just run
> them (and ideally as a Surefire provider)? If there isn't, does anyone else
> believe it would make sense?
> 
> Cheers,
> 
> Simon Chemouil


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org