SchedConfCLI extends Configured implements Tool { @VisibleForTesting void globalUpdates(String args, SchedConfUpdateInfo updateInfo) { if (args == null) { return; } HashMap<String, String> globalUpdates = new HashMap<>(); for (String globalUpdate : args.split(",")) { putKeyValuePair(globalUpdates, globalUpdate); } updateInfo.setGlobalParams(globalUpdates); } SchedConfCLI(); static void main(String[] args); @Override int run(String[] args);  }
@Test(timeout = 10000) public void testGlobalUpdate() { SchedConfUpdateInfo schedUpdateInfo = new SchedConfUpdateInfo(); cli.globalUpdates("schedKey1=schedVal1,schedKey2=schedVal2", schedUpdateInfo); Map<String, String> globalInfo = schedUpdateInfo.getGlobalParams(); assertEquals(2, globalInfo.size()); assertEquals("schedVal1", globalInfo.get("schedKey1")); assertEquals("schedVal2", globalInfo.get("schedKey2")); }