You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by oh...@apache.org on 2010/03/13 22:03:43 UTC
svn commit: r922677 - in /commons/proper/configuration/trunk:
src/test/org/apache/commons/configuration/TestPropertiesConfiguration.java
xdocs/changes.xml
Author: oheger
Date: Sat Mar 13 21:03:42 2010
New Revision: 922677
URL: http://svn.apache.org/viewvc?rev=922677&view=rev
Log:
CONFIGURATION-408: Added a unit test to ensure that with commons-lang 2.5 the escaping problem does not occur.
Modified:
commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestPropertiesConfiguration.java
commons/proper/configuration/trunk/xdocs/changes.xml
Modified: commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestPropertiesConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestPropertiesConfiguration.java?rev=922677&r1=922676&r2=922677&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestPropertiesConfiguration.java (original)
+++ commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestPropertiesConfiguration.java Sat Mar 13 21:03:42 2010
@@ -980,6 +980,20 @@ public class TestPropertiesConfiguration
}
/**
+ * Tests whether properties with slashes in their values can be saved. This
+ * test is related to CONFIGURATION-408.
+ */
+ public void testSlashEscaping() throws ConfigurationException
+ {
+ conf.setProperty(PROP_NAME, "http://www.apache.org");
+ StringWriter writer = new StringWriter();
+ conf.save(writer);
+ String s = writer.toString();
+ assertTrue("Value not found: " + s, s.indexOf(PROP_NAME
+ + " = http://www.apache.org") >= 0);
+ }
+
+ /**
* Creates a configuration that can be used for testing copy operations.
*
* @return the configuration to be copied
Modified: commons/proper/configuration/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/xdocs/changes.xml?rev=922677&r1=922676&r2=922677&view=diff
==============================================================================
--- commons/proper/configuration/trunk/xdocs/changes.xml (original)
+++ commons/proper/configuration/trunk/xdocs/changes.xml Sat Mar 13 21:03:42 2010
@@ -27,6 +27,11 @@
HierarchicalINIConfiguration now correctly saves sections whose name
contains delimiter characters.
</action>
+ <action dev="oheger" type="update" issue="CONFIGURATION-408">
+ PropertiesConfiguration.save() escaped slashes in properties values.
+ This was caused by a bug in commons-lang 2.4. Updating to the new
+ version commons-lang 2.5 fixed this problem.
+ </action>
<action dev="oheger" type="fix" issue="CONFIGURATION-407">
Fixed a potential IllegalStateException in HierarchicalINIConfiguration
that can be thrown when the global section is requested concurrently.