use of com.axibase.tsd.api.model.metric.Metric in project atsd-api-test by axibase.
the class MetricUpdateTest method testUnknownMetric.
@Test
public void testUnknownMetric() throws Exception {
final Metric metric = new Metric("updatemetric-4");
assertEquals("Unknown metric should return NotFound", NOT_FOUND.getStatusCode(), updateMetric(metric).getStatus());
}
use of com.axibase.tsd.api.model.metric.Metric in project atsd-api-test by axibase.
the class MetricUpdateTest method testMetricNameContainsSlash.
@Issue("1278")
@Test
public void testMetricNameContainsSlash() throws Exception {
final Metric metric = new Metric("update/metric-2");
metric.setDataType(DataType.DECIMAL);
createOrReplaceMetricCheck(metric);
metric.setDataType(DataType.DOUBLE);
assertEquals("Fail to execute updateMetric query", OK.getStatusCode(), updateMetric(metric).getStatus());
assertTrue("Can not find required metric", metricExist(metric));
}
use of com.axibase.tsd.api.model.metric.Metric in project atsd-api-test by axibase.
the class MetricUpdateTest method testMetricNameContainsCyrillic.
@Issue("1278")
@Test
public void testMetricNameContainsCyrillic() throws Exception {
final Metric metric = new Metric("updateйёmetric-3");
metric.setDataType(DataType.DECIMAL);
createOrReplaceMetricCheck(metric);
metric.setDataType(DataType.DOUBLE);
assertEquals("Fail to execute updateMetric query", OK.getStatusCode(), updateMetric(metric).getStatus());
assertTrue("Can not find required metric", metricExist(metric));
}
use of com.axibase.tsd.api.model.metric.Metric in project atsd-api-test by axibase.
the class MetricUpdateTest method testMetricNameContainsWhiteSpace.
@Issue("1278")
@Test
public void testMetricNameContainsWhiteSpace() throws Exception {
final Metric metric = new Metric("update metric-1");
assertEquals("Method should fail if metricName contains whitespace", BAD_REQUEST.getStatusCode(), updateMetric(metric).getStatus());
}
use of com.axibase.tsd.api.model.metric.Metric in project atsd-api-test by axibase.
the class SeriesQueryAddMetaTest method prepareData.
@BeforeClass
public static void prepareData() throws Exception {
Series historySeries = new Series(ENTITY_NAME, METRIC_NAME).setType(SeriesType.HISTORY);
historySeries.addSamples(Sample.ofDateInteger("2017-11-23T10:00:00.000Z", 1));
Series forecastSeries = new Series(ENTITY_NAME, METRIC_NAME).setType(SeriesType.FORECAST);
forecastSeries.addSamples(Sample.ofDateInteger("2017-11-23T10:00:00.000Z", 2));
MetricMethod.createOrReplaceMetricCheck(new Metric(EMPTY_METRIC_NAME));
EntityMethod.createOrReplaceEntityCheck(new Entity(EMPTY_ENTITY_NAME));
insertSeriesCheck(historySeries, forecastSeries);
}
Aggregations