use of com.axibase.tsd.api.model.entity.Entity in project atsd-api-test by axibase.
the class EntityGetTest method testEntityNameContainsCyrillic.
@Issue("1278")
@Test
public void testEntityNameContainsCyrillic() throws Exception {
Entity entity = new Entity("getйёentity3");
createOrReplaceEntityCheck(entity);
assertEntityExisting(entity);
}
use of com.axibase.tsd.api.model.entity.Entity in project atsd-api-test by axibase.
the class EntityUpdateTest method testEntityNameContainsSlash.
@Issue("1278")
@Test
public void testEntityNameContainsSlash() throws Exception {
final Entity entity = new Entity("update_entity/2");
entity.addTag("t1", "tv1");
createOrReplaceEntityCheck(entity);
Map<String, String> newTags = new HashMap<>();
newTags.put("t2", "tv2");
assertUrlencodedPathHandledSuccessfullyOnUpdate(entity, newTags);
}
use of com.axibase.tsd.api.model.entity.Entity in project atsd-api-test by axibase.
the class SeriesQueryWildcardEscapeTest method testEntitySpecialCharEscapeNotFound.
@Issue("4662")
@Test(description = "Test series query for entity name that contains wildcard and nothing were found", dataProvider = "provideSpecialCharacters")
public static void testEntitySpecialCharEscapeNotFound(char c) throws Exception {
String entityName = ENTITY_PREFIX + c + "e2";
String metricName = Mocks.metric();
Series series = new Series(entityName, metricName);
EntityMethod.createOrReplaceEntityCheck(new Entity(entityName));
MetricMethod.createOrReplaceMetricCheck(new Metric(metricName));
SeriesQuery seriesQuery = new SeriesQuery(series);
String actualEntityName = SeriesMethod.querySeriesAsList(seriesQuery).get(0).getEntity();
String expectedEntityName = ENTITY_PREFIX + '\\' + c + "e2";
assertEquals("Wrong result when performing series query with entity that contains wildcard character " + c + " and no series were found", expectedEntityName, actualEntityName);
}
use of com.axibase.tsd.api.model.entity.Entity in project atsd-api-test by axibase.
the class SeriesSearchTest method testAllFields.
@Issue("4404")
@Test(description = "Test all fields returned")
public void testAllFields() {
Entity expectedEntity = EntityMethod.getEntity(resultRecord4.getEntity().getName());
Metric expectedMetric = MetricMethod.getMetric(resultRecord4.getMetric().getName());
SeriesSearchQuery query = new SeriesSearchQuery("sst_22*");
query.addEntityFields("*");
query.addEntityTags("*");
query.addMetricFields("*");
query.addMetricTags("*");
SeriesSearchResult result = SeriesMethod.searchSeries(query);
SeriesSearchResultRecord[] resultRecords = result.getData();
assertTrue(resultRecords != null && resultRecords.length == 1, "Incorrect series count");
SeriesSearchResultRecord resultRecord = resultRecords[0];
Entity resultEntity = resultRecord.getEntity();
Metric resultMetric = resultRecord.getMetric();
assertEquals(resultEntity, expectedEntity);
assertEquals(resultMetric, expectedMetric);
}
use of com.axibase.tsd.api.model.entity.Entity in project atsd-api-test by axibase.
the class SeriesSearchTest method createSeries.
private static SeriesSearchResultRecord createSeries(String prefix) throws Exception {
Entity entity = new Entity(prefix + Mocks.entity(), Collections.singletonMap(prefix + "entity_tag", prefix + "entity_value")).setLabel(prefix + Mocks.LABEL).setInterpolationMode(InterpolationMode.PREVIOUS).setTimeZoneID("Europe/Moscow").setEnabled(true);
Metric metric = new Metric(prefix + Mocks.metric(), Collections.singletonMap(prefix + "metric_tag", prefix + "metric_value")).setLabel(prefix + Mocks.LABEL).setTimeZoneID("Europe/London").setEnabled(true).setInterpolate(InterpolationMode.PREVIOUS).setDescription(prefix + Mocks.DESCRIPTION).setDataType(DataType.DECIMAL).setTimePrecision("SECONDS").setEnabled(true).setPersistent(true).setFilter("name = '*'").setRetentionDays(0).setSeriesRetentionDays(0).setVersioned(false).setMinValue(new BigDecimal("1")).setMaxValue(new BigDecimal("200.1")).setInvalidAction("TRANSFORM").setUnits("kg");
Map<String, String> tags = Collections.singletonMap(prefix + "tag", prefix + "value");
Series series = new Series(entity.getName(), metric.getName(), tags);
series.addSamples(Mocks.SAMPLE);
EntityMethod.createOrReplaceEntityCheck(entity);
MetricMethod.createOrReplaceMetricCheck(metric);
SeriesMethod.insertSeriesCheck(series);
return new SeriesSearchResultRecord(entity, metric, tags, 1.0);
}
Aggregations