...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
@RunWith(JUnit4TestRunner.class) @ExamReactorStrategy(AllConfinedStagedReactorFactory.class) public abstract class OSPFIntegrationTest { ... } |
Configuration options
In order to configure the main attributes OSGI container, Pax-Exam provides multiple configuration mechanisms, like the classpath, JVM configuration options, framework selection, etc. Just to simplify the development of new tests, OpenNaaSs contain a helper class you can use from any integration test. The most important methods are:
- karafDistrubutionBaseConfigurationOption : Defines OpenNaaS platform as the framework where the tests will be runned.
- includeTestHelper : include the test helpers bundles in the OSGI container.
- includeFeatures : include the installation of additional features in the OSGI container.
- noConsole : starts Karaf without console
All this options must be defined in a method annotated with @Configuration and returning the type Option[].
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
@Configuration
public static Option[] configuration() {
return options(opennaasDistributionConfiguration(),
includeFeatures("opennaas-router", "opennaas-junos"),
noConsole(),
keepRuntimeFolder());
} |
As an example, we can see how opennaas-router and opennaas-junos features are included to run the tests of this class.
Dependency Injection