Assert.assertEquals(1, s_storeCount);
manager.insertIfNotExist(domain1, "type", "metricKey", new ConfigItem());
Assert.assertEquals(1, s_storeCount);
manager.insertIfNotExist(domain2, "type", "metricKey", new ConfigItem());
Assert.assertEquals(2, s_storeCount);
manager.insertMetricItemConfig(new MetricItemConfig());
Assert.assertEquals(3, s_storeCount);
MetricItemConfig item = manager.queryMetricItemConfig(manager.buildMetricKey(domain1, "type", "metricKey"));
Assert.assertEquals(true, item != null);
manager.deleteDomainConfig(manager.buildMetricKey(domain1, "type", "metricKey"));
Assert.assertEquals(4, s_storeCount);
Assert.assertEquals(2, manager.getMetricConfig().getMetricItemConfigs().size());
HashSet<String> hashSet = new HashSet<String>();
hashSet.add(domain1);
hashSet.add(domain2);
List<MetricItemConfig> sets = manager.queryMetricItemConfigs(hashSet);
Assert.assertEquals(1, sets.size());
manager.refreshMetricConfig();
Assert.assertEquals(1, manager.getMetricConfig().getMetricItemConfigs().size());
String id = manager.buildMetricKey(item.getDomain(), item.getType(), item.getMetricKey());
item.setId(id);
Map<MetricItemConfig, Long> configs = new HashMap<MetricItemConfig, Long>();
configs.put(item, 1L);
configs.put(item, 2L);
configs.put(item, 3L);
Assert.assertEquals(3L, configs.get(item).longValue());
Assert.assertEquals(1, configs.size());
item = new MetricItemConfig();
item.setId(id);
configs.put(item, 1L);
configs.put(item, 3L);
Assert.assertEquals(3L, configs.get(item).longValue());
Assert.assertEquals(1, configs.size());
}