You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Andreas Junius <AJ...@internode.com.au> on 2012/02/01 03:18:20 UTC

How to test Karaf console extension?

Hi ServiceMix users,

I wrote a couple of console commands for the Karaf console, as explained here: http://karaf.apache.org/manual/2.2.5/developers-guide/extending-console.html

Now I need to do some unit tests and I wonder if there is a kind of best practise? How would you do it (especially for code which accesses OSGi services)? 

Cheers,
Andy 

Re: How to test Karaf console extension?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Junius,

You have pax-exam-karaf which allow you to spin off any Karaf/ServiceMix 
custom distribution and directly execute command on it.

You have an usage example here:
http://svn.apache.org/repos/asf/karaf/cellar/branches/cellar-2.2.x/itests/src/test/java/org/apache/karaf/cellar/itests/CellarTestSupport.java

Regards
JB

On 02/01/2012 03:18 AM, Andreas Junius wrote:
> Hi ServiceMix users,
>
> I wrote a couple of console commands for the Karaf console, as explained here: http://karaf.apache.org/manual/2.2.5/developers-guide/extending-console.html
>
> Now I need to do some unit tests and I wonder if there is a kind of best practise? How would you do it (especially for code which accesses OSGi services)?
>
> Cheers,
> Andy

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com