Search in sources :

Example 56 with Issue

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

the class SeriesInsertTest method testTimeRangeMaxInISOOverflow.

@Issue("2957")
@Test
public void testTimeRangeMaxInISOOverflow() throws Exception {
    final BigDecimal v = new BigDecimal("" + getUnixTime(NEXT_AFTER_MAX_STORABLE_DATE));
    Series series = new Series("e-time-range-8", "m-time-range-8");
    series.addSamples(Sample.ofDateDecimal(NEXT_AFTER_MAX_STORABLE_DATE, v));
    assertEquals("Managed to insert series with d out of range", BAD_REQUEST.getStatusCode(), insertSeries(Collections.singletonList(series)).getStatus());
    SeriesQuery seriesQuery = new SeriesQuery(series.getEntity(), series.getMetric(), NEXT_AFTER_MAX_STORABLE_DATE, addOneMS(NEXT_AFTER_MAX_STORABLE_DATE));
    List<Series> seriesList = querySeriesAsList(seriesQuery);
    assertEquals("Managed to insert series with d out of range", 0, seriesList.get(0).getData().size());
}
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)

Example 57 with Issue

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

the class SeriesInsertTest method testMillisecondsUnsupported.

@Issue("2850")
@Test
public void testMillisecondsUnsupported() throws Exception {
    String entityName = "e-iso-13";
    String metricName = "m-iso-13";
    Series series = new Series(entityName, metricName);
    series.addSamples(Sample.ofRawDateInteger(Mocks.MILLS_TIME.toString(), 0));
    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, "-", "5"));
}
Also used : Response(javax.ws.rs.core.Response) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 58 with Issue

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

the class SeriesInsertTest method testEmptyTagValueRaisesError.

@Issue("3164")
@Test
public void testEmptyTagValueRaisesError() throws Exception {
    Series series = new Series("e-empty-tag-1", "m-empty-tag-1");
    series.addSamples(Sample.ofDateInteger(ISO_TIME, 1));
    String emptyTagName = "empty-tag";
    series.addTag(emptyTagName, "");
    Response response = insertSeries(Collections.singletonList(series));
    String errorMessage = extractErrorMessage(response);
    assertEquals("Incorrect response status code", BAD_REQUEST.getStatusCode(), response.getStatus());
    assertEquals("Incorrect error message", String.format(EMPTY_TAG, emptyTagName), errorMessage);
}
Also used : Response(javax.ws.rs.core.Response) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 59 with Issue

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

the class SeriesInsertTest method testXTextFieldPreservedFromTagsModifications.

@Issue("3480")
@Test
public void testXTextFieldPreservedFromTagsModifications() throws Exception {
    String entityName = "e-text-modify-tags-1";
    String metricName = "m-text-modify-tags-1";
    Series series = new Series(entityName, metricName);
    String xText = "text";
    Sample sample = Sample.ofDateIntegerText("2016-10-11T13:00:00.000Z", 1, xText);
    series.addSamples(sample);
    insertSeriesCheck(Collections.singletonList(series));
    series.addTag("foo", "foo");
    SeriesQuery seriesQuery = new SeriesQuery(series);
    insertSeriesCheck(Collections.singletonList(series));
    List<Series> seriesList = querySeriesAsList(seriesQuery);
    assertEquals("Stored series are incorrect", Collections.singletonList(series), seriesList);
    assertEquals("Tag was not modified", "foo", seriesList.get(0).getTags().get("foo"));
}
Also used : SeriesQuery(com.axibase.tsd.api.model.series.query.SeriesQuery) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 60 with Issue

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

the class SeriesInsertTest method testTimeRangeMinInMSSaved.

@Issue("2957")
@Test
public void testTimeRangeMinInMSSaved() throws Exception {
    Long time = 0L;
    Long endTime = 1L;
    Series series = new Series("e-time-range-1", "m-time-range-1");
    series.addSamples(Sample.ofDateInteger(Util.ISOFormat(time), 0));
    insertSeriesCheck(Collections.singletonList(series));
    SeriesQuery seriesQuery = new SeriesQuery(series.getEntity(), series.getMetric(), time, endTime);
    List<Series> seriesList = querySeriesAsList(seriesQuery);
    assertEquals(new BigDecimal("0"), 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