config.removeSectionGlobal(name); } else { config.removeSection(name);
config.removeSectionGlobal(name); } else { config.removeSection(name);
@Test public void testRemoveSectionGlobal() { // Test integer and string config.putGlobal("section1.int", 1); config.putGlobal("section1.subsection.string", "2"); config.putGlobal("section1.subsection.subsub.int", 1); config.putGlobal("section1.subsection.subsub.string", "4"); config.putGlobal("section2.int", 3); assertTrue(config.getGlobal("section1.subsection.subsub.string").isPresent()); assertTrue(config.getGlobal("section1.subsection.subsub.int").isPresent()); config.removeSectionGlobal("section1.subsection.subsub"); assertFalse(config.getGlobal("section1.subsection.subsub.string").isPresent()); assertFalse(config.getGlobal("section1.subsection.subsub.int").isPresent()); assertTrue(config.getGlobal("section1.int").isPresent()); config.removeSectionGlobal("section1"); assertFalse(config.getGlobal("section1.int").isPresent()); } }
@Test public void testRemoveSectionGlobal() { // Test integer and string config.putGlobal("section1.int", 1); config.putGlobal("section1.subsection.string", "2"); config.putGlobal("section1.subsection.subsub.int", 1); config.putGlobal("section1.subsection.subsub.string", "4"); config.putGlobal("section2.int", 3); assertTrue(config.getGlobal("section1.subsection.subsub.string").isPresent()); assertTrue(config.getGlobal("section1.subsection.subsub.int").isPresent()); config.removeSectionGlobal("section1.subsection.subsub"); assertFalse(config.getGlobal("section1.subsection.subsub.string").isPresent()); assertFalse(config.getGlobal("section1.subsection.subsub.int").isPresent()); assertTrue(config.getGlobal("section1.int").isPresent()); config.removeSectionGlobal("section1"); assertFalse(config.getGlobal("section1.int").isPresent()); } }