Package org.rhq.modules.integrationTests.restApi.d

Examples of org.rhq.modules.integrationTests.restApi.d.AlertCondition


        int definitionId = createEmptyAlertDefinition(false);

        // Now add a condition
        try {

            AlertCondition alertCondition = new AlertCondition("CONTROL", "LA_LA");
            given()
                .header(acceptJson)
                .contentType(ContentType.JSON)
                .body(alertCondition)
                .pathParam("defId", definitionId)
View Full Code Here


        int definitionId = createEmptyAlertDefinition(false);

        // Now add a condition
        try {

            AlertCondition alertCondition = new AlertCondition("OOPS", "CHANGES");
            given()
                .header(acceptJson)
                .contentType(ContentType.JSON)
                .body(alertCondition)
                .pathParam("defId",definitionId)
View Full Code Here

        int definitionId = createEmptyAlertDefinition(false);


        try {
            // Now add a 1st condition
            AlertCondition alertCondition = new AlertCondition("AVAILABILITY", "AVAIL_GOES_UP");
            addConditionToDefinition(definitionId, alertCondition);

            // Retrieve the definition with the added condition
            AlertDefinition updatedDefinition =
            given()
                .pathParam("id",definitionId)
                .queryParam("full",true)
            .expect()
                .statusCode(200)
                .log().everything()
            .when()
                .get("/alert/definition/{id}")
                .as(AlertDefinition.class);

            int size = updatedDefinition.getConditions().size();
            assert size ==1 : "Did not find 1 condition, but " + size;

            // Now add a 2nd condition
            AlertCondition secondCondition = new AlertCondition("AVAILABILITY", "AVAIL_GOES_DOWN");
            addConditionToDefinition(definitionId, secondCondition);

            // Retrieve the definition with the added condition
            updatedDefinition =
            given()
View Full Code Here

    public void testCreateUpdateConditionWithBadMetricDefinition() throws Exception {

        int definitionId = createEmptyAlertDefinition(false);

        try {
            AlertCondition condition = new AlertCondition("THRESHOLD", "LESS_THAN");
            condition.setOption("12345");
            condition.setComparator(">");
            condition.setMeasurementDefinition(10173);

            given()
                .header(acceptJson)
                .contentType(ContentType.JSON)
                .body(condition)
View Full Code Here


        // Now add a condition
        try {

            AlertCondition condition = new AlertCondition("THRESHOLD", "LESS_THAN");
            condition.setOption("12345");
            condition.setComparator(">");
            condition.setMeasurementDefinition(metricDefinitionId);

            Integer cid =
            given()
                .header(acceptJson)
                .contentType(ContentType.JSON)
                .body(condition)
                .pathParam("defId", definitionId)
            .expect()
                .statusCode(201)
                .log().ifError()
                .body("option",is("12345"))
                .body("comparator",is(">"))
            .when()
                .post("/alert/definition/{defId}/conditions")
            .getBody()
                .jsonPath().get("id");

            // Update the condition
            condition.setOption("23456");
            given()
                .header(acceptJson)
                .contentType(ContentType.JSON)
                .body(condition)
                .pathParam("cid", cid)
View Full Code Here

            AlertNotification notification = new AlertNotification("Direct Emails");
            notification.getConfig().put("emailAddress","enoch@root.org");
            alertDefinition.getNotifications().add(notification);

            AlertCondition condition = new AlertCondition("AVAILABILITY", "AVAIL_GOES_DOWN");
            alertDefinition.getConditions().add(condition);

            AlertDefinition result =
            given()
                .contentType(ContentType.JSON)
View Full Code Here

            notification.getConfig().put("emailAddress","enoch@root.org");
            alertDefinition.getNotifications().add(notification);

            List<AlertCondition> conditions = alertDefinition.getConditions();

            AlertCondition condition = new AlertCondition("AVAILABILITY", "AVAIL_GOES_DOWN");
            conditions.add(condition);

            condition = new AlertCondition("AVAIL_DURATION","AVAIL_DURATION_DOWN");
            condition.setOption("300"); // seconds
            conditions.add(condition);

            AlertDefinition result =
            given()
                .contentType(ContentType.JSON)
View Full Code Here

            AlertNotification notification = new AlertNotification("Direct Emails");
            notification.getConfig().put("emailAddress","enoch@root.org");
            alertDefinition.getNotifications().add(notification);

            AlertCondition condition = new AlertCondition("AVAILABILITY", "AVAIL_GOES_DOWN");
            alertDefinition.getConditions().add(condition);

            AlertDefinition result =
            given()
                .contentType(ContentType.JSON)
View Full Code Here

        int alertId;

        // Now add a condition
        try {

            AlertCondition alertCondition = new AlertCondition("AVAILABILITY", "AVAIL_GOES_UP");
            addConditionToDefinition(definitionId, alertCondition);

            System.out.println("Definition created, waiting 60s for it to become active");

            // Wait a while - see https://bugzilla.redhat.com/show_bug.cgi?id=830299
View Full Code Here

        int definitionId = createEmptyAlertDefinition(true);

        // Now add a condition
        try {

            AlertCondition alertCondition = new AlertCondition("AVAILABILITY", "AVAIL_GOES_UP");
            addConditionToDefinition(definitionId, alertCondition);

            AlertNotification notification = new AlertNotification("Direct Emails"); // short-name from server plugin descriptor
            notification.getConfig().put("emailAddress", "root@eruditorium.org");
View Full Code Here

TOP

Related Classes of org.rhq.modules.integrationTests.restApi.d.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.