public HostStarter(HostInfo host) { super(); this.host = host; this.runningname = host.getName() + ":notrunning"; registerStarter(new Resolver(host.getDnsName())); }
@SuppressWarnings("unused") private void doTest(String proto, int port) throws Exception { mbi = new JrdsMBeanInfo(proto, "localhost", port); HostStarter host = new HostStarter(new HostInfo("localhost")) { public boolean isCollectRunning() { return true; } }; host.setTimeout(1); JMXConnection cnx = getCnx(proto, port); host.registerStarter(new SocketFactory()); host.registerStarter(new JmxSocketFactory()); host.registerStarter(cnx); host.configureStarters(new PropertiesManager()); host.startCollect(); Assert.assertTrue("JMX Connection failed to start", cnx.isStarted()); Assert.assertNotNull("Failed to read uptime", cnx.setUptime()); if(false) enumerate((NativeJmxSource)cnx.getConnection()); }
private HostStarter addConnection(Starter cnx) throws IOException { String truststore = getClass().getClassLoader().getResource("localhost.jks").getFile(); PropertiesManager pm = Tools.makePm(testFolder, "timeout=1", "collectorThreads=1", "ssl.protocol=TLS", "ssl.strict=true", "ssl.truststore=" + truststore, "ssl.trustpassword=123456"); HostStarter localhost = new HostStarter(new HostInfo("localhost")); Timer t = Tools.getDefaultTimer(); localhost.setParent(t); localhost.getHost().setHostDir(testFolder.getRoot()); t.registerStarter(new SSLStarter()); t.registerStarter(new SocketFactory()); t.configureStarters(pm); localhost.registerStarter(cnx); cnx.configure(pm); return localhost; }
p.setHost(host); p.setPd(pd); host.registerStarter(new XmlProvider()); long l; String uptimeXml;