Re: PAX Exam OSGI Components

2018-02-22 Thread 'Christoph Läubrich' via OPS4J
Well I think the best would be to have a JUnit rule that uses the SCR 
Service to query for a component.
This rule then can fail if component is not present at all or wait up to 
x seconds and so on... If I find some time the next days I'll try to 
prepare an example for this.


--
--
--
OPS4J - http://www.ops4j.org - ops4j@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups "OPS4J" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to ops4j+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: PAX Exam OSGI Components

2018-02-22 Thread nino martinez wael
Thanks..

For the first step I also just interested in status's..

So It fits perfectly..





On Thu, Feb 22, 2018 at 1:52 PM, Christian Schneider <
ch...@die-schneider.net> wrote:

> Check out the ServiceComponentRuntime service. It is implemented by felix
> scr and allows you to introspect the status of any DS component.
>
> http://javadox.com/org.osgi/osgi.cmpn/6.0.0/org/osgi/
> service/component/runtime/ServiceComponentRuntime.html
>
> I am using this in my itests to list all components with unsatisfied
> references.
>
> Actually I think it would be a good option for pax exam to print out the
> status of all DS components when a service can not be injected into a pax
> exam OSGi test.
>
> Christian
>
> 2018-02-22 12:18 GMT+01:00 nino martinez wael <
> nino.martinez.w...@gmail.com>:
>
>> its exactly checking for presence of components and seeing their state
>> (activated / disabled etc)
>>
>> On Wed, Feb 21, 2018 at 12:59 PM, Oliver Lietz 
>> wrote:
>>
>>> On Wednesday 21 February 2018 10:47:05 'Christoph Läubrich' via OPS4J
>>> wrote:
>>> > This depends on the DS-Provider you use e.g. the apache felix one has
>>> an
>>> > API for this and if I rember right it is also standarized in OSGi-R7
>>> >
>>> > See
>>> > http://felix.apache.org/documentation/subprojects/apache-fel
>>> ix-service-compo
>>> > nent-runtime.html#api-use
>>> >
>>> > This is nothing special in pax exam so you can simply use
>>> >
>>> > @Inject
>>> > private ScrService service;
>>>
>>> Waiting for components to be present (activated) in tests is a useful
>>> feature
>>> indeed.
>>>
>>> One possible way: we could register proxy services for those components.
>>>
>>> Any other ideas?
>>>
>>> Regards,
>>> O.
>>>
>>> > Am 20.02.2018 um 13:46 schrieb nino martinez wael:
>>> > > Ok.. When using Pax exam I can write @inject MyOwnService service..
>>> Then
>>> > > pax exam will inject the service into the test once karaf are bootet
>>> > > etc... Im wondering if there's a way to do that with components..
>>> > >
>>> > > Den tirsdag den 20. februar 2018 kl. 12.36.59 UTC+1 skrev
>>> Jean-Baptiste
>>> > >
>>> > > Onofré:
>>> > > Not sure I understand what you mean.
>>> > >
>>> > > If you use Karaf pax exam container it's as when you are a
>>> vanilla
>>> > > Karaf.
>>> > >
>>> > > Regards
>>> > > JB
>>> > > Le 20 févr. 2018, à 12:00, nino martinez wael
>>> > >
>>> > >  a écrit:
>>> > > Hi
>>> > >
>>> > > Are there anyway to get declarative services components? Both
>>> > > the component itself but also the reference where you can
>>> start
>>> > > and stop it?
>>>
>>> --
>>> --
>>> --
>>> OPS4J - http://www.ops4j.org - ops4j@googlegroups.com
>>>
>>> ---
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "OPS4J" group.
>>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>>> pic/ops4j/Zyr8HNfrGPM/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> ops4j+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Best regards / Med venlig hilsen
>> Nino Martinez
>>
>> --
>> --
>> --
>> OPS4J - http://www.ops4j.org - ops4j@googlegroups.com
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "OPS4J" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to ops4j+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Computer Scientist
> http://www.adobe.com
>
> --
> --
> --
> OPS4J - http://www.ops4j.org - ops4j@googlegroups.com
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "OPS4J" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/ops4j/Zyr8HNfrGPM/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> ops4j+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Best regards / Med venlig hilsen
Nino Martinez

-- 
-- 
--
OPS4J - http://www.ops4j.org - ops4j@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ops4j+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: PAX Exam OSGI Components

2018-02-22 Thread Christian Schneider
Check out the ServiceComponentRuntime service. It is implemented by felix
scr and allows you to introspect the status of any DS component.

http://javadox.com/org.osgi/osgi.cmpn/6.0.0/org/osgi/service/component/runtime/ServiceComponentRuntime.html

I am using this in my itests to list all components with unsatisfied
references.

Actually I think it would be a good option for pax exam to print out the
status of all DS components when a service can not be injected into a pax
exam OSGi test.

Christian

2018-02-22 12:18 GMT+01:00 nino martinez wael 
:

