Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [osgi-users] Registering service with injected bundle context using osgi-test

Hello Jelle,


maybe you can paste the code or link an repo to have a look on your Problem.

I understood that you mean something like in this test.

https://github.com/osgi/osgi-test/blob/main/org.osgi.test.junit5/src/test/java/org/osgi/test/junit5/test/service/ServiceListTest.java


 the ServiceAware.getServices() should also work.


https://github.com/osgi/osgi-test/blob/main/org.osgi.test.junit5/src/test/java/org/osgi/test/junit5/test/service/MultiCardinalityServiceTest.java


regards

Stefan
On 7/15/21 5:14 PM, Jelle Nelis wrote:

Hi all,

I have been trying out osgi-test the last couple of days by writing several very simple tests that use the functionality provided by BundleContextExtension and ServiceExtension.
Firstly, thanks for the very simple-to-use integration testing possibilities.
I wrote a test using both BundleContextExtension and ServiceExtension. I was expecting that if I would have an injected List<S> with S a certain type of service, and I would register a service using the BundleContext in the test, the List<S> would reflect the newly registered service. A ServiceAware<S> also does not seem to reflect the new situation.

Are my expectations wrong?

Kind regards,

Jelle


_______________________________________________
osgi-users mailing list
osgi-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/osgi-users

Back to the top