use of com.axibase.tsd.api.model.series.query.SeriesQuery in project atsd-api-test by axibase.
the class SeriesQueryEntityExpressionTest method testEntityExpressionWithEntityGroup.
@Issue("3612")
@Test(dataProvider = "entityExpressionProviderForEntityGroup")
public static void testEntityExpressionWithEntityGroup(String expression, HashSet<String> expectedEntities) throws Exception {
SeriesQuery query = createTestQuery(null);
query.setEntityGroup(ENTITY_GROUP_NAME);
query.setEntityExpression(expression);
List<Series> result = SeriesMethod.querySeriesAsList(query);
HashSet<String> receivedEntities = new HashSet<>();
for (Series series : result) {
receivedEntities.add(series.getEntity());
}
assertEquals(formatErrorMsg("Wrong result entity set", expression), expectedEntities, receivedEntities);
for (Series series : result) {
List<Sample> seriesData = series.getData();
assertEquals(formatErrorMsg("Wrong number of data entries", expression), 1, seriesData.size());
assertEquals(formatErrorMsg("Wrong data received", expression), Mocks.SAMPLE, seriesData.get(0));
}
}
use of com.axibase.tsd.api.model.series.query.SeriesQuery in project atsd-api-test by axibase.
the class SeriesQueryEntityExpressionTest method testEntityExpressionWithWildcardEntity.
@Issue("3612")
@Test(dataProvider = "entityExpressionProviderForWildcardEntity")
public static void testEntityExpressionWithWildcardEntity(String expression, HashSet<String> expectedEntities) throws Exception {
SeriesQuery query = createTestQuery("*");
query.setEntityExpression(expression);
List<Series> result = SeriesMethod.querySeriesAsList(query);
HashSet<String> receivedEntities = new HashSet<>();
for (Series series : result) {
receivedEntities.add(series.getEntity());
}
assertEquals(formatErrorMsg("Wrong result entity set", expression), expectedEntities, receivedEntities);
for (Series series : result) {
List<Sample> seriesData = series.getData();
assertEquals(formatErrorMsg("Wrong number of data entries", expression), 1, seriesData.size());
assertEquals(formatErrorMsg("Wrong data received", expression), Mocks.SAMPLE, seriesData.get(0));
}
}
use of com.axibase.tsd.api.model.series.query.SeriesQuery in project atsd-api-test by axibase.
the class SeriesQueryEntityExpressionTest method testEmptyResultEntityExpressionWithWildcardEntity.
@Issue("3612")
@Test(dataProvider = "emptyResultEntityExpressionProvider")
public static void testEmptyResultEntityExpressionWithWildcardEntity(String expression) throws Exception {
SeriesQuery query = createTestQuery("*");
query.setEntityExpression(expression);
List<Series> result = SeriesMethod.querySeriesAsList(query);
assertEquals(formatErrorMsg("Dummy result is not present", expression), 1, result.size());
Series series = result.get(0);
assertEquals(formatErrorMsg("Dummy result entity name", expression), query.getEntity(), series.getEntity());
assertEquals(formatErrorMsg("Dummy result data size", expression), 0, series.getData().size());
}
use of com.axibase.tsd.api.model.series.query.SeriesQuery in project atsd-api-test by axibase.
the class SeriesQueryEntityExpressionTest method testEmptyResultEntityExpressionWithFixedEntity.
@Issue("3612")
@Test(dataProvider = "emptyResultEntityExpressionProviderForFixedEntity")
public static void testEmptyResultEntityExpressionWithFixedEntity(String expression) throws Exception {
SeriesQuery query = createTestQuery(FIXED_ENTITY_NAME);
query.setEntityExpression(expression);
List<Series> result = SeriesMethod.querySeriesAsList(query);
assertEquals(formatErrorMsg("Dummy result should be the one present", expression), 1, result.size());
Series series = result.get(0);
assertEquals(formatErrorMsg("Dummy result entity name should be preserved", expression), FIXED_ENTITY_NAME, series.getEntity());
assertTrue(formatErrorMsg("Dummy result data should be empty", expression), series.getData().isEmpty());
}
use of com.axibase.tsd.api.model.series.query.SeriesQuery in project atsd-api-test by axibase.
the class SeriesQueryEntityExpressionTest method testEntityExpressionWithEntityGroup.
@Issue("3612")
@Test(dataProvider = "emptyResultEntityExpressionProviderForEntityGroup")
public static void testEntityExpressionWithEntityGroup(String expression) throws Exception {
SeriesQuery query = createTestQuery(null);
query.setEntityGroup(ENTITY_GROUP_NAME);
query.setEntityExpression(expression);
List<Series> result = SeriesMethod.querySeriesAsList(query);
HashSet<String> receivedEntities = new HashSet<>();
for (Series series : result) {
receivedEntities.add(series.getEntity());
}
assertTrue(formatErrorMsg("Result set should be empty", expression), receivedEntities.isEmpty());
}
Aggregations