Search in sources :

Example 71 with Issue

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

the class SeriesQueryAggregateGroupOrderRateTest method testRateLimit.

@Issue("4729")
@Test(description = "test query result with rate limit")
public void testRateLimit() {
    SeriesQuery query = new SeriesQuery("*", TEST_METRIC, "2017-01-01T00:00:00Z", "2017-01-01T00:00:20Z");
    query.setRate(new Rate(new Period(10, TimeUnit.SECOND)));
    query.setLimit(1);
    query.setDirection("ASC");
    List<Series> result = querySeriesAsList(query);
    Series expectedSeries1 = createSeries(TEST_ENTITY1, Sample.ofDateDecimal("2017-01-01T00:00:03.000Z", new BigDecimal("10.0")));
    Series expectedSeries2 = createSeries(TEST_ENTITY2, Sample.ofDateDecimal("2017-01-01T00:00:02.000Z", new BigDecimal("10.0")));
    assertEquals(result, Arrays.asList(expectedSeries1, expectedSeries2), "Incorrect query result with group limit");
}
Also used : SeriesQuery(com.axibase.tsd.api.model.series.query.SeriesQuery) Rate(com.axibase.tsd.api.model.series.query.transformation.rate.Rate) Period(com.axibase.tsd.api.model.Period) BigDecimal(java.math.BigDecimal) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 72 with Issue

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

the class AuthenticationTest method seriesQueryTest.

@Issue("2870")
@Test
public void seriesQueryTest() throws Exception {
    List<SeriesQuery> seriesQueryList = Collections.singletonList(new SeriesQuery());
    Response response = SeriesMethod.executeQueryRaw(seriesQueryList, UNKNOWN_USER, UNKNOWN_USER_PASSWORD);
    assertEquals(Response.Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
    String errorMessage = extractErrorMessage(response);
    assertEquals("Wrong error message", USER_NOT_FOUND, errorMessage);
}
Also used : Response(javax.ws.rs.core.Response) SeriesQuery(com.axibase.tsd.api.model.series.query.SeriesQuery) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 73 with Issue

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

the class AuthenticationTest method seriesUrlQueryTest.

@Issue("2870")
@Test
public void seriesUrlQueryTest() throws Exception {
    Response response = SeriesMethod.urlQuerySeries("entity", "metric", OutputFormat.JSON, new HashMap<String, String>(), UNKNOWN_USER, UNKNOWN_USER_PASSWORD);
    assertEquals(Response.Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
    String errorMessage = extractErrorMessage(response);
    assertEquals("Wrong error message", USER_NOT_FOUND, errorMessage);
}
Also used : Response(javax.ws.rs.core.Response) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 74 with Issue

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

the class AuthenticationTest method seriesInsertTest.

@Issue("2870")
@Test
public void seriesInsertTest() throws Exception {
    List<Series> seriesQueryList = Collections.singletonList(new Series());
    Response response = SeriesMethod.insertSeries(seriesQueryList, UNKNOWN_USER, UNKNOWN_USER_PASSWORD);
    assertEquals(Response.Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
    String errorMessage = extractErrorMessage(response);
    assertEquals("Wrong error message", USER_NOT_FOUND, errorMessage);
}
Also used : Response(javax.ws.rs.core.Response) Series(com.axibase.tsd.api.model.series.Series) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 75 with Issue

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

the class AuthenticationTest method seriesCSVInsertTest.

@Issue("2870")
@Test
public void seriesCSVInsertTest() throws Exception {
    Response response = CSVInsertMethod.csvInsert("entity", "some csv", new HashMap<String, String>(), UNKNOWN_USER, UNKNOWN_USER_PASSWORD);
    assertEquals(Response.Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
    String errorMessage = extractErrorMessage(response);
    assertEquals("Wrong error message", USER_NOT_FOUND, errorMessage);
}
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