Index: config/src/main/java/org/apache/karaf/cellar/config/ConfigurationSupport.java =================================================================== --- config/src/main/java/org/apache/karaf/cellar/config/ConfigurationSupport.java (revision 1234191) +++ config/src/main/java/org/apache/karaf/cellar/config/ConfigurationSupport.java (working copy) @@ -44,8 +44,8 @@ while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); if (key != null && dictionary.get(key) != null) { - String value = (String) dictionary.get(key); - properties.put(key, dictionary.get(key)); + String value = String.valueOf(dictionary.get(key)); + properties.put(key, value); } } } @@ -65,9 +65,9 @@ while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); if (key != null && dictionary.get(key) != null) { - String value = (String) dictionary.get(key); + String value = String.valueOf(dictionary.get(key)); value = convertStrings(value, HOME, RELATIVE_HOME); - properties.put(key, dictionary.get(key)); + properties.put(key,value); } } return properties; @@ -86,9 +86,9 @@ while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); if (key != null && dictionary.get(key) != null) { - String value = (String) dictionary.get(key); + String value = String.valueOf(dictionary.get(key)); value = convertStrings(value, RELATIVE_HOME, HOME); - properties.put(key, dictionary.get(key)); + properties.put(key, value); } } return properties; @@ -115,8 +115,8 @@ Enumeration enumaration = dictionary.keys(); while (enumaration.hasMoreElements()) { String key = (String) enumaration.nextElement(); - if (!isPropertyFiltered(key)) { - String value = (String) dictionary.get(key); + if (!isPropertyFiltered(key)) { + String value = String.valueOf(dictionary.get(key)); result.put(key, value); } } Index: config/src/test/java/org/apache/karaf/cellar/config/ConfigurationSupportTest.java =================================================================== --- config/src/test/java/org/apache/karaf/cellar/config/ConfigurationSupportTest.java (revision 1234191) +++ config/src/test/java/org/apache/karaf/cellar/config/ConfigurationSupportTest.java (working copy) @@ -56,5 +56,47 @@ String result = support.convertStrings(absolutePath, home, var); Assert.assertEquals(expectedResult, result); } + + @Test + public void testPreparePull() throws Exception{ + Dictionary result = null; + Dictionary source = new Properties(); + Dictionary expectedResult = new Properties(); + source.put("key1", "value1"); + source.put("key2", 1); + source.put("key3", Boolean.FALSE); + source.put("key4", 12L); + + expectedResult.put("key1", "value1"); + expectedResult.put("key2", "1"); + expectedResult.put("key3", "false"); + expectedResult.put("key4", "12"); + + result = support.preparePull(source); + + Assert.assertEquals(expectedResult, result); + } + + @Test + public void testPreparePush() throws Exception{ + Dictionary result = null; + Dictionary source = new Properties(); + Dictionary expectedResult = new Properties(); + + source.put("key1", "value1"); + source.put("key2", 1); + source.put("key3", Boolean.FALSE); + source.put("key4", 12L); + + expectedResult.put("key1", "value1"); + expectedResult.put("key2", "1"); + expectedResult.put("key3", "false"); + expectedResult.put("key4", "12"); + + result = support.preparePush(source); + + Assert.assertEquals(expectedResult, result); + } + }