Container { public ComponentGraph getNewComponentGraph(ComponentGraph oldGraph, Injector fallbackInjector, boolean restartOnRedeploy) { try { Collection<Bundle> obsoleteBundles = new HashSet<>(); ComponentGraph newGraph = getConfigAndCreateGraph(oldGraph, fallbackInjector, restartOnRedeploy, obsoleteBundles); newGraph.reuseNodes(oldGraph); constructComponents(newGraph); deconstructObsoleteComponents(oldGraph, newGraph, obsoleteBundles); return newGraph; } catch (Throwable t) { invalidateGeneration(oldGraph.generation(), t); throw t; } } Container(SubscriberFactory subscriberFactory, String configId, ComponentDeconstructor componentDeconstructor, Osgi osgi);  Container(SubscriberFactory subscriberFactory, String configId, ComponentDeconstructor componentDeconstructor); ComponentGraph getNewComponentGraph(ComponentGraph oldGraph, Injector fallbackInjector, boolean restartOnRedeploy); void shutdown(ComponentGraph graph, ComponentDeconstructor deconstructor); void reloadConfig(long generation); static T getConfig(ConfigKey<T> key,
                                                         Map<ConfigKey<? extends ConfigInstance>, ConfigInstance> configs);  }
@Ignore @Test public void manually_verify_what_happens_when_first_graph_contains_component_that_throws_exception_in_ctor() { writeBootstrapConfigs("thrower", ComponentThrowingExceptionInConstructor.class); Container container = newContainer(dirConfigSource); try { getNewComponentGraph(container); fail("Expected to log and die."); } catch (Throwable t) { fail("Expected to log and die"); } }
@Test public void providers_are_invoked_only_when_needed() { writeBootstrapConfigs("id1", FailOnGetProvider.class); Container container = newContainer(dirConfigSource); ComponentGraph oldGraph = getNewComponentGraph(container); }