did you try to use https://sling.apache.org/documentation/development/osgi-mock.html
it can be used standalone or as part of sling mocks. stefan >-----Original Message----- >From: Andreas Schaefer [mailto:schaef...@me.com.INVALID] >Sent: Thursday, February 13, 2020 10:34 PM >To: dev >Subject: Enhancing Testing Client OSGi package > >Hi > >I am working on a project with many backend OSGi services that have many >references between them and I ran into many issues when the services were >not fully workable due to unsatisfied references. > >The Testing Clients’ OsgiConsoleClient has a few methods to introspect the >state of the OSGi bundles, components and services but they are not easy to >use. > >In my case I need to find the ‘Declarative Service Components’, then get >their Service Info and check that any reference of these components are >satisfied. After some back and forth I was able to implement these tests >but I could not use the OsgiConsoleClient which makes for a lot of heavy >handed JsonNode parsing. > >So I was wondering if this is of interest for Sling to have a better way to >inspect the OSGi system. This is what I have in mind: >- Add additional data from the bundles into the BundleInfo class (like the >Declarative Service Components) >- Add additional data from the components into the ComponentInfo >(references etc) >- Add a method to call the OSGi Console from the OsgiConsoleClient directly >(it does not support depths so the SlingClient’s doGet() does not work) > >Let me know if you think this would be valuable for Sling Testing Clients. > >- Andy