* is disabled
*/
@Test
public void testSaveWithDelimiterParsingDisabled() throws ConfigurationException {
XMLConfiguration conf = new XMLConfiguration();
conf.setExpressionEngine(new XPathExpressionEngine());
conf.setDelimiterParsingDisabled(true);
conf.setAttributeSplittingDisabled(true);
conf.setFile(new File(testProperties));
conf.load();
assertEquals("a,b,c", conf.getString("split/list3/@values"));
assertEquals(0, conf.getMaxIndex("split/list3/@values"));
assertEquals("a\\,b\\,c", conf.getString("split/list4/@values"));
assertEquals("a,b,c", conf.getString("split/list1"));
assertEquals(0, conf.getMaxIndex("split/list1"));
assertEquals("a\\,b\\,c", conf.getString("split/list2"));
// save the configuration
conf.save(testSaveConf.getAbsolutePath());
// read the configuration and compare the properties
XMLConfiguration checkConfig = new XMLConfiguration();
checkConfig.setFileName(testSaveConf.getAbsolutePath());
checkSavedConfig(checkConfig);
XMLConfiguration config = new XMLConfiguration();
config.setFileName(testFile2);
//config.setExpressionEngine(new XPathExpressionEngine());
config.setDelimiterParsingDisabled(true);
config.setAttributeSplittingDisabled(true);
config.load();
config.setProperty("Employee[@attr1]", "3,2,1");
assertEquals("3,2,1", config.getString("Employee[@attr1]"));
config.save(testSaveFile.getAbsolutePath());
config = new XMLConfiguration();
config.setFileName(testSaveFile.getAbsolutePath());
//config.setExpressionEngine(new XPathExpressionEngine());
config.setDelimiterParsingDisabled(true);
config.setAttributeSplittingDisabled(true);
config.load();
config.setProperty("Employee[@attr1]", "1,2,3");
assertEquals("1,2,3", config.getString("Employee[@attr1]"));
config.setProperty("Employee[@attr2]", "one, two, three");
assertEquals("one, two, three", config.getString("Employee[@attr2]"));
config.setProperty("Employee.text", "a,b,d");
assertEquals("a,b,d", config.getString("Employee.text"));
config.setProperty("Employee.Salary", "100,000");
assertEquals("100,000", config.getString("Employee.Salary"));
config.save(testSaveFile.getAbsolutePath());
checkConfig = new XMLConfiguration();
checkConfig.setFileName(testSaveFile.getAbsolutePath());
checkConfig.setExpressionEngine(new XPathExpressionEngine());
checkConfig.setDelimiterParsingDisabled(true);
checkConfig.setAttributeSplittingDisabled(true);
checkConfig.load();
assertEquals("1,2,3", checkConfig.getString("Employee/@attr1"));
assertEquals("one, two, three", checkConfig.getString("Employee/@attr2"));