@Test public void testRemoveNotDefaultValue() throws Exception { Configurable conf = DummyConfigurable.getInstance(); ConfigurationManager manager = ConfigurationManager.getInstance(); conf.setProperty("hhh", "iii"); manager.store(conf); Properties props = new Properties(); props.load(new FileInputStream(configFile)); assertEquals("The stored file should contain the new entry","iii",props.get("hhh")); conf.deleteProperty("hhh"); manager.store(conf); manager.populate(conf); assertNull("The removed value should no longer exist",conf.getProperty("hhh")); props.clear(); props.load(new FileInputStream(configFile)); assertNull("The stored file should no longer contain the deleted entry",props.get("hhh")); }
@Test public void testRemoveNotDefaultValue() throws Exception { Configurable conf = DummyConfigurable.getInstance(); ConfigurationManager manager = ConfigurationManager.getInstance(); conf.setProperty("hhh", "iii"); manager.store(conf); Properties props = new Properties(); props.load(new FileInputStream(configFile)); assertEquals("The stored file should contain the new entry","iii",props.get("hhh")); conf.deleteProperty("hhh"); manager.store(conf); manager.populate(conf); assertNull("The removed value should no longer exist",conf.getProperty("hhh")); props.clear(); props.load(new FileInputStream(configFile)); assertNull("The stored file should no longer contain the deleted entry",props.get("hhh")); }