Hello all,
I'm trying to find the pattern for something presumably rather simple WRT
integration testing in Karaf with Pax Exam, but I cannot seem to find a working
example anywhere.
Basically I would like to factor out some integration test utilities to a
separate Maven project, like so:
The class KarafITValidatorTest resides in test scope of project A, and
KarafIntegrationTest resides in compile/artifact scope of project B.
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class FooTest extends KarafIntegrationTest {
I would have thought that the KarafIntegrationTest would be accessible from
within the Pax Exam testcase, but I get a ClassNotFoundException instead:
Caused by: java.lang.ClassNotFoundException: some.package.KarafIntegrationTest
not found by PAXEXAM-PROBE-0baa0bbc-bb52-4729-be3f-26ac76a8beaa [60]
at
org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:787)
at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:71)
at
org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1768)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
It doesn't seem to matter if I provision the bundle holding the
KarafIntegrationTest class, or if I add it to the bootDelegationPackage.
What is the pattern for doing this?
I.e. extracting the main algorithms to another maven project, which is then
imported into test scope of the actual integration test project.
--
// Bästa hälsningar,
// [sw. "Best regards,"]
//
// Lennart Jörelid, Systems Architect
// email:
[email protected]<mailto:[email protected]>
// cell: +46 708 507 603
// skype: jgurueurope