Package org.rhq.core.domain.alert

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


        check(AlertI18NResourceKeys.ALERT_AVAILABILITY_GOES_UNKNOWN_SHORT);

    }

    public void testPrettyPrintAVAILABILITY_DURATION() {
        AlertCondition condition = createCondition(AlertConditionCategory.AVAIL_DURATION,
            AlertConditionOperator.AVAIL_DURATION_DOWN.name(), null, null, "120", null);
        pretty = getPrettyAlertConditionString(condition);
        assert "Availability stays DOWN [2m]".equals(pretty) : pretty;
        pretty = getShortPrettyAlertConditionString(condition);
        assert "Avail stays DOWN [2m]".equals(pretty) : pretty;
View Full Code Here


        assert "Avail stays NOT UP [2m]".equals(pretty) : pretty;
    }

    public void testPrettyPrintTHRESHOLD() {
        MeasurementDefinition md = createDynamicMeasurementDefinition();
        AlertCondition condition = createCondition(AlertConditionCategory.THRESHOLD, md.getDisplayName(), ">", 12.5d,
            null, md);
        pretty = getPrettyAlertConditionString(condition);
        String ref = String.format("Foo Prop > %2.1fB", 12.5d);
        assert ref.equals(pretty) : pretty;
        pretty = getShortPrettyAlertConditionString(condition);
View Full Code Here

    public void testPrettyPrintTHRESHOLD_Calltime() {
        MeasurementDefinition md = createCalltimeMeasurementDefinition();
        String regex = "some.*(reg)?ex$"; // this is the "name" of the condition

        AlertCondition condition = createCondition(AlertConditionCategory.THRESHOLD, regex, ">", 12.5d, "MAX", md);
        pretty = getPrettyAlertConditionString(condition);
        check(AlertI18NResourceKeys.ALERT_METRIC_CALLTIME_THRESHOLD_WITH_EXPR, "CT Prop", "MAX", ">", TWELVE_DOT_5_B,
            regex);
        pretty = getShortPrettyAlertConditionString(condition);
        check(AlertI18NResourceKeys.ALERT_METRIC_CALLTIME_THRESHOLD_WITH_EXPR_SHORT, "CT Prop", "MAX", ">",
View Full Code Here

        check(AlertI18NResourceKeys.ALERT_METRIC_CALLTIME_THRESHOLD_SHORT, "CT Prop", "MAX", ">", TWELVE_DOT_5_B);
    }

    public void testPrettyPrintBASELINE() {
        MeasurementDefinition md = createDynamicMeasurementDefinition();
        AlertCondition condition = createCondition(AlertConditionCategory.BASELINE, md.getDisplayName(), ">", 0.10d,
            "mean", md);
        pretty = getPrettyAlertConditionString(condition);
        check(AlertI18NResourceKeys.ALERT_BASELINE_MEAN, "Foo Prop", ">", TEN_PERCENT);
        pretty = getShortPrettyAlertConditionString(condition);
        check(AlertI18NResourceKeys.ALERT_BASELINE_MEAN_SHORT, "Foo Prop", ">", TEN_PERCENT);
View Full Code Here

        check(AlertI18NResourceKeys.ALERT_BASELINE_MAX_SHORT, "Foo Prop", ">", TEN_PERCENT);
    }

    public void testPrettyPrintCHANGE() {
        MeasurementDefinition md = createDynamicMeasurementDefinition();
        AlertCondition condition = createCondition(AlertConditionCategory.CHANGE, md.getDisplayName(), null, null,
            null, md);
        pretty = getPrettyAlertConditionString(condition);
        check(AlertI18NResourceKeys.ALERT_METRIC_CHANGED, "Foo Prop");
        pretty = getShortPrettyAlertConditionString(condition);
        check(AlertI18NResourceKeys.ALERT_METRIC_CHANGED_SHORT, "Foo Prop");
View Full Code Here

    public void testPrettyPrintCHANGE_Calltime() {
        MeasurementDefinition md = createCalltimeMeasurementDefinition();
        String regex = "some.*(reg)?ex$"; // this is the "name" of the condition

        AlertCondition condition = createCondition(AlertConditionCategory.CHANGE, regex, "LO", 0.10d, "MIN", md);
        pretty = getPrettyAlertConditionString(condition);
        String msg = AlertI18NFactory.getMessage(AlertI18NResourceKeys.ALERT_METRIC_CALLTIME_CHANGE_SHRINKS);
        String ref = "Calltime Metric CT Prop MIN %s by at least %2.1f%% with calltime destination matching \"some.*(reg)?ex$\"";
        String refs = "CT Prop MIN %s by %2.1f%% matching \"some.*(reg)?ex$\"";
        assert String.format(ref, msg, 10.0f).equals(pretty) : pretty;
View Full Code Here

        assert String.format(refs, msg, 10.0f).equals(pretty) : pretty + " \n<=> " + String.format(refs, msg, 10.0f);
    }

    public void testPrettyPrintTRAIT() {
        MeasurementDefinition md = createTraitMeasurementDefinition();
        AlertCondition condition = createCondition(AlertConditionCategory.TRAIT, md.getDisplayName(), null, null, null,
            md);
        pretty = getPrettyAlertConditionString(condition);
        check(AlertI18NResourceKeys.ALERT_METRIC_CHANGED, "Blah Trait");
        pretty = getShortPrettyAlertConditionString(condition);
        check(AlertI18NResourceKeys.ALERT_METRIC_CHANGED_SHORT, "Blah Trait");
View Full Code Here

        pretty = getShortPrettyAlertConditionString(condition);
        check(AlertI18NResourceKeys.ALERT_METRIC_CHANGED_WITH_EXPR_SHORT, "Blah Trait", "RegexPattern");
    }

    public void testPrettyPrintCONTROL() {
        AlertCondition condition = createCondition(AlertConditionCategory.CONTROL, "opNameHere", null, null,
            OperationRequestStatus.FAILURE.name(), null);
        pretty = getPrettyAlertConditionString(condition);
        check(AlertI18NResourceKeys.ALERT_OPERATION, "opNameHere", "FAILURE");
        pretty = getShortPrettyAlertConditionString(condition);
        check(AlertI18NResourceKeys.ALERT_OPERATION_SHORT, "opNameHere", "FAILURE");
View Full Code Here

    }

    public void testPrettyPrintEVENT() {
        String regex = "some.*(reg)?ex$";

        AlertCondition condition = createCondition(AlertConditionCategory.EVENT, EventSeverity.WARN.name(), null, null,
            regex, null);
        pretty = getPrettyAlertConditionString(condition);
        assert ("Event With Severity [WARN] Matching Expression \"" + regex + "\"").equals(pretty) : pretty;
        pretty = getShortPrettyAlertConditionString(condition);
        assert ("[WARN] Event Matching \"" + regex + "\"").equals(pretty) : pretty;
View Full Code Here

        pretty = getShortPrettyAlertConditionString(condition);
        assert "[WARN] Event".equals(pretty) : pretty;
    }

    public void testPrettyPrintRESOURCECONFIG() {
        AlertCondition condition = createCondition(AlertConditionCategory.RESOURCE_CONFIG, null, null, null, null, null);
        pretty = getPrettyAlertConditionString(condition);
        assert "Resource Configuration Changed".equals(pretty) : pretty;
        pretty = getShortPrettyAlertConditionString(condition);
        assert "Res Config Chg".equals(pretty) : pretty;
    }
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.alert.AlertCondition

Copyright © 2018 www.massapicom. 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.