@Test public void cli() throws IOException { String p = createTestProps("port=8577","9999:other.json"); String[] data = new String[] { p,"port=8577","9999:other.json", p + ",jmx_exporter{{567:config.json}}","port=8577","567:config.json", "jmx_exporter{{567:config.json}}," + p,"port=8577","567:config.json", "jolokia{{port=1234,host=localhost}},jmx_exporter{{567:config.json}}","port=1234,host=localhost","567:config.json", "jolokia{{port=1234,host=localhost}}", "port=1234,host=localhost", null, }; for (int i = 0; i < data.length; i += 3) { AgentConfiguration config = new AgentConfiguration(agentIds,data[i]); assertEquals(data[i+1],config.getArgs("jolokia")); assertEquals(data[i+2],config.getArgs("jmx_exporter")); } }
public String getArgs(String agentId) { return arguments.getProperty(agentId); }
AgentConfiguration { public String getArgs(String agentId) { return arguments.getProperty(agentId); } }
AgentConfiguration { public String getArgs(String agentId) { return arguments.getProperty(agentId); } AgentConfiguration(Set<String> agents, String args); }
AgentConfiguration { public String getArgs(String agentId) { return arguments.getProperty(agentId); } AgentConfiguration(Set<String> agents, String args); String getArgs(String agentId); }
AgentConfiguration { public String getArgs(String agentId) { return arguments.getProperty(agentId); } AgentConfiguration(Set<String> agents, String args); String getArgs(String agentId);  }