Search in sources :

Example 46 with Issue

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

the class DoubleBackslashCharEscapeTest method testType.

@Issue("2854")
@Test
public void testType() throws Exception {
    Property property = new Property("property-command-test\\\\-t7", "property-command-test-e7");
    property.setTags(DEFAULT_PROPERTY_TAGS);
    property.setDate(getCurrentDate());
    PlainCommand command = new PropertyCommand(property);
    CommandMethod.send(command);
    assertPropertyExisting("Inserted property can not be received", property);
}
Also used : PlainCommand(com.axibase.tsd.api.model.command.PlainCommand) Property(com.axibase.tsd.api.model.property.Property) PropertyCommand(com.axibase.tsd.api.model.command.PropertyCommand) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 47 with Issue

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

the class LengthTest method testMaxLength.

@Issue("2412")
@Test
public void testMaxLength() throws Exception {
    final Property property = new Property(propertyType(), entity());
    property.setDate(Mocks.ISO_TIME);
    property.setKey(Collections.EMPTY_MAP);
    property.addTag("type", property.getType());
    PlainCommand command = new PropertyCommand(property);
    Integer currentLength = command.compose().length();
    for (int i = 0; currentLength < MAX_LENGTH; i++) {
        String tagName = "name" + property.getEntity() + i;
        String textValue = "sda" + property.getEntity() + i;
        String addedTag = String.format(" v:%s=%s", tagName, textValue);
        currentLength += addedTag.length();
        if (currentLength <= MAX_LENGTH) {
            property.addTag(tagName, textValue);
        } else {
            currentLength -= addedTag.length();
            break;
        }
    }
    while (currentLength != MAX_LENGTH) {
        property.setType(property.getType().concat("+"));
        currentLength++;
    }
    command = new PropertyCommand(property);
    assertEquals("Command length is not maximal", MAX_LENGTH, command.compose().length());
    CommandMethod.send(command);
    assertPropertyExisting("Inserted property can not be received", property);
}
Also used : PlainCommand(com.axibase.tsd.api.model.command.PlainCommand) Property(com.axibase.tsd.api.model.property.Property) PropertyCommand(com.axibase.tsd.api.model.command.PropertyCommand) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 48 with Issue

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

the class SeriesInsertTest method testISOFormatsZms.

@Issue("2009")
@Test
public void testISOFormatsZms() throws Exception {
    String entityName = "e-iso-2";
    String metricName = "m-iso-2";
    BigDecimal value = new BigDecimal(0);
    String storedDate = "2016-06-09T17:08:09.100Z";
    Series series = new Series(entityName, metricName);
    String d = "2016-06-09T17:08:09.100Z";
    series.addSamples(Sample.ofDateDecimal(d, value));
    assertEquals("Failed to insert series", OK.getStatusCode(), insertSeries(Collections.singletonList(series)).getStatus());
    assertSeriesExisting(series);
    SeriesQuery seriesQuery = new SeriesQuery(series.getEntity(), series.getMetric(), d, "2016-06-09T17:08:09.101Z");
    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)

Example 49 with Issue

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

the class SeriesInsertTest method testXXTimezoneUnsupported.

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

Example 50 with Issue

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

the class SeriesInsertTest method testUrlNotFoundGetRequest2.

@Issue("2927")
@Test
public void testUrlNotFoundGetRequest2() throws Exception {
    Response response = executeApiRequest(webTarget -> webTarget.path("404").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)

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