// add required bundles defined in test
for (OSGiBundleDescriptor descriptor : testBundles) {
addRequiredBundleFromTest(descriptor);
}
BundleWrapper testRunnerBundle = frameworkStarter.installBundle(getBundleNameAndVersion(testRunnerBundleDescriptor));
bundleList.add(testRunnerBundle);
for (OSGiBundleDescriptor descriptor : requiredBundles) {
BundleWrapper bundle = frameworkStarter.installBundle(getBundleNameAndVersion(descriptor));
if (bundle != null) {
bundleList.add(bundle);
}
}
List<BundleWrapper> testBundleList = new ArrayList<BundleWrapper>();
for (OSGiBundleDescriptor descriptor : testBundles) {
BundleWrapper bundle = frameworkStarter.installBundle(getBundleNameAndVersion(descriptor));
if (bundle != null) {
testBundleList.add(bundle);
}
}
// start all required bundles
for (BundleWrapper bundle : bundleList) {
bundle.start();
}
// set the test parameters
if (testParameters.size() > 0) {
setTestParameters(testRunnerBundle.getBundleContext());
}
// start the test bundles
for (BundleWrapper bundle : testBundleList) {
bundle.start();
}
List<OSGiTestResult> testResults = getTestResults(testRunnerBundle.getBundleContext());
return testResults;
} finally {
stopFramework();