JUnit Plug-in testing [message #1717755] |
Wed, 16 December 2015 09:15  |
Eclipse User |
|
|
|
Dear list,
I am running JUnit tests inside the Eclipse OSGi pool (with bundle contexts, OSGi components, etc.) is by using the JUnit Plug-in Test run/debug configuration type.
Is this the good approach for enabling functional JUnit tests in my Eclipse application?
Thanks,
-Piero
|
|
|
|
Re: JUnit Plug-in testing [message #1717835 is a reply to message #1717755] |
Thu, 17 December 2015 03:26   |
Eclipse User |
|
|
|
Yes! However, I would recommend to do plain JUnit tests whereever
possible. OSGi test are slower and require more maintenance, e.g. you
have to maintain the run config and the tycho config.
As an example, if you want to test OSGi services, which depend on each
other, you can simply instanciate and wire them manually in plain JUnit.
This way, you have full control on which components are used and which
are mocked.
I would recommend to use OSGi for integration tests only and test the
behavior mainly with plain JUnit tests. This will typically also improve
your architecture as it makes your components less dependent on OSGi.
Best regards
Jonas
Am 16.12.2015 um 15:15 schrieb Piero Campalani:
> Dear list,
>
> I am running JUnit tests inside the Eclipse OSGi pool (with bundle
> contexts, OSGi components, etc.) is by using the JUnit Plug-in Test
> run/debug configuration type.
>
> Is this the good approach for enabling functional JUnit tests in my
> Eclipse application?
>
> Thanks,
> -Piero
>
--
--
Jonas Helming
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
|
|
|
|
|
|
Re: JUnit Plug-in testing [message #1718190 is a reply to message #1717969] |
Mon, 21 December 2015 02:36  |
Eclipse User |
|
|
|
Quote:Are we talking about the BundleContext oder the IEclipseContext?
_Bundle_ context (from which I need the org.osgi.framework.Bundle in the end for my FileLocator).
|
|
|
Powered by
FUDForum. Page generated in 0.06445 seconds