use of com.axibase.tsd.api.model.series.query.SeriesQuery in project atsd-api-test by axibase.
the class SeriesQueryWildcardEscapeTest method testEntitySpecialCharEscape.
@Issue("4662")
@Test(description = "Test series query for entity name that contains wildcard", dataProvider = "provideSpecialCharacters")
public static void testEntitySpecialCharEscape(char c) throws Exception {
String entityName = ENTITY_PREFIX + c + "e1";
Series series = new Series(entityName, Mocks.metric());
series.addSamples(Mocks.SAMPLE);
SeriesMethod.insertSeriesCheck(series);
SeriesQuery seriesQuery = new SeriesQuery(series);
String actualEntityName = SeriesMethod.querySeriesAsList(seriesQuery).get(0).getEntity();
assertEquals("Wrong result when performing series query with entity that contains wildcard character " + c, entityName, actualEntityName);
}
use of com.axibase.tsd.api.model.series.query.SeriesQuery in project atsd-api-test by axibase.
the class SeriesQueryWildcardEscapeTest method testTagSpecialCharEscapeNotFound.
@Issue("4662")
@Test(description = "Test series query for tag value that contains wildcard and nothing were found", dataProvider = "provideSpecialCharacters")
public static void testTagSpecialCharEscapeNotFound(char c) throws Exception {
String entityName = Mocks.entity();
String metricName = Mocks.metric();
String expectedTagValue = "tag" + '\\' + c;
EntityMethod.createOrReplaceEntityCheck(new Entity(entityName));
MetricMethod.createOrReplaceMetricCheck(new Metric(metricName));
SeriesQuery seriesQuery = new SeriesQuery(metricName, entityName, MIN_QUERYABLE_DATE, MAX_QUERYABLE_DATE);
seriesQuery.addTag("tag", expectedTagValue);
String actualTagValue = SeriesMethod.querySeriesAsList(seriesQuery).get(0).getTags().get("tag");
assertEquals("Wrong result when performing series query with tag value that contains wildcard character " + c + " and no series were found", expectedTagValue, actualTagValue);
}
use of com.axibase.tsd.api.model.series.query.SeriesQuery in project atsd-api-test by axibase.
the class SeriesQueryWildcardEscapeTest method testTagSpecialCharEscape.
@Issue("4662")
@Test(description = "Test series query for tag value that contains wildcard", dataProvider = "provideSpecialCharacters")
public static void testTagSpecialCharEscape(char c) throws Exception {
String entityName = Mocks.entity();
String metircName = Mocks.metric();
String tagValue = "tag" + c;
Series series = new Series(entityName, metircName);
series.addTag("tag", tagValue);
series.addSamples(Mocks.SAMPLE);
SeriesMethod.insertSeriesCheck(series);
SeriesQuery seriesQuery = new SeriesQuery(series);
String actualTagValue = SeriesMethod.querySeriesAsList(seriesQuery).get(0).getTags().get("tag");
assertEquals("Wrong result when performing series query with tag value that contains wildcard character " + c, tagValue, actualTagValue);
}
use of com.axibase.tsd.api.model.series.query.SeriesQuery in project atsd-api-test by axibase.
the class SeriesQueryAggregateGroupOrderRateTest method testDefaultOrderGroupAggregate.
@Issue("4729")
@Test(description = "test query result with default Group/Aggregate order")
public void testDefaultOrderGroupAggregate() {
SeriesQuery query = new SeriesQuery("*", TEST_METRIC, "2017-01-01T00:00:00Z", "2017-01-01T00:00:20Z");
query.setAggregate(new Aggregate(AggregationType.COUNT, new Period(10, TimeUnit.SECOND)));
query.setGroup(new Group(GroupType.MAX, new Period(5, TimeUnit.SECOND)));
List<Series> result = querySeriesAsList(query);
Series expectedSeries = createSeries("*", Sample.ofDateDecimal("2017-01-01T00:00:00.000Z", new BigDecimal("2.0")), Sample.ofDateDecimal("2017-01-01T00:00:10.000Z", new BigDecimal("2.0")));
assertEquals(result, Collections.singletonList(expectedSeries), "Incorrect query result with default Group/Aggregate order");
}
use of com.axibase.tsd.api.model.series.query.SeriesQuery in project atsd-api-test by axibase.
the class SeriesQueryEntityEscapeTest method testEntityEscape.
@Issue("4640")
@Test(dataProvider = "provideEntityFilters", description = "test entity name escaping in series query")
public void testEntityEscape(String filter) throws Exception {
List<Series> series = SeriesMethod.querySeriesAsList(new SeriesQuery(filter, TEST_METRIC, MIN_QUERYABLE_DATE, MAX_QUERYABLE_DATE));
assertEquals(String.format("Incorrect series count with filter %s", filter), 1, series.size());
assertEquals(String.format("Incorrect series returned with filter %s", filter), TEST_SERIES, series.get(0));
}
Aggregations