commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r919845 - /commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/impl/TestINIConfigurationSource.java
Date Sat, 06 Mar 2010 20:39:12 GMT
Author: oheger
Date: Sat Mar  6 20:39:11 2010
New Revision: 919845

URL: http://svn.apache.org/viewvc?rev=919845&view=rev
Log:
CONFIGURATION-409: Added a test for INIConfigurationSource to ensure that this class is not
affected by this issue.

Modified:
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/impl/TestINIConfigurationSource.java

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/impl/TestINIConfigurationSource.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/impl/TestINIConfigurationSource.java?rev=919845&r1=919844&r2=919845&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/impl/TestINIConfigurationSource.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/impl/TestINIConfigurationSource.java
Sat Mar  6 20:39:11 2010
@@ -656,4 +656,29 @@
                 source2);
         checkContent(config);
     }
+
+    /**
+     * Tests whether section keys with delimiters in their names cause problems.
+     * This test is related to CONFIGURATION-409.
+     */
+    @Test
+    public void testSaveKeysWithDelimiters() throws IOException,
+            ConfigurationException
+    {
+        Configuration<ConfigurationNode> conf = new ConfigurationImpl<ConfigurationNode>(
+                source);
+        final String section = "Section..with..dots";
+        conf.addProperty(section + ".test1", "test1");
+        conf.addProperty(section + ".test2", "test2");
+        StringWriter writer = new StringWriter();
+        source.save(writer);
+        StringReader reader = new StringReader(writer.toString());
+        source = new INIConfigurationSource();
+        source.load(reader);
+        conf = new ConfigurationImpl<ConfigurationNode>(source);
+        assertEquals("Wrong value (1)", "test1", conf.getString(section
+                + ".test1"));
+        assertEquals("Wrong value (2)", "test2", conf.getString(section
+                + ".test2"));
+    }
 }



Mime
View raw message