Search in sources :

Example 51 with Metric

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

Example 52 with Metric

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

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

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

Example 55 with Metric

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);
}
Also used : Entity(com.axibase.tsd.api.model.entity.Entity) Metric(com.axibase.tsd.api.model.metric.Metric) BeforeClass(org.testng.annotations.BeforeClass)

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