use of com.axibase.tsd.api.model.metric.Metric in project atsd-api-test by axibase.
the class EntityGetMetricsTest method assertUrlencodedPathHandledSuccessfullyOnGetMetrics.
private void assertUrlencodedPathHandledSuccessfullyOnGetMetrics(final Series series) throws Exception {
Response response = queryEntityMetrics(series.getEntity());
assertEquals("Fail to execute queryEntityMetric", OK.getStatusCode(), response.getStatus());
List<Metric> metricList = response.readEntity(new GenericType<List<Metric>>() {
});
assertEquals("Entity should have only 1 metric", 1, metricList.size());
assertEquals("Metric in response does not match to inserted metric", series.getMetric(), metricList.get(0).getName());
}
use of com.axibase.tsd.api.model.metric.Metric in project atsd-api-test by axibase.
the class MetricCreateOrReplaceTest method testMetricNameContainsWhiteSpace.
@Issue("1278")
@Test
public void testMetricNameContainsWhiteSpace() throws Exception {
final Metric metric = new Metric("createreplace metric-1");
Response response = createOrReplaceMetric(metric);
assertEquals("Method should fail if metricName contains whitespace", BAD_REQUEST.getStatusCode(), response.getStatus());
}
use of com.axibase.tsd.api.model.metric.Metric in project atsd-api-test by axibase.
the class MetricCreateOrReplaceTest method testMetricNameContainsCyrillic.
@Issue("1278")
@Test
public void testMetricNameContainsCyrillic() throws Exception {
final Metric metric = new Metric("createreplacйёmetric-3");
metric.setDataType(DataType.DECIMAL);
Response response = createOrReplaceMetric(metric);
assertEquals("Fail to execute createOrReplaceEntityGroup method", OK.getStatusCode(), response.getStatus());
assertTrue("Fail to check metric inserted", metricExist(metric));
}
use of com.axibase.tsd.api.model.metric.Metric in project atsd-api-test by axibase.
the class MetricCreateOrReplaceTest method testMetricNameContainsSlash.
@Issue("1278")
@Test
public void testMetricNameContainsSlash() throws Exception {
final Metric metric = new Metric("createreplace/metric-2");
metric.setDataType(DataType.DECIMAL);
Response response = createOrReplaceMetric(metric);
assertEquals("Fail to execute createOrReplaceEntityGroup method", OK.getStatusCode(), response.getStatus());
assertTrue("Fail to check metric inserted", metricExist(metric));
}
use of com.axibase.tsd.api.model.metric.Metric in project atsd-api-test by axibase.
the class MetricGetTest method testUnknownMetric.
@Test
public void testUnknownMetric() throws Exception {
final Metric metric = new Metric("getmetric-4");
assertEquals("Unknown metric should return NotFound", NOT_FOUND.getStatusCode(), queryMetric(metric.getName()).getStatus());
}
Aggregations