Git Product home page Git Product logo

Comments (4)

bjhargrave avatar bjhargrave commented on June 12, 2024

This is not a good fit. ServiceSource is about injecting one service for parameterized test methods. ServiceAware is not about a single service. It is about potentially multiple services. You can get the ServiceAware for a service with InjectService already.

from osgi-test.

kriegfrj avatar kriegfrj commented on June 12, 2024

@laeubi, thank you so much for this contribution - however, based on the current information I'm inclined to agree with @bjhargrave 's assessment on the utility of your proposed feature. The point of @ServiceSource is to specify a collection of services to use one-at-a-time as the value for the parameter in the parameterized test. A ServiceAware, on the other hand, is a collection of services. As @bjhargrave pointed out, you can get a single ServiceAware injected as a parameter already if that's what you want:

@Test
void myTest(@InjectService(cardinality=3) ServiceAware<MyServiceType> s) {
}

Do you have a specific use case in mind where you felt that combining ServiceAware with @ServiceSource could be useful? Eg, perhaps if you specified an array of filters to @ServiceSource, then the service source parameter could generate a ServiceAware corresponding to each filter in turn?

from osgi-test.

laeubi avatar laeubi commented on June 12, 2024

@kriegfrj I'm not remembering directly why I was requiring this, I think it was while refactoring some OSGi-TCK, but the crucial part here might be:

there is no javadoc...

So maybe it would help to describe what it is used for and the possible alternatives and in what situation one should choose which annotations, its often hard to decide so probably it was just the wrong choice at that time.

from osgi-test.

kriegfrj avatar kriegfrj commented on June 12, 2024

I sympathise with the "no javadoc" (or perhaps more generally, "no doc") - I wish I personally had more time to sort that out.

In light of your comment, I will close this issue - but if something specific comes to mind and you feel it's worth revisiting this, please feel free to let us know.

Thank you so much for your help (even issues that are ultimately rejected are still helpful).

from osgi-test.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.