Examples of AlertConditionLog


Examples of org.rhq.core.domain.alert.AlertConditionLog

        }
        assert condId > 0 : "failed to get the condition ID - something is wrong with test setup";
        AlertCondition conditionWithLogs = getAlertConditionWithLogs(condId); // should eagerly load logs
        Set<AlertConditionLog> logs = conditionWithLogs.getConditionLogs();
        assert logs != null && logs.size() > 0 : "missing condition log - we should have one that was generated";
        AlertConditionLog log = logs.iterator().next();
        assert log.getAlert() == null : "condition should not have fired an alert: " + logs;

        // purge the resource fully, which should remove all alert defs and alert conditions and condition logs
        int resourceId = resource.getId();
        deleteNewResource(resource);
        resource = null;
View Full Code Here

Examples of org.rhq.core.domain.alert.AlertConditionLog

        List<Alert> alerts = getAlerts(resourceWithSchedules.getId());
        assert alerts.size() == 1 : "1 alert should have fired: " + alerts;
        Alert alert = alerts.get(0);

        assert alert.getConditionLogs().size() == 1 : "1 condition log should exist";
        AlertConditionLog conditionLog = alert.getConditionLogs().iterator().next();
        Assert.assertEquals(conditionLog.getCondition().getId(), conditionId,
            "original condition should have been associated with the alert");

        // update a non-condition aspect of the def and then update the def
        String updatedDesc = "Updated Description";
        alertDef.setDescription(updatedDesc);
        AlertDefinition updatedAlertDef = LookupUtil.getAlertDefinitionManager().updateAlertDefinition(getOverlord(),
            alertDef.getId(), alertDef, false); // note that resetMatching is false
        assert updatedDesc.equals(updatedAlertDef.getDescription()) : "Description should be updated";
        assert updatedAlertDef.getConditions().size() == 1 : "1 alertDef condition should exist after the update";
        assert updatedAlertDef.getConditions().iterator().next().getId() == condition.getId() : "condition should not be updated";

        // get the alert again, and make sure it still has a log with the same condition
        alerts = getAlerts(resourceWithSchedules.getId());
        assert alerts.size() == 1 : "1 alert should have fired: " + alerts;
        alert = alerts.get(0);

        assert alert.getConditionLogs().size() == 1 : "1 condition log should exist after the update";
        conditionLog = alert.getConditionLogs().iterator().next();
        Assert.assertEquals(conditionLog.getCondition().getId(), conditionId,
            "original condition should still have been associated with the alert");

        // update the condition on the def and then update the def
        condition.setThreshold(41.0);
        updatedAlertDef = LookupUtil.getAlertDefinitionManager().updateAlertDefinition(getOverlord(), alertDef.getId(),
            alertDef, true); // note that resetMatching is true
        assert updatedAlertDef.getConditions().size() == 1 : "1 alertDef condition should exist after the update";
        assert updatedAlertDef.getConditions().iterator().next().getId() != condition.getId() : "condition should be updated";

        // get the alert again, and make sure it still has a log with the same condition
        alerts = getAlerts(resourceWithSchedules.getId());
        assert alerts.size() == 1 : "1 alert should have fired: " + alerts;
        alert = alerts.get(0);

        assert alert.getConditionLogs().size() == 1 : "1 condition log should exist after the update";
        conditionLog = alert.getConditionLogs().iterator().next();
        Assert.assertEquals(conditionLog.getCondition().getId(), conditionId,
            "original condition should still have been associated with the alert");
    }
View Full Code Here

Examples of org.rhq.core.domain.alert.AlertConditionLog

        Alert alert = alertHolder[0];

        assert alert.getConditionLogs().size() == 1 : "1 condition log should exist";

        AlertConditionLog conditionLog = alert.getConditionLogs().iterator().next();
        Assert.assertEquals(conditionLog.getCondition().getId(), conditionId,
            "original condition should have been associated with the alert");
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.