@Test public void testDefaultBootFeatures() throws Exception { FeaturesServiceImpl impl = createMock(FeaturesServiceImpl.class); Capture<Set<String>> featuresCapture = newCapture(); impl.installFeatures(capture(featuresCapture), eq(EnumSet.of(Option.NoFailOnFeatureNotFound))); expectLastCall(); impl.bootDone(); expectLastCall(); replay(impl); BootFeaturesInstaller bootFeatures = new BootFeaturesInstaller(null, impl, new String[0], "config,standard,region", false); bootFeatures.installBootFeatures(); verify(impl); List<String> features = new ArrayList<>(featuresCapture.getValue()); Assert.assertEquals("config", features.get(0)); Assert.assertEquals("standard", features.get(1)); Assert.assertEquals("region", features.get(2)); }
protected void installBootFeatures() { try { addRepositories(); List<Set<String>> stagedFeatures = parseBootFeatures(features); for (Set<String> features : stagedFeatures) { featuresService.installFeatures(features, EnumSet.of(FeaturesService.Option.NoFailOnFeatureNotFound)); } featuresService.bootDone(); publishBootFinished(); } catch (Throwable e) { if (e instanceof IllegalStateException) { try { bundleContext.getBundle(); } catch (IllegalStateException ies) { return; } } LOGGER.error("Error installing boot features", e); } }
BootFeaturesInstaller { protected void installBootFeatures() { try { addRepositories(); List<Set<String>> stagedFeatures = parseBootFeatures(features); for (Set<String> features : stagedFeatures) { featuresService.installFeatures(features, EnumSet.of(FeaturesService.Option.NoFailOnFeatureNotFound)); } featuresService.bootDone(); publishBootFinished(); } catch (Throwable e) { if (e instanceof IllegalStateException) { try { bundleContext.getBundle(); } catch (IllegalStateException ies) { return; } } LOGGER.error("Error installing boot features", e); } } }
BootFeaturesInstaller { protected void installBootFeatures() { try { addRepositories(); List<Set<String>> stagedFeatures = parseBootFeatures(features); for (Set<String> features : stagedFeatures) { featuresService.installFeatures(features, EnumSet.of(FeaturesService.Option.NoFailOnFeatureNotFound)); } featuresService.bootDone(); publishBootFinished(); } catch (Throwable e) { if (e instanceof IllegalStateException) { try { bundleContext.getBundle(); } catch (IllegalStateException ies) { return; } } LOGGER.error("Error installing boot features", e); } } BootFeaturesInstaller(BundleContext bundleContext,
                                 FeaturesServiceImpl featuresService,
                                 String[] repositories,
                                 String features,
                                 boolean asynchronous); }
BootFeaturesInstaller { protected void installBootFeatures() { try { addRepositories(); List<Set<String>> stagedFeatures = parseBootFeatures(features); for (Set<String> features : stagedFeatures) { featuresService.installFeatures(features, EnumSet.of(FeaturesService.Option.NoFailOnFeatureNotFound)); } featuresService.bootDone(); publishBootFinished(); } catch (Throwable e) { if (e instanceof IllegalStateException) { try { bundleContext.getBundle(); } catch (IllegalStateException ies) { return; } } LOGGER.error("Error installing boot features", e); } } BootFeaturesInstaller(BundleContext bundleContext,
                                 FeaturesServiceImpl featuresService,
                                 String[] repositories,
                                 String features,
                                 boolean asynchronous); void start(); }
BootFeaturesInstaller { protected void installBootFeatures() { try { addRepositories(); List<Set<String>> stagedFeatures = parseBootFeatures(features); for (Set<String> features : stagedFeatures) { featuresService.installFeatures(features, EnumSet.of(FeaturesService.Option.NoFailOnFeatureNotFound)); } featuresService.bootDone(); publishBootFinished(); } catch (Throwable e) { if (e instanceof IllegalStateException) { try { bundleContext.getBundle(); } catch (IllegalStateException ies) { return; } } LOGGER.error("Error installing boot features", e); } } BootFeaturesInstaller(BundleContext bundleContext,
                                 FeaturesServiceImpl featuresService,
                                 String[] repositories,
                                 String features,
                                 boolean asynchronous); void start();  }