use of com.axibase.tsd.api.model.message.MessageStatsQuery in project atsd-api-test by axibase.
the class MessageQueryStatsTest method testTagsExpressionError.
@Issue("6460")
@Test(description = "Tests that warning is returned if executing query with invalid expression. Error in \"lke\"")
public void testTagsExpressionError() {
MessageStatsQuery statsQuery = prepareSimpleMessageStatsQuery(MESSAGE_STATS_ENTITY).setTagExpression("type lke 'something'");
Response response = queryMessageStats(statsQuery);
assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
List<MessageStats> messageStatsList = response.readEntity(ResponseAsList.ofMessageStats());
assertEquals(1, messageStatsList.size());
String warning = messageStatsList.get(0).getWarning();
assertEquals(warning, "IllegalStateException: Syntax error at line 1 position 5: no viable alternative at input 'type lke'");
}
use of com.axibase.tsd.api.model.message.MessageStatsQuery in project atsd-api-test by axibase.
the class MessageQueryStatsTest method testAggregateCount.
@Issue("2945")
@Test(enabled = false)
public void testAggregateCount() {
MessageStatsQuery statsQuery = prepareSimpleMessageStatsQuery(MESSAGE_STATS_ENTITY);
statsQuery.setAggregate(new Aggregate(AggregationType.COUNT));
List<Series> messageStatsList = queryMessageStatsReturnSeries(statsQuery);
assertEquals("Response should contain only 1 series", 1, messageStatsList.size());
List<Sample> samples = messageStatsList.get(0).getData();
assertEquals("Response should contain only 1 sample", 1, samples.size());
assertEquals("Message count mismatch", new BigDecimal(DATES.size()), samples.get(0).getValue());
}
use of com.axibase.tsd.api.model.message.MessageStatsQuery in project atsd-api-test by axibase.
the class MessageQueryStatsTest method testAggregateNoTypeRaiseError.
@Issue("2945")
@Test
public void testAggregateNoTypeRaiseError() {
MessageStatsQuery statsQuery = prepareSimpleMessageStatsQuery(MESSAGE_STATS_ENTITY);
statsQuery.setAggregate(new Aggregate());
Response response = queryMessageStats(statsQuery);
assertEquals("Query with unknown aggregate type should fail", Response.Status.BAD_REQUEST.getStatusCode(), response.getStatus());
}
Aggregations