예제 #1
0
  @Test
  public void testConnectionInfo() throws Exception {
    PropertiesManager pm = Tools.makePm();

    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"))) {
      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());
    }
  }
예제 #2
0
 public void addConnection(ConnectionInfo cnx) {
   cnxList.put(cnx.getName(), cnx);
 }