private boolean installFeature(String feature, String version) { boolean success = false; if (featuresService == null) { this.log.error("Features service is not available"); } try { featuresService.installFeature(feature, version); success = true; } catch (Exception e) { this.log.error("Can't install feature {}/{}", feature, version, e); } return success; }
protected void installFeature(String featureName) { try { LOG.info("Installing feature {}", featureName); featuresService.installFeature(featureName); } catch (Exception e) { throw new RuntimeException(e); } }
protected void installFeature(String featureName, String version) { try { LOG.info("Installing feature {}/{}", featureName, version); featuresService.installFeature(featureName, version); } catch (Exception e) { throw new RuntimeException(e); } }
public void installFeature(String name, String version, boolean noRefresh) throws Exception { EnumSet<org.apache.karaf.features.FeaturesService.Option> options = EnumSet.noneOf(org.apache.karaf.features.FeaturesService.Option.class); if (noRefresh) { options.add(org.apache.karaf.features.FeaturesService.Option.NoAutoRefreshBundles); } featuresService.installFeature(name, version, options); }
private void installMissingFeature(FeaturesService service, String feature) throws Exception { if (feature.contains("/")) { String[] parts = feature.split("/"); if (parts.length == 2) { service.installFeature(parts[0], parts[1]); } else { throw new IllegalStateException(String.format("Invalid feature identifier: %s - valid syntax: <name>/<version> or <name>", feature)); } } else { service.installFeature(feature); } }
protected void installFeature(String featureName, EnumSet<FeaturesService.Option> options) { try { LOG.info("Installing feature {}", featureName); featuresService.installFeature(featureName, options); } catch (Exception e) { throw new RuntimeException(e); } }
public void installFeature(String name, boolean noRefresh) throws Exception { EnumSet<org.apache.karaf.features.FeaturesService.Option> options = EnumSet.noneOf(org.apache.karaf.features.FeaturesService.Option.class); if (noRefresh) { options.add(org.apache.karaf.features.FeaturesService.Option.NoAutoRefreshBundles); } featuresService.installFeature(name, options); }
private void installMissingFeature(FeaturesService service, String feature) throws Exception { if (feature.contains("/")) { String[] parts = feature.split("/"); if (parts.length == 2) { service.installFeature(parts[0], parts[1]); } else { throw new IllegalStateException(String.format("Invalid feature identifier: %s - valid syntax: <name>/<version> or <name>", feature)); } } else { service.installFeature(feature); } }
public void installFeature(String name, boolean noRefresh, boolean noStart) throws Exception { EnumSet<org.apache.karaf.features.FeaturesService.Option> options = EnumSet.noneOf(org.apache.karaf.features.FeaturesService.Option.class); if (noRefresh) { options.add(org.apache.karaf.features.FeaturesService.Option.NoAutoRefreshBundles); } if (noStart) { options.add(org.apache.karaf.features.FeaturesService.Option.NoAutoStartBundles); } featuresService.installFeature(name, options); }
protected void installCamelFeature(String mainFeature) throws Exception { if (!mainFeature.startsWith("camel-")) { mainFeature = "camel-" + mainFeature; } LOG.info("Install main feature: {}", mainFeature); // do not refresh bundles causing out bundle context to be invalid // TODO: see if we can find a way maybe to install camel.xml as bundle/feature instead of part of unit test (see src/test/resources/OSGI-INF/blueprint) featuresService.installFeature(mainFeature, EnumSet.of(FeaturesService.Option.NoAutoRefreshBundles)); }
public void installFeature(String name, String version, boolean noRefresh, boolean noStart) throws Exception { EnumSet<org.apache.karaf.features.FeaturesService.Option> options = EnumSet.noneOf(org.apache.karaf.features.FeaturesService.Option.class); if (noRefresh) { options.add(org.apache.karaf.features.FeaturesService.Option.NoAutoRefreshBundles); } if (noStart) { options.add(org.apache.karaf.features.FeaturesService.Option.NoAutoStartBundles); } featuresService.installFeature(name, version, options); }
public void installAndAssertFeature(String feature) throws Exception { featureService.installFeature(feature, NO_AUTO_REFRESH); assertFeatureInstalled(feature); }
protected void installAssertAndUninstallFeature(String feature, String version) throws Exception { Set<Feature> featuresBefore = new HashSet<>(Arrays.asList(featuresService.listInstalledFeatures())); try { featuresService.installFeature(feature, version); assertFeatureInstalled(feature, version); } finally { uninstallNewFeatures(featuresBefore); } }
protected void installAssertAndUninstallFeatures(String... feature) throws Exception { Set<Feature> featuresBefore = new HashSet<>(Arrays.asList(featuresService.listInstalledFeatures())); try { for (String curFeature : feature) { featuresService.installFeature(curFeature); assertFeatureInstalled(curFeature); } } finally { uninstallNewFeatures(featuresBefore); } }
@Test public void installFeature() throws Exception { LOG.info("Attempting to install feature {} {}", getFeatureName(),getFeatureVersion()); featuresService.installFeature(getFeatureName(), getFeatureVersion()); Feature f = featuresService.getFeature(getFeatureName(), getFeatureVersion()); Assert.assertNotNull("Attempt to get feature "+ getFeatureName() + " " + getFeatureVersion() + "resulted in null" , f); Assert.assertTrue("Failed to install Feature: " + getFeatureName() + " " + getFeatureVersion(),featuresService.isInstalled(f)); LOG.info("Successfull installed feature {} {}", getFeatureName(),getFeatureVersion()); } }
@Test public void testAmqpInstallation() throws Exception { assertFalse("trellis-amqp already installed!", featuresService.isInstalled(featuresService.getFeature("trellis-amqp"))); featuresService.installFeature("trellis-event-serialization"); featuresService.installFeature("trellis-amqp"); checkTrellisBundlesAreActive(); assertTrue("trellis-amqp not installed!", featuresService.isInstalled(featuresService.getFeature("trellis-amqp"))); }
@Test public void testRDFaInstallation() throws Exception { featuresService.installFeature("trellis-rdfa"); checkTrellisBundlesAreActive(); assertTrue("trellis-rdfa not installed!", featuresService.isInstalled(featuresService.getFeature("trellis-rdfa"))); }
@Test public void testHttpInstallation() throws Exception { assertFalse("trellis-http already installed!", featuresService.isInstalled(featuresService.getFeature("trellis-http"))); featuresService.installFeature("trellis-http"); checkTrellisBundlesAreActive(); assertTrue("trellis-http not installed!", featuresService.isInstalled(featuresService.getFeature("trellis-http"))); }
@Test public void testFileInstallation() throws Exception { assertFalse("trellis-file already installed!", featuresService.isInstalled(featuresService.getFeature("trellis-file"))); featuresService.installFeature("trellis-file"); checkTrellisBundlesAreActive(); assertTrue("trellis-file not installed!", featuresService.isInstalled(featuresService.getFeature("trellis-file"))); }
@Test public void testOAuthAuthInstallation() throws Exception { assertFalse("trellis-auth-oauth already installed!", featuresService.isInstalled(featuresService.getFeature("trellis-auth-oauth"))); featuresService.installFeature("trellis-auth-oauth"); checkTrellisBundlesAreActive(); assertTrue("trellis-auth-oauth not installed!", featuresService.isInstalled(featuresService.getFeature("trellis-auth-oauth"))); }