Search in sources :

Example 16 with Configuration

use of org.exoplatform.container.xml.Configuration in project kernel by exoplatform.

the class TestImportWithProperties method testWithNoPropertyDefined.

/**
 * Test if used system property not defined. String ${db.configuration.path}
 * should not be replaced.
 *
 * @throws Exception
 */
public void testWithNoPropertyDefined() throws Exception {
    assertNull(System.getProperty("db.configuration.path"));
    Configuration config = getConfiguration("import-with-parameter-configuration.xml");
    assertEquals(3, config.getImports().size());
    assertEquals("${db.configuration.path}/db.xml", config.getImports().get(0));
    assertEquals(System.getProperty("java.io.tmpdir") + "/bindfile.xml", config.getImports().get(1));
    assertEquals("simple.xml", config.getImports().get(2));
}
Also used : Configuration(org.exoplatform.container.xml.Configuration)

Example 17 with Configuration

use of org.exoplatform.container.xml.Configuration in project kernel by exoplatform.

the class TestImportWithProperties method testWithPropertyDefined.

/**
 * Test if system property t defined. String ${db.configuration.path} should
 * be replaced with property value.
 *
 * @throws Exception
 */
public void testWithPropertyDefined() throws Exception {
    System.setProperty("db.configuration.path", "/home/admin/db");
    assertNotNull(System.getProperty("db.configuration.path"));
    Configuration config = getConfiguration("import-with-parameter-configuration.xml");
    assertEquals(3, config.getImports().size());
    assertEquals("/home/admin/db/db.xml", config.getImports().get(0));
    assertEquals(System.getProperty("java.io.tmpdir") + "/bindfile.xml", config.getImports().get(1));
    assertEquals("simple.xml", config.getImports().get(2));
}
Also used : Configuration(org.exoplatform.container.xml.Configuration)

Example 18 with Configuration

use of org.exoplatform.container.xml.Configuration in project kernel by exoplatform.

the class TestInitParamProfile method testFooProfile.

public void testFooProfile() throws Exception {
    Configuration config = getConfiguration("init-param-configuration.xml", "foo");
    Component component = config.getComponent("Component");
    InitParams initParams = component.getInitParams();
    ValueParam valueParam = initParams.getValueParam("param");
    assertEquals("foo", valueParam.getValue());
}
Also used : InitParams(org.exoplatform.container.xml.InitParams) Configuration(org.exoplatform.container.xml.Configuration) Component(org.exoplatform.container.xml.Component) ValueParam(org.exoplatform.container.xml.ValueParam)

Example 19 with Configuration

use of org.exoplatform.container.xml.Configuration in project kernel by exoplatform.

the class TestInitParamProfile method testNoProfile.

public void testNoProfile() throws Exception {
    Configuration config = getConfiguration("init-param-configuration.xml");
    Component component = config.getComponent("Component");
    InitParams initParams = component.getInitParams();
    ValueParam valueParam = initParams.getValueParam("param");
    assertEquals("empty", valueParam.getValue());
}
Also used : InitParams(org.exoplatform.container.xml.InitParams) Configuration(org.exoplatform.container.xml.Configuration) Component(org.exoplatform.container.xml.Component) ValueParam(org.exoplatform.container.xml.ValueParam)

Example 20 with Configuration

use of org.exoplatform.container.xml.Configuration in project kernel by exoplatform.

the class TestRemoveConfigProfile method testFooProfile.

public void testFooProfile() throws Exception {
    Configuration config = getConfiguration("remove-configuration.xml", "foo");
    assertEquals(2, config.getRemoveConfiguration().size());
}
Also used : Configuration(org.exoplatform.container.xml.Configuration)

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