use of com.axibase.tsd.api.model.series.query.Interval in project atsd-api-test by axibase.
the class SeriesQueryTest method buildQuery.
private SeriesQuery buildQuery() {
SeriesQuery seriesQuery = new SeriesQuery();
seriesQuery.setEntity(TEST_SERIES2.getEntity());
seriesQuery.setMetric(TEST_SERIES2.getMetric());
seriesQuery.setInterval(new Interval(1, TimeUnit.MILLISECOND));
return seriesQuery;
}
use of com.axibase.tsd.api.model.series.query.Interval in project atsd-api-test by axibase.
the class SeriesQueryDateFilterTest method testIntervalAndEnd.
@Issue("3030")
@Test
public void testIntervalAndEnd() throws Exception {
Series series = new Series("datefilter-e-2", "datefilter-m-2");
series.addSamples(DATE_FILTER_DEFAULT_SAMPLE);
insertSeriesCheck(Collections.singletonList(series));
SeriesQuery query = new SeriesQuery(series.getEntity(), series.getMetric());
query.setInterval(new Interval(300, TimeUnit.YEAR));
query.setEndDate(MAX_STORABLE_DATE);
Response response = querySeries(query);
assertSame("Response code mismatch", Response.Status.Family.SUCCESSFUL, Util.responseFamily(response));
final String expected = jacksonMapper.writeValueAsString(Collections.singletonList(series));
final String given = response.readEntity(String.class);
assertTrue("Stored series mismatch", compareJsonString(expected, given));
}
Aggregations