I joined a project where the development is carried on Eclipse RCP platform with the use of Equinox/OSGi, Tycho.
I am slowly getting familiar with classpath/classloading mechanism of OSGi, how tycho, equinox works etc.
I am writing plain unit tests with the use of mocking by collecting them in test bundles (which are fragments of the target bundles) however I am encountering ClassNotFound errors, issues with attaching source code. I have seen recommendations such as running tests as rcp plugin tests or with tycho at integration-test scope. However I found all those approaches very slow for running tests and counter-productive.
As far as I understood, somehow dependency resolution mechanism in this environment (Tycho, Eclipse RCP or both) is a bit different than my assumptions. When I add new implementations to the host bundle to satisfy my tests, all the new implementations are not picked up by the test bundle unless I run mvn install (tycho is taking over) for the host bundle. Sometimes that requires full installation of the project because of missing dependencies. Another method I tried was to run tests as JUnit-plugin test. That method is quite slow as well due to dependency resolution of tycho and it is loading all bundles.
I would like to know what is the best approach for running unit tests ? (when I say unit tests I mean the true definition of unit tests where interactions are mocked and tests run in miliseconds).