// bulk set
@SuppressWarnings("serial")
@Test
public void testBulkSet() throws IOException {
FlowConfigManager fcm = createSimple();
Map<String, FlumeConfigData> configs = new HashMap<String, FlumeConfigData>() {
{
put("node1", new FlumeConfigData(1, "null", "null", 1, 1, "flow1"));
put("node21", new FlumeConfigData(1, "null", "null", 1, 1, "flow2"));
put("node22", new FlumeConfigData(1, "null", "null", 1, 1, "flow2"));
put("node31", new FlumeConfigData(1, "null", "null", 1, 1, "flow3"));
put("node32", new FlumeConfigData(1, "null", "null", 1, 1, "flow3"));
put("node33", new FlumeConfigData(1, "null", "null", 1, 1, "flow3"));
}
};
fcm.setBulkConfig(configs);
assertEquals(1, fcm.getConfigManForFlow("flow1").getAllConfigs().size());
assertEquals(2, fcm.getConfigManForFlow("flow2").getAllConfigs().size());
assertEquals(3, fcm.getConfigManForFlow("flow3").getAllConfigs().size());
assertEquals(6, fcm.getAllConfigs().size());
assertEquals(6, fcm.getTranslatedConfigs().size());
assertEquals("flow1", fcm.getFlowId("node1"));
assertEquals("flow2", fcm.getFlowId("node21"));
assertEquals("flow2", fcm.getFlowId("node22"));
assertEquals("flow3", fcm.getFlowId("node31"));
assertEquals("flow3", fcm.getFlowId("node32"));
assertEquals("flow3", fcm.getFlowId("node33"));
}