Skip to content

Commit

Permalink
Validate the alert definition from the response (backport from master 1…
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Nguyen committed Feb 12, 2010
1 parent 90fefde commit e5f92e0
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
Expand Up @@ -79,7 +79,7 @@ public void testValidBaselineConditon() throws Exception {
hqAssertSuccess(response);

for (AlertDefinition def : response.getAlertDefinition()) {
validateDefinition(d);
validateDefinition(def);
for (AlertCondition c : def.getAlertCondition()) {
assertNotNull("Condition was null", c);
assertEquals(c.getType(), AlertConditionType.BASELINE.getType());
Expand Down Expand Up @@ -125,7 +125,7 @@ public void testValidBaselineConditonTypeAlert() throws Exception {
hqAssertSuccess(response);

for (AlertDefinition def : response.getAlertDefinition()) {
validateDefinition(d);
validateDefinition(def);
for (AlertCondition c : def.getAlertCondition()) {
assertNotNull("Condition was null", c);
assertEquals(c.getType(), AlertConditionType.BASELINE.getType());
Expand Down
Expand Up @@ -64,7 +64,7 @@ public void testValidConfigCondition() throws Exception {
hqAssertSuccess(response);

for (AlertDefinition def : response.getAlertDefinition()) {
validateDefinition(d);
validateDefinition(def);
for (AlertCondition c : def.getAlertCondition()) {
assertNotNull("Condition was null", c);
assertEquals(c.getType(), AlertConditionType.CONFIG_CHANGE.getType());
Expand Down Expand Up @@ -95,7 +95,7 @@ public void testValidConfigConditionTypeAlert() throws Exception {
hqAssertSuccess(response);

for (AlertDefinition def : response.getAlertDefinition()) {
validateDefinition(d);
validateDefinition(def);
for (AlertCondition c : def.getAlertCondition()) {
assertNotNull("Condition was null", c);
assertEquals(c.getType(), AlertConditionType.CONFIG_CHANGE.getType());
Expand Down Expand Up @@ -126,7 +126,7 @@ public void testConfigConditionOptionalAttribute() throws Exception {
hqAssertSuccess(response);

for (AlertDefinition def : response.getAlertDefinition()) {
validateDefinition(d);
validateDefinition(def);
for (AlertCondition c : def.getAlertCondition()) {
assertNotNull("Condition was null", c);
assertEquals(c.getType(), AlertConditionType.CONFIG_CHANGE.getType());
Expand Down
Expand Up @@ -67,7 +67,7 @@ public void testValidControlConditon() throws Exception {
hqAssertSuccess(response);

for (AlertDefinition def : response.getAlertDefinition()) {
validateDefinition(d);
validateDefinition(def);
for (AlertCondition c : def.getAlertCondition()) {
assertNotNull("Condition was null", c);
assertEquals(c.getType(), AlertConditionType.CONTROL.getType());
Expand Down Expand Up @@ -101,7 +101,7 @@ public void testValidControlConditonTypeAlert() throws Exception {
hqAssertSuccess(response);

for (AlertDefinition def : response.getAlertDefinition()) {
validateDefinition(d);
validateDefinition(def);
for (AlertCondition c : def.getAlertCondition()) {
assertNotNull("Condition was null", c);
assertEquals(c.getType(), AlertConditionType.CONTROL.getType());
Expand Down
Expand Up @@ -65,7 +65,7 @@ public void testValidPropertyConditon() throws Exception {
hqAssertSuccess(response);

for (AlertDefinition def : response.getAlertDefinition()) {
validateDefinition(d);
validateDefinition(def);
for (AlertCondition c : def.getAlertCondition()) {
assertNotNull("Condition was null", c);
assertEquals(c.getType(), AlertConditionType.LOG.getType());
Expand Down Expand Up @@ -97,7 +97,7 @@ public void testValidPropertyConditonTypeAlert() throws Exception {
hqAssertSuccess(response);

for (AlertDefinition def : response.getAlertDefinition()) {
validateDefinition(d);
validateDefinition(def);
for (AlertCondition c : def.getAlertCondition()) {
assertNotNull("Condition was null", c);
assertEquals(c.getType(), AlertConditionType.LOG.getType());
Expand Down
Expand Up @@ -73,7 +73,7 @@ public void testValidMetricChangeConditon() throws Exception {
hqAssertSuccess(response);

for (AlertDefinition def : response.getAlertDefinition()) {
validateDefinition(d);
validateDefinition(def);
for (AlertCondition c : def.getAlertCondition()) {
assertNotNull("Condition was null", c);
assertEquals(c.getType(), AlertConditionType.METRIC_CHANGE.getType());
Expand Down Expand Up @@ -110,7 +110,7 @@ public void testValidMetricChangeConditonTypeAlert() throws Exception {
hqAssertSuccess(response);

for (AlertDefinition def : response.getAlertDefinition()) {
validateDefinition(d);
validateDefinition(def);
for (AlertCondition c : def.getAlertCondition()) {
assertNotNull("Condition was null", c);
assertEquals(c.getType(), AlertConditionType.METRIC_CHANGE.getType());
Expand Down
Expand Up @@ -64,7 +64,7 @@ public void testValidPropertyConditon() throws Exception {
hqAssertSuccess(response);

for (AlertDefinition def : response.getAlertDefinition()) {
validateDefinition(d);
validateDefinition(def);
for (AlertCondition c : def.getAlertCondition()) {
assertNotNull("Condition was null", c);
assertEquals(c.getProperty(), PROP_NAME);
Expand Down Expand Up @@ -94,7 +94,7 @@ public void testValidPropertyConditonTypeAlert() throws Exception {
hqAssertSuccess(response);

for (AlertDefinition def : response.getAlertDefinition()) {
validateDefinition(d);
validateDefinition(def);
for (AlertCondition c : def.getAlertCondition()) {
assertNotNull("Condition was null", c);
assertEquals(c.getProperty(), PROP_NAME);
Expand Down
Expand Up @@ -77,7 +77,7 @@ public void testValidThresholdConditon() throws Exception {
hqAssertSuccess(response);

for (AlertDefinition def : response.getAlertDefinition()) {
validateDefinition(d);
validateDefinition(def);
for (AlertCondition c : def.getAlertCondition()) {
assertNotNull("Condition was null", c);
assertEquals(c.getType(), AlertConditionType.THRESHOLD.getType());
Expand Down Expand Up @@ -120,7 +120,7 @@ public void testValidThresholdConditonTypeAlert() throws Exception {
hqAssertSuccess(response);

for (AlertDefinition def : response.getAlertDefinition()) {
validateDefinition(d);
validateDefinition(def);
for (AlertCondition c : def.getAlertCondition()) {
assertNotNull("Condition was null", c);
assertEquals(c.getType(), AlertConditionType.THRESHOLD.getType());
Expand Down

0 comments on commit e5f92e0

Please sign in to comment.