use of org.ini4j.Profile.Section in project buck by facebook.
the class IniTest method testSecondaryLoadOverridesOriginalDefs.
@Test
public void testSecondaryLoadOverridesOriginalDefs() throws IOException {
Ini ini = new Ini();
Reader originalInput = new StringReader(Joiner.on("\n").join("[alias]", " buck = //src/com/facebook/buck/cli:cli", "[cache]", " mode = dir"));
Reader overrideInput = new StringReader(Joiner.on("\n").join("[alias]", " test_util = //test/com/facebook/buck/util:util", "[cache]", " mode ="));
ini.load(originalInput);
ini.load(overrideInput);
Section aliasSection = ini.get("alias");
assertEquals("Should be the union of the two [alias] sections.", ImmutableMap.of("buck", "//src/com/facebook/buck/cli:cli", "test_util", "//test/com/facebook/buck/util:util"), aliasSection);
Section cacheSection = ini.get("cache");
assertEquals("Values from overrideInput should supercede those from originalInput, as appropriate.", ImmutableMap.of("mode", ""), cacheSection);
}
Aggregations