public void start() throws Exception { _component.getServers().add(Protocol.HTTP, _config.getManagerPort()); _component.getClients().add(Protocol.FILE); _component.getClients().add(Protocol.JAR); Context applicationContext = _component.getContext().createChildContext(); LOGGER.info("Injecting conf and helix to the api context"); applicationContext.getAttributes().put(ManagerConf.class.toString(), _config); applicationContext.getAttributes().put(ControllerHelixManager.class.toString(), _controllerHelixManager); applicationContext.getAttributes() .put(SourceKafkaClusterValidationManager.class.toString(), _srcKafkaValidationManager); Application managerRestApp = new ManagerRestApplication(null); managerRestApp.setContext(applicationContext); _component.getDefaultHost().attach(managerRestApp); try { LOGGER.info("Starting helix manager"); _controllerHelixManager.start(); LOGGER.info("Starting source kafka cluster validation manager"); _srcKafkaValidationManager.start(); LOGGER.info("Starting API component"); _component.start(); } catch (final Exception e) { LOGGER.error("Caught exception while starting uReplicator-Manager", e); throw e; } }
Assert.assertTrue(conf.getDestinationClusters().isEmpty()); Assert.assertEquals(conf.getManagerZkStr(), "localhost:2181/test"); Assert.assertEquals(conf.getManagerPort().toString(), "9090"); Assert.assertEquals(conf.getManagerDeployment(), "testing"); Assert.assertEquals(conf.getManagerInstanceId(), InetAddress.getLocalHost().getHostName());
Assert.assertEquals(conf.getDestinationClusters(), ret2); Assert.assertEquals(conf.getManagerZkStr(), "localhost:2181/test"); Assert.assertEquals(conf.getManagerPort().toString(), "9090"); Assert.assertEquals(conf.getManagerDeployment(), "testing"); Assert.assertEquals(conf.getManagerInstanceId(), "instance0");