in src/main/java/org/apache/sling/testing/clients/osgi/BundlesInstaller.java [94:117]
public void installBundles(List<File> toInstall, boolean startBundles) throws ClientException, IOException {
for(File f : toInstall) {
final String bundleSymbolicName = OsgiConsoleClient.getBundleSymbolicName(f);
if (isInstalled(f)) {
if (f.getName().contains("SNAPSHOT")) {
log.info("Reinstalling (due to SNAPSHOT version): {}", bundleSymbolicName);
osgiConsoleClient.uninstallBundle(bundleSymbolicName);
} else if (!isInstalledWithSameVersion(f)) {
log.info("Reinstalling (due to version mismatch): {}", bundleSymbolicName);
osgiConsoleClient.uninstallBundle(bundleSymbolicName);
} else {
log.info("Not reinstalling: {}", bundleSymbolicName);
continue;
}
}
osgiConsoleClient.installBundle(f, startBundles);
log.info("Installed: {}", bundleSymbolicName);
}
// ensure that bundles are re-wired esp. if an existing bundle was updated
osgiConsoleClient.refreshPackages();
log.info("{} additional bundles installed", toInstall.size());
}