[jboss-cvs] JBoss Messaging SVN: r3256 - in trunk: src/main/org/jboss/messaging/util and 2 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Oct 29 07:44:01 EDT 2007
Author: timfox
Date: 2007-10-29 07:44:00 -0400 (Mon, 29 Oct 2007)
New Revision: 3256
Modified:
trunk/src/etc/server/default/deploy/db2-persistence-service.xml
trunk/src/etc/server/default/deploy/mssql-persistence-service.xml
trunk/src/etc/server/default/deploy/mysqlcluster-persistence-service.xml
trunk/src/etc/server/default/deploy/oracle-persistence-service.xml
trunk/src/etc/server/default/deploy/postgresql-persistence-service.xml
trunk/src/etc/server/default/deploy/sybase-persistence-service.xml
trunk/src/main/org/jboss/messaging/util/XMLUtil.java
trunk/tests/build.xml
trunk/tests/src/org/jboss/test/messaging/tools/ServerManagement.java
Log:
Allow props to be overridden for Hudson
Modified: trunk/src/etc/server/default/deploy/db2-persistence-service.xml
===================================================================
--- trunk/src/etc/server/default/deploy/db2-persistence-service.xml 2007-10-29 10:38:53 UTC (rev 3255)
+++ trunk/src/etc/server/default/deploy/db2-persistence-service.xml 2007-10-29 11:44:00 UTC (rev 3256)
@@ -131,8 +131,8 @@
<!-- The JGroups group name that the post office will use -->
- <attribute name="GroupName">MessagingPostOffice</attribute>
-
+ <attribute name="GroupName">${jboss.messaging.groupname:MessagingPostOffice}</attribute>
+
<!-- Max time to wait for state to arrive when the post office joins the cluster -->
<attribute name="StateTimeout">5000</attribute>
Modified: trunk/src/etc/server/default/deploy/mssql-persistence-service.xml
===================================================================
--- trunk/src/etc/server/default/deploy/mssql-persistence-service.xml 2007-10-29 10:38:53 UTC (rev 3255)
+++ trunk/src/etc/server/default/deploy/mssql-persistence-service.xml 2007-10-29 11:44:00 UTC (rev 3256)
@@ -133,8 +133,8 @@
<!-- The JGroups group name that the post office will use -->
- <attribute name="GroupName">MessagingPostOffice</attribute>
-
+ <attribute name="GroupName">${jboss.messaging.groupname:MessagingPostOffice}</attribute>
+
<!-- Max time to wait for state to arrive when the post office joins the cluster -->
<attribute name="StateTimeout">5000</attribute>
Modified: trunk/src/etc/server/default/deploy/mysqlcluster-persistence-service.xml
===================================================================
--- trunk/src/etc/server/default/deploy/mysqlcluster-persistence-service.xml 2007-10-29 10:38:53 UTC (rev 3255)
+++ trunk/src/etc/server/default/deploy/mysqlcluster-persistence-service.xml 2007-10-29 11:44:00 UTC (rev 3256)
@@ -134,8 +134,8 @@
<!-- The JGroups group name that the post office will use -->
- <attribute name="GroupName">MessagingPostOffice</attribute>
-
+ <attribute name="GroupName">${jboss.messaging.groupname:MessagingPostOffice}</attribute>
+
<!-- Max time to wait for state to arrive when the post office joins the cluster -->
<attribute name="StateTimeout">5000</attribute>
Modified: trunk/src/etc/server/default/deploy/oracle-persistence-service.xml
===================================================================
--- trunk/src/etc/server/default/deploy/oracle-persistence-service.xml 2007-10-29 10:38:53 UTC (rev 3255)
+++ trunk/src/etc/server/default/deploy/oracle-persistence-service.xml 2007-10-29 11:44:00 UTC (rev 3256)
@@ -137,8 +137,8 @@
<!-- The JGroups group name that the post office will use -->
- <attribute name="GroupName">MessagingPostOffice</attribute>
-
+ <attribute name="GroupName">${jboss.messaging.groupname:MessagingPostOffice}</attribute>
+
<!-- Max time to wait for state to arrive when the post office joins the cluster -->
<attribute name="StateTimeout">5000</attribute>
Modified: trunk/src/etc/server/default/deploy/postgresql-persistence-service.xml
===================================================================
--- trunk/src/etc/server/default/deploy/postgresql-persistence-service.xml 2007-10-29 10:38:53 UTC (rev 3255)
+++ trunk/src/etc/server/default/deploy/postgresql-persistence-service.xml 2007-10-29 11:44:00 UTC (rev 3256)
@@ -134,7 +134,7 @@
<!-- The JGroups group name that the post office will use -->
- <attribute name="GroupName">MessagingPostOffice</attribute>
+ <attribute name="GroupName">${jboss.messaging.groupname:MessagingPostOffice}</attribute>
<!-- Max time to wait for state to arrive when the post office joins the cluster -->
Modified: trunk/src/etc/server/default/deploy/sybase-persistence-service.xml
===================================================================
--- trunk/src/etc/server/default/deploy/sybase-persistence-service.xml 2007-10-29 10:38:53 UTC (rev 3255)
+++ trunk/src/etc/server/default/deploy/sybase-persistence-service.xml 2007-10-29 11:44:00 UTC (rev 3256)
@@ -139,8 +139,8 @@
<!-- The JGroups group name that the post office will use -->
- <attribute name="GroupName">MessagingPostOffice</attribute>
-
+ <attribute name="GroupName">${jboss.messaging.groupname:MessagingPostOffice}</attribute>
+
<!-- Max time to wait for state to arrive when the post office joins the cluster -->
<attribute name="StateTimeout">5000</attribute>
Modified: trunk/src/main/org/jboss/messaging/util/XMLUtil.java
===================================================================
--- trunk/src/main/org/jboss/messaging/util/XMLUtil.java 2007-10-29 10:38:53 UTC (rev 3255)
+++ trunk/src/main/org/jboss/messaging/util/XMLUtil.java 2007-10-29 11:44:00 UTC (rev 3256)
@@ -50,12 +50,29 @@
public static Element readerToElement(Reader r) throws Exception
{
+ //Read into string
+ StringBuffer buff = new StringBuffer();
+ int c;
+ while ((c = r.read()) != -1)
+ {
+ buff.append((char)c);
+ }
+
+ //Quick hardcoded replace, TODO this can be done better
+ String s = buff.toString();
+
+ s = doReplace(s, "jboss.messaging.groupname", "MessagingPostOffice");
+ s = doReplace(s, "jboss.messaging.datachanneludpport", "45567");
+ s = doReplace(s, "jboss.messaging.controlchanneludpport", "45568");
+
+ StringReader sreader = new StringReader(s);
+
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder parser = factory.newDocumentBuilder();
- Document doc = parser.parse(new InputSource(r));
+ Document doc = parser.parse(new InputSource(sreader));
return doc.getDocumentElement();
}
-
+
public static String elementToString(Node n)
{
@@ -362,6 +379,17 @@
}
return nodes;
}
+
+ //Quick dirty replace - use a reg exp to use true default value
+ private static String doReplace(String s, String propertyName, String defaultValue)
+ {
+ String sysProp = System.getProperty(propertyName);
+
+ s = s.replace("${" + propertyName + ":" + defaultValue + "}", sysProp == null ? defaultValue : sysProp);
+
+ return s;
+ }
+
// Inner classes --------------------------------------------------------------------------------
}
Modified: trunk/tests/build.xml
===================================================================
--- trunk/tests/build.xml 2007-10-29 10:38:53 UTC (rev 3255)
+++ trunk/tests/build.xml 2007-10-29 11:44:00 UTC (rev 3256)
@@ -52,6 +52,9 @@
<property name="build.tests.remote" value="false"/>
<property name="test.bind.address" value="localhost"/>
+ <property name="jboss.messaging.groupname" value="MessagingPostOffice"/>
+ <property name="jboss.messaging.datachanneludpport" value="45567"/>
+ <property name="jboss.messaging.controlchanneludpport" value="45568"/>
<!--
Functional tests.
Modified: trunk/tests/src/org/jboss/test/messaging/tools/ServerManagement.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/tools/ServerManagement.java 2007-10-29 10:38:53 UTC (rev 3255)
+++ trunk/tests/src/org/jboss/test/messaging/tools/ServerManagement.java 2007-10-29 11:44:00 UTC (rev 3256)
@@ -436,18 +436,21 @@
}
String groupName = System.getProperty("jboss.messaging.groupname");
+ log.info("******* GROUP NAME IS " + groupName);
if (groupName != null)
{
sb.append("-Djboss.messaging.groupname=").append(groupName).append(' ');
}
String dataChannelUDPPort = System.getProperty("jboss.messaging.datachanneludpport");
+ log.info("*** data UDP port is " + dataChannelUDPPort);
if (dataChannelUDPPort != null)
{
sb.append("-Djboss.messaging.datachanneludpport=").append(dataChannelUDPPort).append(' ');
}
String controlChannelUDPPort = System.getProperty("jboss.messaging.controlchanneludpport");
+ log.info("*** control UDP port is " + controlChannelUDPPort);
if (controlChannelUDPPort != null)
{
sb.append("-Djboss.messaging.controlchanneludpport=").append(controlChannelUDPPort).append(' ');
More information about the jboss-cvs-commits
mailing list