Comments (4)
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.
@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.
@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.
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)
- Add some descriptive documentation HOT 6
- osgi-test-example-mvn / org.osgi.test.example.player.test.PlayerTest are not executed HOT 4
- Need to obtain code coverage reports and interactive debugging within intellij and gradle plugin HOT 9
- Service instance are kept between different BundleContext's, Tests and test Classes HOT 4
- Provide a Junit5 Extension to start an OSGi-Connect-Framework as part of the test without any need for special setup HOT 4
- @ServiceSource should give a meaningfull error if no services are found HOT 3
- readme link to codeql broken HOT 2
- NPE with @WithFactoryConfiguration HOT 15
- [cm] Support Systemproperties in Property HOT 4
- [cm] either create unbound config, or provide an option for it. HOT 3
- Weird behaviour when using `ConfigurationExtension` and standard config files HOT 10
- Provide a possibillity to inject and empty configuration where update has not been called yet HOT 11
- waitForRemoval and wait for modification Method for ServiceAware HOT 2
- use @With(Factory)Configuration in Annotations of User
- org.osgi.test.junit5.cm.test.ConfigAnnotationTest makes Tests lazy
- Move examples to Java 11? HOT 8
- Replacement in @WithFactoryConfigutation Properties and Factorys name
- Release 1.3.0 HOT 11
- Regression - WithConfiguration is no longer inherited
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from osgi-test.