Search in sources :

Example 61 with Issue

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

the class SeriesInsertTest method testTimeRangeMaxInISOSaved.

@Issue("2957")
@Test
public void testTimeRangeMaxInISOSaved() throws Exception {
    final BigDecimal v = new BigDecimal("" + getUnixTime(MAX_STORABLE_DATE));
    Series series = new Series("e-time-range-6", "m-time-range-6");
    series.addSamples(Sample.ofDateDecimal(MAX_STORABLE_DATE, v));
    insertSeriesCheck(Collections.singletonList(series));
    SeriesQuery seriesQuery = new SeriesQuery(series.getEntity(), series.getMetric(), MAX_STORABLE_DATE, NEXT_AFTER_MAX_STORABLE_DATE);
    List<Sample> data = querySeriesAsList(seriesQuery).get(0).getData();
    assertNotSame("Empty data in response", 0, data.size());
    assertEquals(v, data.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 62 with Issue

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

the class SeriesInsertTest method testUrlNotFoundOptionsRequest3.

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

Example 63 with Issue

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

the class SeriesInsertTest method testUrlNotFoundOptionsRequest0.

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

Example 64 with Issue

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

the class SeriesInsertTest method testXTextFieldVersioned.

@Issue("3740")
@Test
public void testXTextFieldVersioned() throws Exception {
    String entityName = "e-text-versioning-2";
    String metricName = "m-text-versioning-2";
    Series series = new Series(entityName, metricName);
    Metric metric = new Metric(metricName);
    metric.setVersioned(true);
    MetricMethod.createOrReplaceMetricCheck(metric);
    String[] data = new String[] { "1", "2", "3", "4" };
    for (String x : data) {
        Sample sample = Sample.ofDateIntegerText("2016-10-11T13:00:00.000Z", 1, x);
        series.setSamples(Collections.singleton(sample));
        insertSeriesCheck(Collections.singletonList(series));
    }
    SeriesQuery seriesQueryVersioned = new SeriesQuery(series);
    seriesQueryVersioned.setVersioned(true);
    seriesQueryVersioned.setExactMatch(false);
    List<Series> seriesListVersioned = querySeriesAsList(seriesQueryVersioned);
    List<String> textValuesVersioned = new ArrayList<>();
    for (Sample s : seriesListVersioned.get(0).getData()) {
        textValuesVersioned.add(s.getText());
    }
    assertEquals("Text field versioning is corrupted", Arrays.asList(data), textValuesVersioned);
}
Also used : SeriesQuery(com.axibase.tsd.api.model.series.query.SeriesQuery) ArrayList(java.util.ArrayList) Metric(com.axibase.tsd.api.model.metric.Metric) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 65 with Issue

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

the class SeriesInsertTest method testXTextField.

@Issue("3480")
@Test(dataProvider = "dataTextProvider")
public void testXTextField(String text) throws Exception {
    String entityName = entity();
    String metricName = metric();
    Series series = new Series(entityName, metricName);
    Sample sample = Sample.ofDateIntegerText("2016-10-11T13:00:00.000Z", 1, text);
    series.addSamples(sample);
    insertSeriesCheck(Collections.singletonList(series));
    SeriesQuery seriesQuery = new SeriesQuery(series);
    List<Series> seriesList = querySeriesAsList(seriesQuery);
    assertEquals("Stored series are incorrect", Collections.singletonList(series), seriesList);
}
Also used : SeriesQuery(com.axibase.tsd.api.model.series.query.SeriesQuery) 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