Search in sources :

Example 26 with Configuration

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());
}
Also used : Configuration(org.exoplatform.container.xml.Configuration)

Example 27 with Configuration

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());
}
Also used : Configuration(org.exoplatform.container.xml.Configuration) Component(org.exoplatform.container.xml.Component)

Example 28 with Configuration

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());
}
Also used : Configuration(org.exoplatform.container.xml.Configuration)

Example 29 with Configuration

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"));
}
Also used : Configuration(org.exoplatform.container.xml.Configuration)

Example 30 with Configuration

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);
}
Also used : Configuration(org.exoplatform.container.xml.Configuration) URL(java.net.URL)

Aggregations

Configuration (org.exoplatform.container.xml.Configuration)37 Component (org.exoplatform.container.xml.Component)9 ExternalComponentPlugins (org.exoplatform.container.xml.ExternalComponentPlugins)5 ObjectParameter (org.exoplatform.container.xml.ObjectParameter)4 InitParams (org.exoplatform.container.xml.InitParams)3 ValueParam (org.exoplatform.container.xml.ValueParam)3 IBindingFactory (org.jibx.runtime.IBindingFactory)3 IUnmarshallingContext (org.jibx.runtime.IUnmarshallingContext)3 File (java.io.File)2 IOException (java.io.IOException)2 URL (java.net.URL)2 PrivilegedActionException (java.security.PrivilegedActionException)2 InputStream (java.io.InputStream)1 StringReader (java.io.StringReader)1 StringWriter (java.io.StringWriter)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Method (java.lang.reflect.Method)1 Iterator (java.util.Iterator)1 List (java.util.List)1 Properties (java.util.Properties)1