use of org.exoplatform.container.xml.Configuration in project kernel by exoplatform.
the class TestComponentLifecyclePluginProfile method testNoProfile.
public void testNoProfile() throws Exception {
Configuration config = getConfiguration("component-lifecycle-plugin.xml");
assertEquals(1, config.getComponentLifecyclePlugins().size());
}
use of org.exoplatform.container.xml.Configuration in project kernel by exoplatform.
the class TestComponentPluginProfile method testFooProfile.
public void testFooProfile() throws Exception {
Configuration config = getConfiguration("component-plugin-configuration.xml", "foo");
Component component = config.getComponent("Component");
assertEquals(2, component.getComponentPlugins().size());
}
use of org.exoplatform.container.xml.Configuration in project kernel by exoplatform.
the class TestComponentProfile method testFooProfile.
public void testFooProfile() throws Exception {
Configuration config = getConfiguration("component-configuration.xml", "foo");
assertEquals(1, config.getComponents().size());
}
use of org.exoplatform.container.xml.Configuration in project kernel by exoplatform.
the class TestConfigurationManagerImpl method testImport.
public void testImport() throws Exception {
// no import
ConfigurationManager cm = new ConfigurationManagerImpl();
cm.addConfiguration("classpath:/org/exoplatform/container/configuration/config-manager-configuration-a.xml");
Configuration conf = cm.getConfiguration();
assertNotNull(conf.getComponent("A"));
assertTrue(conf.getComponent("A").getDocumentURL().getFile().endsWith("config-manager-configuration-a.xml"));
assertNull(conf.getComponent("B"));
assertNull(conf.getComponent("C"));
// b import a
cm = new ConfigurationManagerImpl();
cm.addConfiguration("classpath:/org/exoplatform/container/configuration/config-manager-configuration-b.xml");
conf = cm.getConfiguration();
assertNotNull(conf.getComponent("A"));
assertTrue(conf.getComponent("A").getDocumentURL().getFile().endsWith("config-manager-configuration-a.xml"));
assertNotNull(conf.getComponent("B"));
assertTrue(conf.getComponent("B").getDocumentURL().getFile().endsWith("config-manager-configuration-b.xml"));
assertNull(conf.getComponent("C"));
// c import b and b import a
cm = new ConfigurationManagerImpl();
cm.addConfiguration("classpath:/org/exoplatform/container/configuration/config-manager-configuration-c.xml");
conf = cm.getConfiguration();
assertNotNull(conf.getComponent("A"));
assertTrue(conf.getComponent("A").getDocumentURL().getFile().endsWith("config-manager-configuration-a.xml"));
assertNotNull(conf.getComponent("B"));
assertTrue(conf.getComponent("B").getDocumentURL().getFile().endsWith("config-manager-configuration-b.xml"));
assertNotNull(conf.getComponent("C"));
assertTrue(conf.getComponent("C").getDocumentURL().getFile().endsWith("config-manager-configuration-c.xml"));
}
use of org.exoplatform.container.xml.Configuration in project kernel by exoplatform.
the class TestConfigurationService method testXSDNoSchema.
public void testXSDNoSchema() throws Exception {
ConfigurationUnmarshaller unmarshaller = new ConfigurationUnmarshaller();
URL url = TestConfigurationService.class.getResource("../../../../configuration-no-schema.xml");
Configuration conf = unmarshaller.unmarshall(url);
assertNotNull(conf);
}
Aggregations