List of usage examples for org.apache.commons.configuration INIConfiguration addProperty
public void addProperty(String key, Object value)
From source file:io.datalayer.conf.IniConfigurationTest.java
/** * Test of getSections method, of class {@link INIConfiguration}. *//*w w w . j a v a 2 s . c om*/ @Test public void testGetSections() { INIConfiguration instance = new INIConfiguration(); instance.addProperty("test1.foo", "bar"); instance.addProperty("test2.foo", "abc"); Set<String> expResult = new HashSet<String>(); expResult.add("test1"); expResult.add("test2"); Set<String> result = instance.getSections(); assertEquals(expResult, result); }
From source file:io.datalayer.conf.IniConfigurationTest.java
/** * Test of save method, of class {@link INIConfiguration}. *//*from w w w. j a va 2 s . com*/ @Test public void testSave() throws Exception { Writer writer = new StringWriter(); INIConfiguration instance = new INIConfiguration(); instance.addProperty("section1.var1", "foo"); instance.addProperty("section1.var2", "451"); instance.addProperty("section2.var1", "123.45"); instance.addProperty("section2.var2", "bar"); instance.addProperty("section3.var1", "true"); instance.addProperty("section3.interpolated", "${section3.var1}"); instance.addProperty("section3.multi", "foo"); instance.addProperty("section3.multi", "bar"); instance.save(writer); assertEquals("Wrong content of ini file", INI_DATA, writer.toString()); }