results = config.getAll(); } else { results = config.getAllGlobal(); if (scope == ConfigScope.DEFAULT) { try {
results = config.getAll(); } else { results = config.getAllGlobal(); if (scope == ConfigScope.DEFAULT) { try {
@Test public void testGetAllGlobal() { // Test integer and string config.putGlobal("section1.int", 1); config.putGlobal("section1.subsection.string", "2"); config.putGlobal("section1.subsection.subsub.int", 1); config.putGlobal("section2.int", 3); config.putGlobal("section2.subsection.string", "4"); Map<String, String> all = config.getAllGlobal(); Map<String, String> expected = ImmutableMap.of("section1.int", "1", "section1.subsection.string", "2", "section1.subsection.subsub.int", "1", "section2.int", "3", "section2.subsection.string", "4"); assertEquals(expected, all); }
@Test public void testGetAllGlobal() { // Test integer and string config.putGlobal("section1.int", 1); config.putGlobal("section1.subsection.string", "2"); config.putGlobal("section1.subsection.subsub.int", 1); config.putGlobal("section2.int", 3); config.putGlobal("section2.subsection.string", "4"); Map<String, String> all = config.getAllGlobal(); Map<String, String> expected = ImmutableMap.of("section1.int", "1", "section1.subsection.string", "2", "section1.subsection.subsub.int", "1", "section2.int", "3", "section2.subsection.string", "4"); assertEquals(expected, all); }