On Friday 23 February 2018 15:14:41 Christian Schneider wrote:
> Not sure what exactly you mean by proxy services.

In this case a proxy would be an object which gets registered as service on 
behalf of a component.

Works for resources in Sling:
https://github.com/apache/sling-org-apache-sling-resource-presence

> I think Christoph's proposal of a junit rule could make sense.
> 
> The rule could express that you require some named components to be active
> before the test starts.
> The rule could then also spit out some debug information about the state of
> components in case the rule is not satisfied.
> 
> @Inject is great for the positive case when a service can be injected but
> does not help much in case the service never comes up.
> 
> A DS ServiceComponentRuntime service backed junit rule could provide much
> more information in the failure case.
> We could even go into root cause analysis.
> 
> For example if component A depends on B depends on C and the junit rule
> specifies that component A is required.
> In case C has a required config which is missing we could follow the chain
> starting from component A and tell the user that the root cause is the
> missing config for component C. This would make spotting problems in tests
> so much easier than today.

A rule might work with JUnit 4 but doesn't with TestNG and JUnit 5.

O.

> Christian
> 
> 2018-02-21 12:59 GMT+01:00 Oliver Lietz <i...@oliverlietz.de>:
> > 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
> > > >     
> > > >     <nino.mart...@gmail.com <javascript:>> 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 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.

-- 

Oliver Lietz | Wintgensweg 29 | 45481 Mülheim an der Ruhr
fon: +49 208 41191263 | fax: +49 208 41191264
email: i...@oliverlietz.de | web: oliverlietz.de

-- 
-- 
------------------
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.

Reply via email to