|
@@ -1875,7 +1875,7 @@ public class AmbariMetaInfoTest {
|
|
|
|
|
|
AlertDefinitionDAO dao = injector.getInstance(AlertDefinitionDAO.class);
|
|
AlertDefinitionDAO dao = injector.getInstance(AlertDefinitionDAO.class);
|
|
List<AlertDefinitionEntity> definitions = dao.findAll(clusterId);
|
|
List<AlertDefinitionEntity> definitions = dao.findAll(clusterId);
|
|
- assertEquals(10, definitions.size());
|
|
|
|
|
|
+ assertEquals(11, definitions.size());
|
|
|
|
|
|
// figure out how many of these alerts were merged into from the
|
|
// figure out how many of these alerts were merged into from the
|
|
// non-stack alerts.json
|
|
// non-stack alerts.json
|
|
@@ -1887,7 +1887,7 @@ public class AmbariMetaInfoTest {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- assertEquals(1, hostAlertCount);
|
|
|
|
|
|
+ assertEquals(2, hostAlertCount);
|
|
assertEquals(9, definitions.size() - hostAlertCount);
|
|
assertEquals(9, definitions.size() - hostAlertCount);
|
|
|
|
|
|
for (AlertDefinitionEntity definition : definitions) {
|
|
for (AlertDefinitionEntity definition : definitions) {
|
|
@@ -1898,7 +1898,7 @@ public class AmbariMetaInfoTest {
|
|
metaInfo.reconcileAlertDefinitions(clusters);
|
|
metaInfo.reconcileAlertDefinitions(clusters);
|
|
|
|
|
|
definitions = dao.findAll();
|
|
definitions = dao.findAll();
|
|
- assertEquals(10, definitions.size());
|
|
|
|
|
|
+ assertEquals(11, definitions.size());
|
|
|
|
|
|
for (AlertDefinitionEntity definition : definitions) {
|
|
for (AlertDefinitionEntity definition : definitions) {
|
|
assertEquals(28, definition.getScheduleInterval().intValue());
|
|
assertEquals(28, definition.getScheduleInterval().intValue());
|
|
@@ -1907,7 +1907,7 @@ public class AmbariMetaInfoTest {
|
|
// find all enabled for the cluster should find 6 (the ones from HDFS;
|
|
// find all enabled for the cluster should find 6 (the ones from HDFS;
|
|
// it will not find the agent alert since it's not bound to the cluster)
|
|
// it will not find the agent alert since it's not bound to the cluster)
|
|
definitions = dao.findAllEnabled(cluster.getClusterId());
|
|
definitions = dao.findAllEnabled(cluster.getClusterId());
|
|
- assertEquals(9, definitions.size());
|
|
|
|
|
|
+ assertEquals(10, definitions.size());
|
|
|
|
|
|
// create new definition
|
|
// create new definition
|
|
AlertDefinitionEntity entity = new AlertDefinitionEntity();
|
|
AlertDefinitionEntity entity = new AlertDefinitionEntity();
|
|
@@ -1926,19 +1926,19 @@ public class AmbariMetaInfoTest {
|
|
|
|
|
|
// verify the new definition is found (6 HDFS + 1 new one)
|
|
// verify the new definition is found (6 HDFS + 1 new one)
|
|
definitions = dao.findAllEnabled(cluster.getClusterId());
|
|
definitions = dao.findAllEnabled(cluster.getClusterId());
|
|
- assertEquals(10, definitions.size());
|
|
|
|
|
|
+ assertEquals(11, definitions.size());
|
|
|
|
|
|
// reconcile, which should disable our bad definition
|
|
// reconcile, which should disable our bad definition
|
|
metaInfo.reconcileAlertDefinitions(clusters);
|
|
metaInfo.reconcileAlertDefinitions(clusters);
|
|
|
|
|
|
// find all enabled for the cluster should find 6
|
|
// find all enabled for the cluster should find 6
|
|
definitions = dao.findAllEnabled(cluster.getClusterId());
|
|
definitions = dao.findAllEnabled(cluster.getClusterId());
|
|
- assertEquals(9, definitions.size());
|
|
|
|
|
|
+ assertEquals(10, definitions.size());
|
|
|
|
|
|
// find all should find 6 HDFS + 1 disabled + 1 agent alert + 2 server
|
|
// find all should find 6 HDFS + 1 disabled + 1 agent alert + 2 server
|
|
// alerts
|
|
// alerts
|
|
definitions = dao.findAll();
|
|
definitions = dao.findAll();
|
|
- assertEquals(11, definitions.size());
|
|
|
|
|
|
+ assertEquals(12, definitions.size());
|
|
|
|
|
|
entity = dao.findById(entity.getDefinitionId());
|
|
entity = dao.findById(entity.getDefinitionId());
|
|
assertFalse(entity.getEnabled());
|
|
assertFalse(entity.getEnabled());
|