@Test public void testExplicitlyConfiguredStartLevelAndAutoStart() throws IOException { instDesc.addBundleStartLevel(new BundleStartLevel("org.example.bundle1", 6, true)); List<String> config = splitAtComma( subject.toOsgiBundles(bundles, instDesc.getBundleStartLevel(), defaultLevel)); assertThat(config, hasItem("reference:file:absolute/path/to/bundle1@6:start")); }
protected String toOsgiBundles(Map<ArtifactKey, File> bundles, Map<String, BundleStartLevel> startLevel, BundleStartLevel defaultStartLevel) throws IOException { log.debug("Installation OSGI bundles:"); StringBuilder result = new StringBuilder(); for (Map.Entry<ArtifactKey, File> entry : bundles.entrySet()) { BundleStartLevel level = startLevel.get(entry.getKey().getId()); if (level != null && level.getLevel() == -1) { continue; } if (result.length() > 0) { result.append(","); } StringBuilder line = new StringBuilder(); line.append(appendAbsolutePath(entry.getValue())); if (level != null) { line.append('@'); if (level.getLevel() > 0) { line.append(level.getLevel()); } if (level.isAutoStart()) { if (line.charAt(line.length() - 1) == '@') { line.append("start"); } else { line.append(":start"); } } } else { if (defaultStartLevel.isAutoStart()) { line.append("@start"); } } log.debug("\t" + line); result.append(line.toString()); } return result.toString(); }
DefaultEquinoxInstallationFactory implements EquinoxInstallationFactory { protected String toOsgiBundles(Map<ArtifactKey, File> bundles, Map<String, BundleStartLevel> startLevel, BundleStartLevel defaultStartLevel) throws IOException { log.debug("Installation OSGI bundles:"); StringBuilder result = new StringBuilder(); for (Map.Entry<ArtifactKey, File> entry : bundles.entrySet()) { BundleStartLevel level = startLevel.get(entry.getKey().getId()); if (level != null && level.getLevel() == -1) { continue; } if (result.length() > 0) { result.append(","); } StringBuilder line = new StringBuilder(); line.append(appendAbsolutePath(entry.getValue())); if (level != null) { line.append('@'); if (level.getLevel() > 0) { line.append(level.getLevel()); } if (level.isAutoStart()) { if (line.charAt(line.length() - 1) == '@') { line.append("start"); } else { line.append(":start"); } } } else { if (defaultStartLevel.isAutoStart()) { line.append("@start"); } } log.debug("\t" + line); result.append(line.toString()); } return result.toString(); } }
DefaultEquinoxInstallationFactory implements EquinoxInstallationFactory { protected String toOsgiBundles(Map<ArtifactKey, File> bundles, Map<String, BundleStartLevel> startLevel, BundleStartLevel defaultStartLevel) throws IOException { log.debug("Installation OSGI bundles:"); StringBuilder result = new StringBuilder(); for (Map.Entry<ArtifactKey, File> entry : bundles.entrySet()) { BundleStartLevel level = startLevel.get(entry.getKey().getId()); if (level != null && level.getLevel() == -1) { continue; } if (result.length() > 0) { result.append(","); } StringBuilder line = new StringBuilder(); line.append(appendAbsolutePath(entry.getValue())); if (level != null) { line.append('@'); if (level.getLevel() > 0) { line.append(level.getLevel()); } if (level.isAutoStart()) { if (line.charAt(line.length() - 1) == '@') { line.append("start"); } else { line.append(":start"); } } } else { if (defaultStartLevel.isAutoStart()) { line.append("@start"); } } log.debug("\t" + line); result.append(line.toString()); } return result.toString(); } DefaultEquinoxInstallationFactory();   DefaultEquinoxInstallationFactory(Logger log); }
DefaultEquinoxInstallationFactory implements EquinoxInstallationFactory { protected String toOsgiBundles(Map<ArtifactKey, File> bundles, Map<String, BundleStartLevel> startLevel, BundleStartLevel defaultStartLevel) throws IOException { log.debug("Installation OSGI bundles:"); StringBuilder result = new StringBuilder(); for (Map.Entry<ArtifactKey, File> entry : bundles.entrySet()) { BundleStartLevel level = startLevel.get(entry.getKey().getId()); if (level != null && level.getLevel() == -1) { continue; } if (result.length() > 0) { result.append(","); } StringBuilder line = new StringBuilder(); line.append(appendAbsolutePath(entry.getValue())); if (level != null) { line.append('@'); if (level.getLevel() > 0) { line.append(level.getLevel()); } if (level.isAutoStart()) { if (line.charAt(line.length() - 1) == '@') { line.append("start"); } else { line.append(":start"); } } } else { if (defaultStartLevel.isAutoStart()) { line.append("@start"); } } log.debug("\t" + line); result.append(line.toString()); } return result.toString(); } DefaultEquinoxInstallationFactory();   DefaultEquinoxInstallationFactory(Logger log); @Override EquinoxInstallation createInstallation(EquinoxInstallationDescription description, File location); }
DefaultEquinoxInstallationFactory implements EquinoxInstallationFactory { protected String toOsgiBundles(Map<ArtifactKey, File> bundles, Map<String, BundleStartLevel> startLevel, BundleStartLevel defaultStartLevel) throws IOException { log.debug("Installation OSGI bundles:"); StringBuilder result = new StringBuilder(); for (Map.Entry<ArtifactKey, File> entry : bundles.entrySet()) { BundleStartLevel level = startLevel.get(entry.getKey().getId()); if (level != null && level.getLevel() == -1) { continue; } if (result.length() > 0) { result.append(","); } StringBuilder line = new StringBuilder(); line.append(appendAbsolutePath(entry.getValue())); if (level != null) { line.append('@'); if (level.getLevel() > 0) { line.append(level.getLevel()); } if (level.isAutoStart()) { if (line.charAt(line.length() - 1) == '@') { line.append("start"); } else { line.append(":start"); } } } else { if (defaultStartLevel.isAutoStart()) { line.append("@start"); } } log.debug("\t" + line); result.append(line.toString()); } return result.toString(); } DefaultEquinoxInstallationFactory();   DefaultEquinoxInstallationFactory(Logger log); @Override EquinoxInstallation createInstallation(EquinoxInstallationDescription description, File location);  }