URL portalURL = getClass().getResource("test-exo-container2.xml");
assertNotNull(rootURL);
assertNotNull(portalURL);
//
new ContainerBuilder().withRoot(rootURL).withPortal(portalURL).build();
RootContainer root = RootContainer.getInstance();
testIntegration(root);
ComponentAdapter<H> adapterH = root.getComponentAdapterOfType(H.class);
assertNull(adapterH);
PortalContainer portal = PortalContainer.getInstance();
adapterH = portal.getComponentAdapterOfType(H.class);
assertNotNull(adapterH);
H h = root.getComponentInstanceOfType(H.class);
assertNull(h);
h = portal.getComponentInstanceOfType(H.class);
assertNotNull(h);
assertSame(h, portal.getComponentInstanceOfType(H.class));
assertSame(h, adapterH.getComponentInstance());
List<ComponentAdapter<H>> adapters = root.getComponentAdaptersOfType(H.class);
assertTrue(adapters == null || adapters.isEmpty());
adapters = portal.getComponentAdaptersOfType(H.class);
assertNotNull(adapters);
assertEquals(1, adapters.size());
assertSame(h, adapters.get(0).getComponentInstance());
List<H> allH = root.getComponentInstancesOfType(H.class);
assertTrue(allH == null || allH.isEmpty());
allH = portal.getComponentInstancesOfType(H.class);
assertNotNull(allH);
assertEquals(1, allH.size());
assertSame(h, allH.get(0));