Better way to initiate JUnit test cases using Felix/Karaf?

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

Better way to initiate JUnit test cases using Felix/Karaf?

Haddock
Hello,
 
I've taken over some application written OSGi using Felix and Karaf being
deployed as a docker container. I have basically two (beginner) questions
here:
 
* It seems that the JUnit test cases are deployed together with the bundle
and started when the bundle's start method is invoked. Question is whether
there is a way to run a changed JUnit test case without having to build and
deploy the bundle in Karaf.
 
* I have a hard time getting remote debugging into the OSGi bundle to work.
The debug connection has to "go through" the docker container and Karaf to
reach the breakpoint inside the code of the bundle. Has anyone had any
success on this.
 
Thanks and kind regards, Haddock
Reply | Threaded
Open this post in threaded view
|

Re: Better way to initiate JUnit test cases using Felix/Karaf?

jbonofre
Hi,

if you use maven, test are not included. So your junit test cases and
deps should be in src/test/java.

For remote debug, it's really easy: just start karaf with debug option
(./karaf debug), then connect your IDE to the 5005 remote. You will have
your breakpoint handled.

Regards
JB

On 11/06/2018 13:54, [hidden email] wrote:

> Hello,
>  
> I've taken over some application written OSGi using Felix and Karaf being
> deployed as a docker container. I have basically two (beginner) questions
> here:
>  
> * It seems that the JUnit test cases are deployed together with the bundle
> and started when the bundle's start method is invoked. Question is whether
> there is a way to run a changed JUnit test case without having to build and
> deploy the bundle in Karaf.
>  
> * I have a hard time getting remote debugging into the OSGi bundle to work.
> The debug connection has to "go through" the docker container and Karaf to
> reach the breakpoint inside the code of the bundle. Has anyone had any
> success on this.
>  
> Thanks and kind regards, Haddock

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com