paxexam labs question

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

paxexam labs question

Vestal, Rick
Hi all,

Finally back to some osgi work and was very happy to see ServiceMix 4.4.0 out so that I can move to it and not lose the paxexam karaf test framework.

I've got a question on how other users are testing their modules.

Ideally, I'd like to have a set of integration tests live in the osgi bundle module that use the paxexam labs work.  The problem I'm running into is that the 'latest' version of my osgi bundle isn't what is provisioned as the provision option is picking up the last one installed into my local maven repository.

Is there an option to make the provision call use the 'just packaged' bundle?

Thanks,

-- Rick
Reply | Threaded
Open this post in threaded view
|

Re: paxexam labs question

earcam

Not sure if this is available in the Karaf version, but in vanilla Pax Exam you can do:

bundle("reference:file:" + org.ops4j.pax.exam.util.PathUtils.getBaseDir() + "/target/classes/")

This requires the manifest is in the correct place (i.e. the target/classes directory is an unzipped mirror of the final bundle).

The only other option (AFAIK) is to move your integration test into a separate module that's built after your bundle's module (personally I don't like this as it moves the test away from its subject - though obviously this is fine/necessary for end-to-end tests).




On 17 January 2012 21:12, Vestal, Rick <[hidden email]> wrote:
Hi all,

Finally back to some osgi work and was very happy to see ServiceMix 4.4.0 out so that I can move to it and not lose the paxexam karaf test framework.

I've got a question on how other users are testing their modules.

Ideally, I'd like to have a set of integration tests live in the osgi bundle module that use the paxexam labs work.  The problem I'm running into is that the 'latest' version of my osgi bundle isn't what is provisioned as the provision option is picking up the last one installed into my local maven repository.

Is there an option to make the provision call use the 'just packaged' bundle?

Thanks,

-- Rick

Reply | Threaded
Open this post in threaded view
|

Re: paxexam labs question

jbonofre
In reply to this post by Vestal, Rick
Hi,

I guess that you name "pax exam lab" is the Karaf Pax Exam, especially
providing:

org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
org.ops4j.pax.exam.CoreOptions.maven;

You can execute commands directly in your Karaf itests with something like:

String response;
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
PrintStream printStream = new PrintStream(byteArrayOutputStream);
CommandProcessor commandProcessor = getOsgiService(CommandProcessor.class);
CommandSession commandSession =
commandProcessor.createSession(System.in, printStream, System.err);
commandSession.execute("bundle:install mvn:groupId/artifactId...");
printStream.flush();
String output = return byteArrayOutputStream.toString();

So it means that you can install your bundle/feature, etc as you can do
in Karaf directly.

Regards
JB

On 01/17/2012 10:12 PM, Vestal, Rick wrote:

> Hi all,
>
> Finally back to some osgi work and was very happy to see ServiceMix
> 4.4.0 out so that I can move to it and not lose the paxexam karaf test
> framework.
>
> I've got a question on how other users are testing their modules.
>
> Ideally, I'd like to have a set of integration tests live in the osgi
> bundle module that use the paxexam labs work.  The problem I'm running
> into is that the 'latest' version of my osgi bundle isn't what is
> provisioned as the provision option is picking up the last one installed
> into my local maven repository.
>
> Is there an option to make the provision call use the 'just packaged'
> bundle?
>
> Thanks,
>
> -- Rick

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|

Re: paxexam labs question

Andreas Pieber
In reply to this post by Vestal, Rick
instead of using mvn:... you can also use file:... and pointing it to the one in your target directory.

Kind regards,
Andreas

On Tue, Jan 17, 2012 at 22:12, Vestal, Rick <[hidden email]> wrote:
Hi all,

Finally back to some osgi work and was very happy to see ServiceMix 4.4.0 out so that I can move to it and not lose the paxexam karaf test framework.

I've got a question on how other users are testing their modules.

Ideally, I'd like to have a set of integration tests live in the osgi bundle module that use the paxexam labs work.  The problem I'm running into is that the 'latest' version of my osgi bundle isn't what is provisioned as the provision option is picking up the last one installed into my local maven repository.

Is there an option to make the provision call use the 'just packaged' bundle?

Thanks,

-- Rick