runner.run(query, CONTEXT),
Lists.<Result<TimeseriesResultValue>>newArrayList()
);
int count = 0;
Result lastResult = null;
for (Result<TimeseriesResultValue> result : results) {
lastResult = result;
Assert.assertEquals(expectedEarliest, result.getTimestamp());
Assert.assertFalse(
String.format("Timestamp[%s] > expectedLast[%s]", result.getTimestamp(), expectedLast),
result.getTimestamp().isAfter(expectedLast)
);
final TimeseriesResultValue value = result.getValue();
Assert.assertEquals(
result.toString(),
QueryRunnerTestHelper.skippedDay.equals(result.getTimestamp()) ? 0L : 13L,
value.getLongMetric("rows").longValue()
);
Assert.assertEquals(
result.toString(),
QueryRunnerTestHelper.expectedFullOnIndexValues[count],
String.valueOf(value.getDoubleMetric("index"))
);
Assert.assertEquals(
result.toString(),
new Double(QueryRunnerTestHelper.expectedFullOnIndexValues[count]) +
(QueryRunnerTestHelper.skippedDay.equals(result.getTimestamp()) ? 0L : 13L) + 1L,
value.getDoubleMetric("addRowsIndexConstant"),
0.0
);
Assert.assertEquals(
value.getDoubleMetric("uniques"),
QueryRunnerTestHelper.skippedDay.equals(result.getTimestamp()) ? 0.0d : 9.0d,
0.02
);
expectedEarliest = gran.toDateTime(gran.next(expectedEarliest.getMillis()));
++count;
}
Assert.assertEquals(lastResult.toString(), expectedLast, lastResult.getTimestamp());
}