> its exactly checking for presence of components and seeing their state
> (activated / disabled etc)
>
> On Wed, Feb 21, 2018 at 12:59 PM, Oliver Lietz 
> wrote:
>
>> On Wednesday 21 February 2018 10:47:05 'Christoph Läubrich' via OPS4J
>> wrote:
>> > This depends on the DS-Provider you use e.g. the apache felix one has an
>> > API for this and if I rember right it is also standarized in OSGi-R7
>> >
>> > See
>> > http://felix.apache.org/documentation/subprojects/apache-
>> felix-service-compo
>> > nent-runtime.html#api-use
>> >
>> > This is nothing special in pax exam so you can simply use
>> >
>> > @Inject
>> > private ScrService service;
>>
>> Waiting for components to be present (activated) in tests is a useful
>> feature
>> indeed.
>>
>> One possible way: we could register proxy services for those components.
>>
>> Any other ideas?
>>
>> Regards,
>> O.
>>
>> > Am 20.02.2018 um 13:46 schrieb nino martinez wael:
>> > > Ok.. When using Pax exam I can write @inject MyOwnService service..
>> Then
>> > > pax exam will inject the service into the test once karaf are bootet
>> > > etc... Im wondering if there's a way to do that with components..
>> > >
>> > > Den tirsdag den 20. februar 2018 kl. 12.36.59 UTC+1 skrev
>> Jean-Baptiste
>> > >
>> > > Onofré:
>> > > Not sure I understand what you mean.
>> > >
>> > > If you use Karaf pax exam container it's as when you are a vanilla
>> > > Karaf.
>> > >
>> > > Regards
>> > > JB
>> > > Le 20 févr. 2018, à 12:00, nino martinez wael
>> > >
>> > >  a écrit:
>> > > Hi
>> > >
>> > > Are there anyway to get declarative services components? Both
>> > > the component itself but also the reference where you can
>> start
>> > > and stop it?
>>
>> --
>> --
>> --
>> OPS4J - http://www.ops4j.org - ops4j@googlegroups.com
>>
>> ---
>> You received this message because you are subscribed to a topic in the
>> Google Groups "OPS4J" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>> pic/ops4j/Zyr8HNfrGPM/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> ops4j+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Best regards / Med venlig hilsen
> Nino Martinez
>
> --
> --
> --
> OPS4J - http://www.ops4j.org - ops4j@googlegroups.com
>
> ---
> You received this message because you are subscribed to the Google Groups
> "OPS4J" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ops4j+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
-- 
Christian Schneider
http://www.liquid-reality.de

Computer Scientist
http://www.adobe.com

-- 
-- 
--
OPS4J - http://www.ops4j.org - ops4j@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ops4j+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: PAX Exam OSGI Components

2018-02-22 Thread nino martinez wael
its exactly checking for presence of components and seeing their state
(activated / disabled etc)

On Wed, Feb 21, 2018 at 12:59 PM, Oliver Lietz  wrote:

> On Wednesday 21 February 2018 10:47:05 'Christoph Läubrich' via OPS4J
> wrote:
> > This depends on the DS-Provider you use e.g. the apache felix one has an
> > API for this and if I rember right it is also standarized in OSGi-R7
> >
> > See
> > http://felix.apache.org/documentation/subprojects/
> apache-felix-service-compo
> > nent-runtime.html#api-use
> >
> > This is nothing special in pax exam so you can simply use
> >
> > @Inject
> > private ScrService service;
>
> Waiting for components to be present (activated) in tests is a useful
> feature
> indeed.
>
> One possible way: we could register proxy services for those components.
>
> Any other ideas?
>
> Regards,
> O.
>
> > Am 20.02.2018 um 13:46 schrieb nino martinez wael:
> > > Ok.. When using Pax exam I can write @inject MyOwnService service..
> Then
> > > pax exam will inject the service into the test once karaf are bootet
> > > etc... Im wondering if there's a way to do that with components..
> > >
> > > Den tirsdag den 20. februar 2018 kl. 12.36.59 UTC+1 skrev Jean-Baptiste
> > >
> > > Onofré:
> > > Not sure I understand what you mean.
> > >
> > > If you use Karaf pax exam container it's as when you are a vanilla
> > > Karaf.
> > >
> > > Regards
> > > JB
> > > Le 20 févr. 2018, à 12:00, nino martinez wael
> > >
> > >  a écrit:
> > > Hi
> > >
> > > Are there anyway to get declarative services components? Both
> > > the component itself but also the reference where you can start
> > > and stop it?
>
> --
> --
> --
> OPS4J - http://www.ops4j.org - ops4j@googlegroups.com
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "OPS4J" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/ops4j/Zyr8HNfrGPM/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> ops4j+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Best regards / Med venlig hilsen
Nino Martinez

-- 
-- 
--
OPS4J - http://www.ops4j.org - ops4j@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ops4j+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.