Search in sources :

Example 51 with Issue

use of io.qameta.allure.Issue in project atsd-api-test by axibase.

the class SeriesInsertTest method testUrlNotFoundGetRequest1.

@Issue("2927")
@Test
public void testUrlNotFoundGetRequest1() throws Exception {
    Response response = executeApiRequest(webTarget -> webTarget.path("query").request().get());
    response.bufferEntity();
    assertEquals("Nonexistent url with /api/v1 get doesn't return 404", NOT_FOUND.getStatusCode(), response.getStatus());
}
Also used : Response(javax.ws.rs.core.Response) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 52 with Issue

use of io.qameta.allure.Issue in project atsd-api-test by axibase.

the class SeriesInsertTest method testLocalTimeUnsupported.

@Issue("2850")
@Test
public void testLocalTimeUnsupported() throws Exception {
    String entityName = "e-iso-11";
    String metricName = "m-iso-11";
    String value = "0";
    Series series = new Series(entityName, metricName);
    Sample sample = Sample.ofRawDateInteger("2016-06-09 20:00:00", 0);
    series.addSamples(sample);
    Response response = insertSeries(Collections.singletonList(series));
    assertEquals("Incorrect response status code", BAD_REQUEST.getStatusCode(), response.getStatus());
    assertErrorMessageStart(extractErrorMessage(response), String.format(JSON_MAPPING_EXCEPTION_UNEXPECTED_CHARACTER, "T", " "));
}
Also used : Response(javax.ws.rs.core.Response) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 53 with Issue

use of io.qameta.allure.Issue in project atsd-api-test by axibase.

the class SeriesInsertTest method testPrecisionAfterCompaction.

@Issue("2871")
@Test(dataProvider = "afterCompactionDataProvider")
public void testPrecisionAfterCompaction(DataType type, BigDecimal valueBefore) throws Exception {
    Metric metric = new Metric(metric());
    metric.setDataType(type);
    Long time = MILLS_TIME;
    Series series = new Series(entity(), metric.getName());
    series.addSamples(Sample.ofDateDecimal(Util.ISOFormat(time), valueBefore));
    MetricMethod.createOrReplaceMetricCheck(metric);
    SeriesMethod.insertSeriesCheck(series);
    CompactionMethod.performCompaction();
    SeriesQuery seriesQuery = new SeriesQuery(series.getEntity(), series.getMetric(), time, time + 1);
    List<Series> seriesList = querySeriesAsList(seriesQuery);
    BigDecimal actualValue = seriesList.get(0).getData().get(0).getValue();
    String assertMessage = String.format("Stored value precision incorrect.%n Expected: %s%nActual: %s%n", valueBefore, actualValue);
    assertTrue(assertMessage, valueBefore.compareTo(actualValue) == 0);
}
Also used : SeriesQuery(com.axibase.tsd.api.model.series.query.SeriesQuery) Metric(com.axibase.tsd.api.model.metric.Metric) BigDecimal(java.math.BigDecimal) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 54 with Issue

use of io.qameta.allure.Issue in project atsd-api-test by axibase.

the class SeriesInsertTest method testUrlNotFoundGetRequest3.

@Issue("2927")
@Test
public void testUrlNotFoundGetRequest3() throws Exception {
    Response response = executeApiRequest(webTarget -> webTarget.path("404").queryParam("not", "exist").request().get());
    response.bufferEntity();
    assertEquals("Nonexistent url with /api/v1 get doesn't return 404", NOT_FOUND.getStatusCode(), response.getStatus());
}
Also used : Response(javax.ws.rs.core.Response) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 55 with Issue

use of io.qameta.allure.Issue in project atsd-api-test by axibase.

the class SeriesInsertTest method testISOFormatsZmsAbsent.

@Issue("2009")
@Test
public void testISOFormatsZmsAbsent() throws Exception {
    String entityName = "e-iso-1";
    String metricName = "m-iso-1";
    BigDecimal value = new BigDecimal(0);
    String storedDate = "2016-06-09T17:08:09.000Z";
    Series series = new Series(entityName, metricName);
    String d = "2016-06-09T17:08:09Z";
    series.addSamples(Sample.ofDateDecimal(d, value));
    assertEquals("Failed to insert series", OK.getStatusCode(), insertSeries(Collections.singletonList(series)).getStatus());
    SeriesQuery seriesQuery = new SeriesQuery(series.getEntity(), series.getMetric(), d, "2016-06-09T17:08:09.001Z");
    assertSeriesQueryDataSize(seriesQuery, 1);
    List<Series> seriesList = querySeriesAsList(seriesQuery);
    assertEquals("Stored date incorrect", storedDate, seriesList.get(0).getData().get(0).getRawDate());
    assertEquals("Stored value incorrect", value, seriesList.get(0).getData().get(0).getValue());
}
Also used : SeriesQuery(com.axibase.tsd.api.model.series.query.SeriesQuery) BigDecimal(java.math.BigDecimal) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Aggregations

Issue (io.qameta.allure.Issue)858 Test (org.testng.annotations.Test)857 SqlTest (com.axibase.tsd.api.method.sql.SqlTest)377 StringTable (com.axibase.tsd.api.model.sql.StringTable)270 Response (javax.ws.rs.core.Response)234 List (java.util.List)166 SeriesQuery (com.axibase.tsd.api.model.series.query.SeriesQuery)145 Series (com.axibase.tsd.api.model.series.Series)88 Property (com.axibase.tsd.api.model.property.Property)84 BigDecimal (java.math.BigDecimal)53 Metric (com.axibase.tsd.api.model.metric.Metric)50 Period (com.axibase.tsd.api.model.Period)47 PropertyQuery (com.axibase.tsd.api.model.property.PropertyQuery)44 Entity (com.axibase.tsd.api.model.entity.Entity)43 ArrayList (java.util.ArrayList)37 Message (com.axibase.tsd.api.model.message.Message)32 PlainCommand (com.axibase.tsd.api.model.command.PlainCommand)31 HashMap (java.util.HashMap)30 EntityGroup (com.axibase.tsd.api.model.entitygroup.EntityGroup)29 Aggregate (com.axibase.tsd.api.model.series.query.transformation.aggregate.Aggregate)29