You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by mi...@apache.org on 2008/10/10 18:42:31 UTC
svn commit: r703518 - in /ode/branches/APACHE_ODE_1.X/utils/src:
main/java/org/apache/ode/utils/HierarchicalProperties.java
test/java/org/apache/ode/utils/HierarchicalPropertiesTest.java
Author: midon
Date: Fri Oct 10 09:42:31 2008
New Revision: 703518
URL: http://svn.apache.org/viewvc?rev=703518&view=rev
Log:
Fix a test: HierarchicalProperties does not order the files anymore.
It's the caller's responsability now.
Modified:
ode/branches/APACHE_ODE_1.X/utils/src/main/java/org/apache/ode/utils/HierarchicalProperties.java
ode/branches/APACHE_ODE_1.X/utils/src/test/java/org/apache/ode/utils/HierarchicalPropertiesTest.java
Modified: ode/branches/APACHE_ODE_1.X/utils/src/main/java/org/apache/ode/utils/HierarchicalProperties.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/utils/src/main/java/org/apache/ode/utils/HierarchicalProperties.java?rev=703518&r1=703517&r2=703518&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/utils/src/main/java/org/apache/ode/utils/HierarchicalProperties.java (original)
+++ ode/branches/APACHE_ODE_1.X/utils/src/main/java/org/apache/ode/utils/HierarchicalProperties.java Fri Oct 10 09:42:31 2008
@@ -108,7 +108,7 @@
/**
* @param files the property file to be loaded. The file may not exist.
- * But if the file exists it has to be a file (not a directory), otherwhise an IOException is thrown.
+ * But if the file exists it has to be a file (not a directory), otherwhise an IOException is thrown. Files will be loaded in the given order.
* @param prefix the property prefix
* @throws IOException
*/
@@ -149,7 +149,7 @@
for (File file : files) loadFile(file);
}
- protected void loadFile(File file) throws IOException {
+ public void loadFile(File file) throws IOException {
if (!file.exists()) {
if (log.isDebugEnabled()) log.debug("File does not exist [" + file + "]");
return;
Modified: ode/branches/APACHE_ODE_1.X/utils/src/test/java/org/apache/ode/utils/HierarchicalPropertiesTest.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/utils/src/test/java/org/apache/ode/utils/HierarchicalPropertiesTest.java?rev=703518&r1=703517&r2=703518&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/utils/src/test/java/org/apache/ode/utils/HierarchicalPropertiesTest.java (original)
+++ ode/branches/APACHE_ODE_1.X/utils/src/test/java/org/apache/ode/utils/HierarchicalPropertiesTest.java Fri Oct 10 09:42:31 2008
@@ -48,7 +48,7 @@
assertEquals(msg, "40000", hp.getProperty("http://foo.com", "film-service", "timeout"));
assertEquals(msg, "hi!", hp.getProperty("http://hello.com", "a_service", "worldproperty"));
assertEquals(msg, "4", hp.getProperty("a_namespace_with_no_alias", "a_service", "poolsize"));
- assertEquals("If the same property is set by two different files, the order of precedence should be the alphabetical order.", "60000", hp.getProperty("http://foo.com", "film-service", "port-of-cannes", "timeout"));
+ assertEquals("If the same property is set by two different files, the last loaded file must take precedence", "50000", hp.getProperty("http://foo.com", "film-service", "port-of-cannes", "timeout"));
assertEquals("The prefix could be use without interfering", "so green or red?", hp.getProperty("ode.a.property.beginning.with.the.prefix.but.no.service"));
}