Hello,

firstly apologies upfront if any of my terminology is incorrect, I am newbie
to OSGI and struggling with the concepts.

I am working on a project that uses Karaf with Felix to provide OSGI based
services that service a Swing GUI client.

The services have been developed over the past 3 years or so but don't have
any automated integration tests.

My goal is to be able to run integration tests within a continuous
integration tool such as Jenkins.

I am looking for guidance on possible integration test solutions. I have
tried to implement a test using Pax Exam and
had a brief look at SpringDM but I am having difficulty provisioning the
required bundles.

The project consists of about a dozen maven modules which build OSGI
bundles. There are some custom configuration properties files
with properties such as org.osgi.framework.system.packages.extra and
org.osgi.framework.system.packages, also an XML
file specifying the features.

I am not sure that I fully understand but it seems to me that in order to
get Pax Exam to test these bundles I must
necessarily specify all of bundles that the bundle in question to test
requires e.g. given a bundle called 'broker' using maven
coordinates I would have do something like the following

.
.
.
mavenBundle().groupId( "org.springframework" ).artifactId( "spring-beans" )
mavenBundle().groupId( "org.springframework" ).artifactId( "spring-tx" )
mavenBundle().groupId( "uniworks" ).artifactId( "broker" )

I have seen cases with someone has written a method to try and read files
from a directory to try and reduce the 
manual work but these solutions seem a poor fit for our requirements as the
project depends on 100+ external libraries
most of which are OSGIsed, and some not, which are specified in the
org.osgi.framework.system.packages.extra property.

The analogy I would like to describe is integration testing with the Spring
framework (AbstractTransactionalSpringContextTests or similar) 
where often the configuration application context files used in production
can be reused verbatim (with a few changes, say different database) 
when running the tests. This to me seems to provide a huge advantage over
having to restate and constantly maintain the 'configuration' 
needed to test the classes. 

I started to look at
http://felix.apache.org/site/apache-felix-ipojo-junit4osgi-maven.html which
if I understand correctly should allow
tests to be run against the bundles as they are currently configured. So
provided the OSGI bundles can be started before the maven integration-test
phase, say 
in the pre-integration-test phase, then the tests should be able to be
implemented without having to specifically specify all the required bundles
and config files
needed to start the dozen or so bundles to perform the integration test. 

Note that I am not interested (at least at the moment) in testing a bundle
in isolation so the 'running' system as whole (connects to database(s),
legacy COBOL server(s)) 
is required to complete a test. Please, I do not want to get into a
philosophical debate on testing in general i.e. whether you have a opinion
on testing systems
in their entirety or more finely grained.

Am I on the right track with iPOJO? Are there better/other alternatives? 


Thanks,

Tim



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Guidance-on-integrated-testing-solutions-tp4025742.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Reply via email to