[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] Testing bundles with Pax Exam

Title: Re: [equinox-dev] Testing bundles with Pax Exam
PAX Exam does not require Maven to run, but it is easier to use maven because maven makes it easier to collect all your transient dependencies into a common repository.

Whether using Maven or not, you need to make sure you provision all the bundles required by the test code being run, including the transient dependencies. If you are getting ClassNotFound exceptions then there are probably bundles required that are not provisioned.

Provisioning happens in the config() method you must add to your test class. It will look something like:

@Configuration    public static Option[] config() {        return options(                frameworks(equinox()),                provision(bundle( "file:///Some/bundle/to/add/bundle.jar"),

The Spring framework also has a good integration testing framework using Junit, and I use that most times. But it is definitely a lot easier to work with when using Maven as well. If you need to do a lot of integration testing and use the Spring Framework I would definitely recommend looking into their framework. And if you want to see how to use Maven to automatically manage all your transient dependencies for the test you can check out my blog post on the topic at: http://yetanotherway.blogspot.com/

No matter which way you choose to integration test your bundles in the OSGi container, Maven can really help you by making it easy to collect the transient dependencies for you, even if you do not use maven for any other purpose!

Best Regards,

Don Laidlaw | Sr. Research Engineer |
Infor | office: +1 902-576-5185 | mobile: +1 902-401-6771 | don.laidlaw@xxxxxxxxx

From: David Conde <dconde@xxxxxxxx>
Reply-To: Equinox development mailing list <equinox-dev@xxxxxxxxxxx>
Date: Mon, 1 Jun 2009 14:57:30 +0200
To: 'Equinox development mailing list' <equinox-dev@xxxxxxxxxxx>
Subject: [equinox-dev] Testing bundles with Pax Exam

HI everyone,
I have been trying use Pax Exam in order to test my bundles running on Equinox without using Maven, but I got dependencies errors so I could not get any result for testing my bundles.
Have anybody tried with Pax Exam for Eclipse without Maven? Do you know any other way to test bundles on Equinox using JUnit?
Thank you in advance
David Conde Baena

 Centro Andaluz de Innovación y Tecnologías de la Información y las Comunicaciones
Edificio CITIC, C/ Marie Curie, 6
 Parque Tecnológico de Andalucía
 29590 - Campanillas (MÁLAGA)
  Tfno.: +34 952028610
 Fax: +34 951231029
dconde@xxxxxxxx <mailto:usuario@xxxxxxxx>
www.citic.es <http://www.citic.es/>  


equinox-dev mailing list