Skip to content

Instantly share code, notes, and snippets.

@iocanel
Created March 5, 2012 16:13
Show Gist options
  • Save iocanel/1979056 to your computer and use it in GitHub Desktop.
Save iocanel/1979056 to your computer and use it in GitHub Desktop.
Using Karaf's AdminService for creating instances from a pax-exam karaf unit test
public void createInstances() {
//Install broker feature that is provided by FuseESB
executeCommands("admin:create --feature broker brokerChildInstance");
//Install producer feature that provided by imaginary feature repo.
executeCommands("admin:create --featureURL mvn:imaginary/repo/1.0/xml/features --feature producer producerChildInstance");
//Install producer feature that provided by imaginary feature repo.
executeCommands("admin:create --featureURL mvn:imaginary/repo/1.0/xml/features --feature consumer consumerChildInstance");
//start child instances
executeCommands("admin:start brokerChildInstance");
executeCommands("admin:start producerChildInstance");
executeCommands("admin:start consumerChildInstance");
//You will need to destroy the child instances once you are done.
//Using @After seems the right place to do that.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment