[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [equinox-dev] Testing OSGI Bundles with JUnit
- From: Toni Menzel <toni@xxxxxxxxxxxxxxx>
- Date: Thu, 14 May 2009 12:05:57 +0200
- Delivered-to: email@example.com
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=BB3hRYIqfK1qaQ6jKnMPdPyBkaQwqHNaLnL1BXpmD/73Yb5RJmcXABRlCc3NUn205X o7l9B0IHtkr1a9Br06W6k3M4UWOkVVm1mZQqMXv710XOj4+vJ4Kh0SCYANsK7X8p/HG0 D4pjfIKdB716pkQWsxroX6Atxkg2wYIRnZ6Do=
Have you had a look at pax exam
It actually lets you write Junit Tests in OSGi Framework independent way.
You finally wrap your test in a test probe bundle (built on the fly),
start your target framework (equinox in this case), provision it with
you setup (extra bundles), and thats about it.
IF you use PDE (because you pointed to the fact you are using eclipse
a couple of times):
Without external means like maven you probably end up re-specifiying
all your dependencies again just for test setup.
Tell us if you do or not as it might help us a lot to get you started
with pax exam.
Finally, in exam you end up inside an isolated vm process running just
your test vm with your test framework
(Equinox,Felix,Knopflerfish,Concierge, all recent versions at you
fingertipps) exactly as specified. From there you (currently) get the
(real!) bundleContext from where you probably get any service you
On 5/14/09, David Conde <dconde@xxxxxxxx> wrote:
> Hi everyone,
> I am trying to do test cases for OSGI Bundles in Equinox, using Eclipse. I
> found the problem when I tried to model BundleContext and services like
> Preference Services, which are complex objects. I read about how I could
> solve this problem and I found some libraries from Spring Framework which
> use “mocks” to test BundleContext, but I am not sure if these ones provided
> special Services likes Preference services. So, my question is , is there
> any library with mocks to simulate BundleContext and other complex Equinox
> classes? Is there any library provided by Equinox?
> Thank you in advance
> David Conde Baena
> Centro Andaluz de Innovación y Tecnologías de la Información y las
> Edificio CITIC, C/ Marie Curie, 6
> Parque Tecnológico de Andalucía
> 29590 - Campanillas (MÁLAGA)
> Tfno.: +34 952028610
> Fax: +34 951231029
> <mailto:usuario@xxxxxxxx> Email: dconde@xxxxxxxx
> <http://www.citic.es/> Web: www.citic.es
Independent Software Developer - Looking for new projects!
Professional Profile: http://www.osgify.com
http://www.ops4j.org - New Energy for OSS Communities - Open