commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r820424 - /commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestDatabaseConfiguration.java
Date Wed, 30 Sep 2009 19:57:43 GMT
Author: oheger
Date: Wed Sep 30 19:57:42 2009
New Revision: 820424

URL: http://svn.apache.org/viewvc?rev=820424&view=rev
Log:
[CONFIGURATION-398] Added a unit test for DatabaseConfiguration.setProperty() with a list
of properties.

Modified:
    commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestDatabaseConfiguration.java

Modified: commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestDatabaseConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestDatabaseConfiguration.java?rev=820424&r1=820423&r2=820424&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestDatabaseConfiguration.java
(original)
+++ commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestDatabaseConfiguration.java
Wed Sep 30 19:57:42 2009
@@ -403,6 +403,19 @@
     }
 
     /**
+     * Tests setProperty() if the property value contains the list delimiter.
+     */
+    public void testSetPropertyWithDelimiter()
+    {
+        DatabaseConfiguration config = setUpMultiConfig();
+        config.setListDelimiter(';');
+        config.setProperty("keyList", "1;2;3");
+        String[] values = config.getStringArray("keyList");
+        assertEquals("Wrong number of property values", 3, values.length);
+        assertEquals("Wrong value at index 1", "2", values[1]);
+    }
+
+    /**
      * A specialized database configuration implementation that can be
      * configured to throw an exception when obtaining a connection. This way
      * database exceptions can be simulated.



Mime
View raw message