You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Milan Tomic <to...@yahoo.com> on 2014/12/18 12:53:25 UTC

PaxExam and KAR

Hi,
Does anyone know how can I specify in PAX EXAM options a KAR file to be installed? Using bundle() or something else?

return options(...                        bundle("c:/myKarFile.kar").start()                        ...);

Thank you in advance,Milan

Re: PaxExam and KAR

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Sorry Milan ;)

Let me explain it a bit.

With Pax-Exam, you can use the @Inject annotation to inject a service.

So, you can do something like:

public class MyTest extends KarafTestSupport {

    @Inject
    protected KarService karService;

    @Test
    public void myTest() throws Exception {
       karService.install(new File("file:/path/to/kar").toURI());
    }

}

Regards
JB

On 12/18/2014 02:37 PM, Milan Tomic wrote:
> Hi JB,
>
> Is there perhaps some online example how can I use KarService with PaxExam?
>
> I am beginner and I don't understand what you have written. For example:
> which line of the code in PaxExam test is "after the Karaf bootstrap"
> and how to get reference to KarService?
> I was searching Web but with no luck.
>
> Thank you in advance,
> Milan
>
>
>
> On Thursday, December 18, 2014 1:42 PM, Jean-Baptiste Onofré
> <jb...@nanthrax.net> wrote:
>
>
> Hi Milan,
>
> after the Karaf bootstrap, you can use the KarService to install a kar file.
>
> Regards
> JB
>
> On 12/18/2014 12:53 PM, Milan Tomic wrote:
>  > Hi,
>  >
>  > Does anyone know how can I specify in PAX EXAM options a KAR file to be
>  > installed? Using bundle() or something else?
>  >
>  > return options(...
>  >                          bundle("c:/myKarFile.kar").start()
>  >                          ...);
>  >
>  > Thank you in advance,
>  > Milan
>
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org <ma...@apache.org>
> http://blog.nanthrax.net <http://blog.nanthrax.net/>
> Talend - http://www.talend.com <http://www.talend.com/>
>

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

Re: PaxExam and KAR

Posted by Milan Tomic <to...@yahoo.com>.
Hi JB,
Is there perhaps some online example how can I use KarService with PaxExam?
I am beginner and I don't understand what you have written. For example: which line of the code in PaxExam test is "after the Karaf bootstrap" and how to get reference to KarService?I was searching Web but with no luck.

Thank you in advance,Milan
  

     On Thursday, December 18, 2014 1:42 PM, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
   

 Hi Milan,

after the Karaf bootstrap, you can use the KarService to install a kar file.

Regards
JB

On 12/18/2014 12:53 PM, Milan Tomic wrote:
> Hi,
>
> Does anyone know how can I specify in PAX EXAM options a KAR file to be
> installed? Using bundle() or something else?
>
> return options(...
>                          bundle("c:/myKarFile.kar").start()
>                          ...);
>
> Thank you in advance,
> Milan

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

   

Re: PaxExam and KAR

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

after the Karaf bootstrap, you can use the KarService to install a kar file.

Regards
JB

On 12/18/2014 12:53 PM, Milan Tomic wrote:
> Hi,
>
> Does anyone know how can I specify in PAX EXAM options a KAR file to be
> installed? Using bundle() or something else?
>
> return options(...
>                          bundle("c:/myKarFile.kar").start()
>                          ...);
>
> Thank you in advance,
> Milan

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