use of org.exoplatform.container.ContainerBuilder in project kernel by exoplatform.
the class TestManagementProvider method testManagedRegistrationBeforeProviderRegistration.
public void testManagedRegistrationBeforeProviderRegistration() {
URL url = getClass().getResource("configuration2.xml");
RootContainer container = new ContainerBuilder().withRoot(url).build();
ManagementProviderImpl provider = (ManagementProviderImpl) container.getComponentInstanceOfType(ManagementProviderImpl.class);
assertNull(provider);
Object foo = container.getComponentInstance("Foo");
assertNotNull(foo);
provider = new ManagementProviderImpl();
container.registerComponentInstance(provider);
assertEquals(2, provider.managedResources.size());
ManagedResource fooMR = provider.managedResources.get(1);
assertSame(foo, fooMR.resource);
assertEquals(Collections.<ScopedData>emptyList(), fooMR.context.getScopingData(ScopedData.class));
fooMR.register();
assertEquals(Collections.singletonList(fooMR.data), fooMR.context.getScopingData(ScopedData.class));
}
use of org.exoplatform.container.ContainerBuilder in project kernel by exoplatform.
the class TestSpringContainer method testIntegrationClass.
public void testIntegrationClass() {
URL rootURL = getClass().getResource("test-exo-container.xml");
URL portalURL = getClass().getResource("test-exo-container2.xml");
assertNotNull(rootURL);
assertNotNull(portalURL);
//
new ContainerBuilder().withRoot(rootURL).withPortal(portalURL).profiledBy("class").build();
RootContainer root = RootContainer.getInstance();
testIntegration(root);
}
use of org.exoplatform.container.ContainerBuilder in project kernel by exoplatform.
the class TestSpringContainer method testIntegrationFile.
public void testIntegrationFile() {
URL rootURL = getClass().getResource("test-exo-container.xml");
URL portalURL = getClass().getResource("test-exo-container2.xml");
assertNotNull(rootURL);
assertNotNull(portalURL);
//
new ContainerBuilder().withRoot(rootURL).withPortal(portalURL).profiledBy("file").build();
RootContainer root = RootContainer.getInstance();
testIntegration(root);
}
use of org.exoplatform.container.ContainerBuilder in project kernel by exoplatform.
the class TestXSD_1_1 method testInitParams.
public void testInitParams() throws Exception {
URL url = getClass().getResource("../../../../xsd_1_1/test-validation.xml");
assertNotNull(url);
RootContainer container = new ContainerBuilder().withRoot(url).build();
container.getComponentInstanceOfType(TestValidation.class);
}
use of org.exoplatform.container.ContainerBuilder in project kernel by exoplatform.
the class TestXSD_1_2 method testInitParams.
public void testInitParams() throws Exception {
URL url = getClass().getResource("../../../../xsd_1_2/test-validation.xml");
assertNotNull(url);
RootContainer container = new ContainerBuilder().withRoot(url).build();
container.getComponentInstanceOfType(TestValidation.class);
}
Aggregations