Example C.2, “CalculatorITestClass” shows an example of how to write a test class for Apache Karaf in the Pax-Exam testing framework. The CalculatorITest class configures the Apache Karaf environment, installs the obr and wrapper features, and then runs a test against the two features (where the obr and wrapper features implement particular sets of commands in the command console).
The @RunWith annotation instructs JUnit4 to run the following test with the PaxExam class. This is the key step for integrating JUnit4 with the Pax-Exam testing framework.
The @Configuration annotation is specific to Pax-Exam and marks the following method as a configuration method for setting Pax-Exam testing options. The configuration method must be declared as public static and must have a return value of type, org.ops4j.pax.exam.Option[].
We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.
Making open source more inclusive
Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.
About Red Hat
We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.