public FlowRunnerImpl(HubConfig hubConfig) { this.hubConfig = hubConfig; this.stagingClient = hubConfig.newStagingClient(); this.destinationDatabase = hubConfig.getDbName(DatabaseKind.FINAL); }
@Test public void testHubInfo() { HubConfig config = getHubFlowRunnerConfig(); ObjectMapper objmapper = new ObjectMapper(); try { JsonNode jsonNode = objmapper.readTree(config.getInfo()); assertEquals(jsonNode.get("stagingDbName").asText(), config.getDbName(DatabaseKind.STAGING)); assertEquals(jsonNode.get("stagingHttpName").asText(), config.getHttpName(DatabaseKind.STAGING)); assertEquals(jsonNode.get("finalForestsPerHost").asInt(), (int) config.getForestsPerHost(DatabaseKind.FINAL)); assertEquals(jsonNode.get("finalPort").asInt(), (int) config.getPort(DatabaseKind.FINAL)); } catch (Exception e) { throw new DataHubConfigurationException("Your datahub configuration could not serialize"); } } }
assertEquals(config.getDbName(DatabaseKind.STAGING), props.getProperty("mlStagingDbName")); assertEquals(config.getForestsPerHost(DatabaseKind.STAGING).toString(), props.getProperty("mlStagingForestsPerHost")); assertEquals(config.getDbName(DatabaseKind.FINAL), props.getProperty("mlFinalDbName")); assertEquals(config.getForestsPerHost(DatabaseKind.FINAL).toString(), props.getProperty("mlFinalForestsPerHost")); assertEquals(config.getDbName(DatabaseKind.JOB), props.getProperty("mlJobDbName")); assertEquals(config.getForestsPerHost(DatabaseKind.JOB).toString(), props.getProperty("mlJobForestsPerHost")); assertEquals(config.getDbName(DatabaseKind.MODULES), props.getProperty("mlModulesDbName")); assertEquals(config.getForestsPerHost(DatabaseKind.MODULES).toString(), props.getProperty("mlModulesForestsPerHost")); assertEquals(config.getDbName(DatabaseKind.STAGING_TRIGGERS), props.getProperty("mlStagingTriggersDbName")); assertEquals(config.getForestsPerHost(DatabaseKind.STAGING_TRIGGERS).toString(), props.getProperty("mlStagingTriggersForestsPerHost")); assertEquals(config.getDbName(DatabaseKind.STAGING_SCHEMAS), props.getProperty("mlStagingSchemasDbName")); assertEquals(config.getForestsPerHost(DatabaseKind.STAGING_SCHEMAS).toString(), props.getProperty("mlStagingSchemasForestsPerHost"));