Re: Loading a class from a different bundle dynamically

2014-12-13 Thread Chetan Mehrotra
Also have a look at Sling Testing Tools [1] Chetan Mehrotra [1] http://sling.apache.org/documentation/development/sling-testing-tools.html On Sat, Dec 13, 2014 at 2:05 AM, Christian Schneider ch...@die-schneider.net wrote: You can also do this without an Activator and just DS. On the

Re: Loading a class from a different bundle dynamically

2014-12-12 Thread Dean Schulze
I don't think Pax Exam addresses my issue. A little more explanation may help. This system is driven by both external input and user input. The external input will be the same on each test run. Controlling the timing of the user input -- synchronizing it with the external input -- is the

Re: Loading a class from a different bundle dynamically

2014-12-12 Thread Achim Nierbeck
Dynamic Import? Add a manifest header or dynamically importing your testclass in case it's available, but I would actually work with a service tracker that waits for the testservice to be available and trigger the test then. regards, Achim 2014-12-12 15:24 GMT+01:00 Dean Schulze

Re: Loading a class from a different bundle dynamically

2014-12-12 Thread David Jencks
I don't understand what you are trying to do yet, but you might investigate putting your test classes in a fragment bundle (only loaded when testing, but then part of your main bundle) and also mocking the external input so it is under better control (although calling the result a functional

Re: Loading a class from a different bundle dynamically

2014-12-12 Thread Christian Schneider
I also recommend to use a service for this. Simply put your test class into a separate bundle. In the activator instantiate the test class and publish it as a service using the test interface you provide. The production bundle would then listen for services implementing the test interface

Re: Loading a class from a different bundle dynamically

2014-12-12 Thread Dean Schulze
I don't know what you mean when you say instantiate the class in the Activator. The Activator runs after the @Reference classes have been injected. I tried to load the test classes dynamically in the Activator, but I got a ClassNotFoundException. In order to get the implementation below to work

Re: Loading a class from a different bundle dynamically

2014-12-12 Thread Christian Schneider
You can also do this without an Activator and just DS. On the production side you have to find a way to listen for 0..n services that implement an interface. http://felix.apache.org/documentation/subprojects/apache-felix-maven-scr-plugin/scr-annotations.html http://www.aqute.biz/Bnd/Components

Re: Loading a class from a different bundle dynamically

2014-12-11 Thread Achim Nierbeck
Hi, just one quick question/hint. You are aware of the Pax Exam Testframework? I think with it you are able to do what you are looking for. regards, Achim 2014-12-12 6:41 GMT+01:00 Dean Schulze dean.w.schu...@gmail.com: I have an OSGI app consisting of several bundles. In order to do