Search in sources :

Example 31 with Metric

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());
}
Also used : Response(javax.ws.rs.core.Response) Metric(com.axibase.tsd.api.model.metric.Metric) List(java.util.List)

Example 32 with Metric

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());
}
Also used : Response(javax.ws.rs.core.Response) Metric(com.axibase.tsd.api.model.metric.Metric) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 33 with Metric

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));
}
Also used : Response(javax.ws.rs.core.Response) Metric(com.axibase.tsd.api.model.metric.Metric) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 34 with 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));
}
Also used : Response(javax.ws.rs.core.Response) Metric(com.axibase.tsd.api.model.metric.Metric) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 35 with 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());
}
Also used : Metric(com.axibase.tsd.api.model.metric.Metric) Test(org.testng.annotations.Test)

Aggregations

Metric (com.axibase.tsd.api.model.metric.Metric)76 Test (org.testng.annotations.Test)58 Issue (io.qameta.allure.Issue)50 Series (com.axibase.tsd.api.model.series.Series)25 Entity (com.axibase.tsd.api.model.entity.Entity)21 Response (javax.ws.rs.core.Response)16 BeforeClass (org.testng.annotations.BeforeClass)15 SeriesQuery (com.axibase.tsd.api.model.series.query.SeriesQuery)13 MetricCommand (com.axibase.tsd.api.model.command.MetricCommand)10 SqlTest (com.axibase.tsd.api.method.sql.SqlTest)7 BigDecimal (java.math.BigDecimal)7 MetricCheck (com.axibase.tsd.api.method.checks.MetricCheck)5 HashMap (java.util.HashMap)5 File (java.io.File)4 ArrayList (java.util.ArrayList)4 SeriesSearchResultRecord (com.axibase.tsd.api.model.series.search.SeriesSearchResultRecord)3 Period (com.axibase.tsd.api.model.Period)2 Sample (com.axibase.tsd.api.model.series.Sample)2 Aggregate (com.axibase.tsd.api.model.series.query.transformation.aggregate.Aggregate)2 SeriesSearchQuery (com.axibase.tsd.api.model.series.search.SeriesSearchQuery)2