Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Even thought in OpenNaaS we deploy our platform to run the tests, Pax-Exam 2.x provides three different OSGI containers in which you can launch an OSGI framework and install bundles. Native Container is launched in the same JVM as the driver, and Forked Container launch the framework in an isolated JVM. The third option is the Pax Runner Container. As the forked container, the framework is launched in a separrate VM, but it uses Pax Runner as the main tool to configure and run the tests.

Container Configuration

As seen in OpenNaaS example, we can configure the containter Pax-Exam will provide to test our application. In this section we will explain the main additional options.

Framework

In Pax Runner Container we can choose between Felix, Equinox and Knopflerfish framework and restriction the version we want to use. It will require the correct dependencies in our pom in order to add the selected framework to the container. For example, if we want to run our tests in Felix 1.0.4 version, we have to indicate the following information:

Code Block
themeEclipse
languagejava
linenumberstrue
@Configure
public Option[] configuration {
	return new Option[]{
		...
		felix().version("1.0.4"),
		...
	}
}
 
Bundles

The three containers allow you to provision additional bundles to the system by indicating the maven URL.

Code Block
themeEclipse
languagejava
linenumberstrue
@Configure
public Option[] configuration {
	return new Option[]{
		...
		bundle("mvn:org.opennaas/org.opennaas.extensions.router.repository/0.0.17-SNAPSHOT"),
		...
	}
}
 
Also you can install a group of bundles if they're defined in a feature by the scanFeatures tool. You need to indicate the feature url and the name of the fetures defined in it you want to install.
Code Block
themeEclipse
languagejava
linenumberstrue
@Configure
public Option[] configuration {
	return new Option[]{
		...
		provision(scanFeatures("mvn:org.opennaas/org.opennaas.core.features/0.0.17-		
			SNAPSHOT/xml/features", "router", "bod"))
		...
	}
}