ServiceReference sr = bundleContext.getServiceReference("org.osgi.service.framework.CompositeBundleFactory");
if (sr != null) {
// install blueprint.sample into the composite context
CompositeBundleFactory cbf = (CompositeBundleFactory)bundleContext.getService(sr);
Map<String, String> frameworkConfig = new HashMap<String, String>();
// turn on the line below to enable telnet localhost 10000 to the child framework osgi console
// frameworkConfig.put("osgi.console", "10000");
// construct composite bundle information
Map<String, String> compositeManifest = new HashMap<String, String>();
compositeManifest.put(Constants.BUNDLE_SYMBOLICNAME, "test-composite");
compositeManifest.put(Constants.BUNDLE_VERSION, "1.0.0");
// this import-package is used by the blueprint.sample
compositeManifest.put(Constants.IMPORT_PACKAGE, "org.osgi.service.blueprint;version=\"[1.0.0,2.0.0)\", org.osgi.service.blueprint.container;version=1.0");
// this export-package is used by pax junit runner as it needs to see the blueprint sample package
// for the test after the blueprint sample is started.
compositeManifest.put(Constants.EXPORT_PACKAGE, "org.apache.aries.blueprint.sample");
CompositeBundle cb = cbf.installCompositeBundle(frameworkConfig, "test-composite", compositeManifest);
BundleContext compositeBundleContext = cb.getCompositeFramework().getBundleContext();
// install the blueprint sample onto the framework associated with the composite bundle
MavenArtifactProvisionOption mapo = mavenBundleInTest(getClass().getClassLoader(), "org.apache.aries.blueprint", "org.apache.aries.blueprint.sample");
// let's use input stream to avoid invoking mvn url handler which isn't avail in the child framework.