@Test
    void bundle_from_generation_that_fails_in_component_construction_is_uninstalled() {
        ComponentEntry simpleComponentEntry = new ComponentEntry("simpleComponent", SimpleComponent.class);
        ComponentEntry throwingComponentEntry = new ComponentEntry("throwingComponent", ComponentThrowingExceptionInConstructor.class);

        writeBootstrapConfigsWithBundles(List.of("bundle-1"), List.of(simpleComponentEntry));
        Container container = newContainer(dirConfigSource);
        ComponentGraph currentGraph = getNewComponentGraph(container);

        // bundle-1 is installed
        assertEquals(1, osgi.getBundles().length);
        assertEquals("bundle-1", osgi.getBundles()[0].getSymbolicName());

        writeBootstrapConfigsWithBundles(List.of("bundle-2"), List.of(throwingComponentEntry));
        container.reloadConfig(2);
        assertNewComponentGraphFails(container, currentGraph, ComponentConstructorException.class);
        assertEquals(1, currentGraph.generation());

        // bundle-1 is kept, bundle-2 has been uninstalled
        assertEquals(1, osgi.getBundles().length);
        assertEquals("bundle-1", osgi.getBundles()[0].getSymbolicName());

        container.shutdownConfigRetriever();
        container.shutdown(currentGraph);
    }
@author Tony Vaagenes
@author gjoranv
@author ollivir
container-core/src/test/java/com/yahoo/container/di/ContainerTest.java