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));
}
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));
}
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());
}
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());
}
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());
}
Aggregations