Thanks all for the replies.

I have looked through examples provided in the URLs and have implemented the
example PaxExam Karaf integration test in
https://github.com/openengsb/labs-paxexam-karaf/wiki. 

I am still a bit confused. Something I should have said earlier is that in
this case Karaf is shipped in the application and Karaf is started with the
application using org.apache.karaf.main.Main

Given that the maven build/installation process creates the target directory
structure with the necessary files (e.g. property files, features, bundles).
Just before invoking Main.main() our application code sets some system
properties e.g. 'karaf.home' and 'karaf.base'. Looking at the source code in
Main these properties then form the basis from which the code can launch the
container and customise (e.g. add user defined features) into the running
container.

I think the bit I am struggling with is how to 'bootstrap' our system using
paxexam-karaf, I can't understand from the URLs you sent me how this can be
achieved. 

I was hoping it could be as simple as setting system properties in the
config() method of the test as below. The container would then be started
using similar logic as in Main i.e. using the system properties to find a
directory structure that would ultimately dictate how to provision the
container. 

    @Configuration
    public Option[] config() {
        return new Option[]{ 
          karafDistributionConfiguration()
         
.frameworkUrl(maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("zip").versionAsInProject())
          .karafVersion("2.2.5")
          .name("Apache Karaf"),
         
systemProperty("karaf.home").value("/j2ee/uniworks/server/target/classes/osgi"),
         
systemProperty("karaf.base").value("/j2ee/uniworks/server/target/classes/osgi")
        };
    }

I am obviously missing some important concepts here as I can see from the
log the KarafTestContainer starting but not starting the application's
bundles so I am guessing the idea above is quite wrong.


Thanks,

Tim






--
View this message in context: 
http://karaf.922171.n3.nabble.com/Guidance-on-integrated-testing-solutions-tp4025742p4025803.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Reply via email to