Skip to content

Commit

Permalink
Update test because disabled metrics could have data if it was previo…
Browse files Browse the repository at this point in the history
…usly enabled
  • Loading branch information
pnguyen committed Sep 24, 2009
1 parent 073589b commit e733167
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/org/hyperic/hq/hqapi1/test/MetricDataGetLastMulti_test.java
Expand Up @@ -87,10 +87,19 @@ public void testGetLastNoData() throws Exception {

LastMetricsDataResponse dataResponse = dataApi.getData(disabledMetrics);
hqAssertSuccess(dataResponse);

// disabled metrics could have data if it was previously enabled
int lastMetricNoDataCount = 0;

// TODO: What is the correct behavior of the API if the last data point
// could not be found? Return an error for simply null?
for (LastMetricData d : dataResponse.getLastMetricData()) {
assertNull("Metric datapoint not null", d.getDataPoint());
if (d.getDataPoint() == null) {
lastMetricNoDataCount++;
}
}

assertTrue("No disabled metrics with no data could be found",
lastMetricNoDataCount > 0);
}
}

0 comments on commit e733167

Please sign in to comment.