@Test public void testGetAllSubsectionsGlobal() { // Test integer and string config.putGlobal("section1.subsection1.int", 1); config.putGlobal("section1.subsection2.string", "2"); config.putGlobal("section1.subsection1.subsub1.int", 1); config.putGlobal("section1.subsection2.subsub2.string", "2"); config.putGlobal("section2.subsection3.int", 3); config.putGlobal("section2.subsection4.string", "4"); List<String> allSubsections = config.getAllSubsectionsGlobal("section1"); Set<String> expected = ImmutableSet.of("subsection1", "subsection2", "subsection1.subsub1", "subsection2.subsub2"); assertEquals(expected, new HashSet<String>(allSubsections)); }
@Test public void testGetAllSubsectionsGlobal() { // Test integer and string config.putGlobal("section1.subsection1.int", 1); config.putGlobal("section1.subsection2.string", "2"); config.putGlobal("section1.subsection1.subsub1.int", 1); config.putGlobal("section1.subsection2.subsub2.string", "2"); config.putGlobal("section2.subsection3.int", 3); config.putGlobal("section2.subsection4.string", "4"); List<String> allSubsections = config.getAllSubsectionsGlobal("section1"); Set<String> expected = ImmutableSet.of("subsection1", "subsection2", "subsection1.subsub1", "subsection2.subsub2"); assertEquals(expected, new HashSet<String>(allSubsections)); }