Example usage for org.apache.commons.configuration INIConfiguration setProperty

List of usage examples for org.apache.commons.configuration INIConfiguration setProperty

Introduction

In this page you can find the example usage for org.apache.commons.configuration INIConfiguration setProperty.

Prototype

public void setProperty(String key, Object value) 

Source Link

Document

Sets a new value for the specified property.

Usage

From source file:io.datalayer.conf.IniConfigurationTest.java

@Test
public void testWriteValueWithCommentChar() throws Exception {
    INIConfiguration config = new INIConfiguration();
    config.setProperty("section.key1", "1;2;3");

    StringWriter writer = new StringWriter();
    config.save(writer);// w  ww. j  a v a 2  s. c  o  m

    INIConfiguration config2 = new INIConfiguration();
    config2.load(new StringReader(writer.toString()));

    assertEquals("value", "1;2;3", config2.getString("section.key1"));
}