Commit 17a54316 authored by Yann Mombrun's avatar Yann Mombrun

Fix invalid configuration.xml after host addition

Also add a unit test that loads the whole configuration to prevent from
the above mentionned issue
parent 899674ba
......@@ -173,6 +173,7 @@
<property name="jmxUser" value="weblab" />
<property name="jmxPassword" value="weblab" />
<property name="jmxPort" value="1099" />
<property name="host" value="${}" />
<property name="env">
<bean class="org.ow2.weblab.bundle.utils.ProcessUtils.Env">
......@@ -194,6 +195,7 @@
<property name="jmxPort" value="${activemq.jmx.port}" />
<property name="binDirectory" value="${weblab.home}${activemq.path}/bin" />
<property name="port" value="${activemq.main.port}" />
<property name="host" value="${}" />
<property name="env">
<bean class="org.ow2.weblab.bundle.utils.ProcessUtils.Env">
......@@ -240,6 +242,7 @@
<property name="binDirectory" value="${weblab.home}${solr.path}/bin" />
<property name="zookeeperEnsemble" value="${}" />
<property name="dataDirectory" value="${}/solr_node1" />
<property name="host" value="${}" />
<!-- WARN this value is only set to check solr server is correctly running. Changing this value will not change port on which solr is listening -->
<!-- see -p options below -->
<property name="port" value="${solr1.http.port}" />
......@@ -118,6 +118,22 @@ In case something goes wrong, explains, as much as possible, where it failed and
......@@ -36,20 +36,30 @@ import;
public class LauncherTest {
* Try to read the configuration.xml file provided in bundle/conf folder.
* Rely on the configuration of properties plugin that generates a file with the properties of the pom. This enable to resolve values like serverXXX.path that are
* replaced at packaging time.
public void testConfigLoading() {
System.setProperty("weblab.home", PathUtils.getWebLabHome(""));
System.setProperty("weblab.conf", PathUtils.getWebLabHome("conf"));
System.setProperty("", PathUtils.getWebLabHome("data"));
final DefaultListableBeanFactory factory = new DefaultListableBeanFactory();
final XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(factory);
reader.loadBeanDefinitions(new FileSystemResource("src/test/resources/conf/configuration.xml"));
reader.loadBeanDefinitions(new FileSystemResource("../../conf/configuration.xml"));
PropertyPlaceholderConfigurer cfg = new PropertyPlaceholderConfigurer();
if (factory.containsBean("properties")) {
cfg = factory.getBean("properties", PropertyPlaceholderConfigurer.class);
final FileSystemResource filterFile = new FileSystemResource("target/");
Assert.assertTrue("Filter file " + filterFile.getFile() + " does not exists.", filterFile.getFile().exists());
......@@ -61,6 +71,7 @@ public class LauncherTest {
public void testPaths() throws IOException {
final String file = PathUtils.createPath("src", "test", "resources") + "cxf-servlet.xml";
final String replacement = "<constructor-arg value=\"test\"/>";
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment