for(ConnectionInfo cnx: makeConnexion(fragment, host, properties)) { host.addConnection(cnx);
ConnectedProbe cp = (ConnectedProbe) p; for(ConnectionInfo ci: makeConnexion(probeNode, p, properties)) { ci.register(p);
@Test public void testConnectionInfo() throws Exception { PropertiesManager pm = Tools.makePm(testFolder); HostBuilder hb = new HostBuilder(); hb.setPm(pm); hb.setClassLoader(this.getClass().getClassLoader()); JrdsDocument cnxdoc = new JrdsDocument(Tools.dbuilder.newDocument()); cnxdoc.doRootElement("host").addElement("connection", "type=jrds.probe.JMXConnection").addElement("attr", "name=port").setTextContent("8999"); for(ConnectionInfo ci: hb.makeConnexion(cnxdoc.getRootElement(), new HostInfo("localhost"), new HashMap<String, String>(0))) { logger.trace(ci.getName()); StarterNode sn = new StarterNode() {}; ci.register(sn); JMXConnection cnx = sn.find(JMXConnection.class); Assert.assertEquals("Attributed not setted", new Integer(8999), cnx.getPort()); } }