>>>>> Steinar Bang <[email protected]>: > Can anyone spot what I've missed in the copy/paste...?
I think I did. > [1] > <https://github.com/steinarb/ukelonn/blob/master/ukelonn.tests/src/test/java/no/priv/bang/ukelonn/tests/UkelonnServiceIntegrationTest.java#L45> > [2] > <https://gist.github.com/steinarb/42a269df682e69ce6fb3c413ca91baa6#file-fildeleintegrationtest-java-L29> The difference between the original[1] and the copy[2], are two things: 1. The copy has the pax-jdbc feature repository removed 2. The copy has an additional mockito bundle attempted installed When I removed the mockito bundle from the pax-exam config, the test was able to start: https://gist.github.com/steinarb/42a269df682e69ce6fb3c413ca91baa6#file-fildeleintegrationtest-java-L59 So I tried to figure out what else mockito-core would need. First step was to run "mvn dependency:tree" in the pax-exam test project, and the output for mockito-core, was: [INFO] \- org.mockito:mockito-core:jar:1.10.19:test [INFO] +- org.hamcrest:hamcrest-core:jar:1.1:test [INFO] \- org.objenesis:objenesis:jar:2.1:test I then looked at the MANIFEST.MF of the mockito-core jar, and it was an OSGi bundle. The only non-optional import packages were from org.hamcrest and org.objenesis. mvn:org.objenesis/objenesis/2.4 (the newest objenesis in my local maven repo) was also an osgi bundle (so was version 2.1 of objenesis). However, mvn:org.hamcrest/hamcrest-core/1.3 in my local repo was a plain jar. I googled "osgi bundle hamcrest" and found: https://mvnrepository.com/artifact/org.apache.servicemix.bundles/org.apache.servicemix.bundles.hamcrest/1.3_1 So I tried out the bundles in a karaf 4.1.2 console: karaf@root()> bundle:install mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.hamcrest/1.3_1 Bundle ID: 52 karaf@root()> bundle:install mvn:org.objenesis/objenesis/2.4 Bundle ID: 53 karaf@root()> bundle:install mvn:org.mockito/mockito-core/1.10.19 Bundle ID: 54 karaf@root()> bundle:list START LEVEL 100 , List Threshold: 50 ID | State | Lvl | Version | Name ---+-----------+-----+---------+------------------------------------------------------------------------------- 28 | Active | 80 | 4.1.2 | Apache Karaf :: OSGi Services :: Event 52 | Installed | 80 | 1.3.0.1 | Apache ServiceMix :: Bundles :: hamcrest-all 53 | Installed | 80 | 2.4.0 | Objenesis 54 | Installed | 80 | 1.10.19 | Mockito Mock Library for Java. Core bundle requires Hamcrest-core and Objenesis. karaf@root()> bundle:resolve 54 karaf@root()> bundle:list START LEVEL 100 , List Threshold: 50 ID | State | Lvl | Version | Name ---+----------+-----+---------+-------------------------------------------------------------------------- 28 | Active | 80 | 4.1.2 | Apache Karaf :: OSGi Services :: Event 52 | Resolved | 80 | 1.3.0.1 | Apache ServiceMix :: Bundles :: hamcrest-all 53 | Resolved | 80 | 2.4.0 | Objenesis 54 | Resolved | 80 | 1.10.19 | Mockito Mock Library for Java. Core bundle requires Hamcrest-core and Objenesis. karaf@root()> This looked promising. Plan going forward: 1. Create a feature file in the test project (ie. a real artifact and not a test scope thing), using karaf-maven-plugin and the above three bundles as compile dependencies of the test project 2. Add the feature file to the pax-exam config and install the mockito feature -- -- ------------------ OPS4J - http://www.ops4j.org - [email protected] --- You received this message because you are subscribed to the Google Groups "OPS4J" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
