assertNotNull(file);
assertEquals(true, file.exists());
try {
XMLFileHandler handler = new XMLFileHandler();
handler.setFile(file);
Configuration config = handler.load("test");
assertNotNull(config);
String test = config.getProperty("USER",null,"JDBC");
assertEquals("dice",test);
assertEquals("10000",config.getProperty("maxNumber",null,"VariableTest"));
assertEquals(10000L,config.getLongProperty("maxNumber",-1,"VariableTest"));
String val = config.getProperty("varprop1",null,"includeTest");
assertNotNull(val);
assertEquals("value1",val);
handler.setEncoding("ISO-8859-1");
config.setProperty("PWD","for me","JDBC");
handler.store(config);
config = handler.load("test");
assertNotNull(config);
assertEquals("developer",config.getVariable("user.name"));
}
catch (Exception e) {
e.printStackTrace();
fail("unexpected exception");
}