Search in sources :

Example 66 with StringTable

use of com.axibase.tsd.api.model.sql.StringTable in project atsd-api-test by axibase.

the class SqlClauseWhereWithLimitDoubleTest method testMathematicalFunction.

@Issue("3282")
@Test
public void testMathematicalFunction() {
    String sqlQuery = String.format("SELECT value FROM \"%s\"%nWHERE  sqrt(1.01) > value LIMIT 1", TEST_METRIC_NAME);
    Response response = queryResponse(sqlQuery);
    StringTable resultTable = response.readEntity(StringTable.class);
    List<List<String>> expectedRows = Collections.singletonList(Collections.singletonList("0.89"));
    assertTableRowsExist(expectedRows, resultTable);
}
Also used : Response(javax.ws.rs.core.Response) StringTable(com.axibase.tsd.api.model.sql.StringTable) List(java.util.List) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test) SqlTest(com.axibase.tsd.api.method.sql.SqlTest)

Example 67 with StringTable

use of com.axibase.tsd.api.model.sql.StringTable in project atsd-api-test by axibase.

the class SqlClauseWhereWithLimitDoubleTest method testValueAsRightOperand.

@Issue("3282")
@Test
public void testValueAsRightOperand() {
    String sqlQuery = String.format("SELECT value FROM \"%s\"%nWHERE  1.01 > value LIMIT 1", TEST_METRIC_NAME);
    Response response = queryResponse(sqlQuery);
    StringTable resultTable = response.readEntity(StringTable.class);
    List<List<String>> expectedRows = Collections.singletonList(Collections.singletonList("0.89"));
    assertTableRowsExist(expectedRows, resultTable);
}
Also used : Response(javax.ws.rs.core.Response) StringTable(com.axibase.tsd.api.model.sql.StringTable) List(java.util.List) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test) SqlTest(com.axibase.tsd.api.method.sql.SqlTest)

Example 68 with StringTable

use of com.axibase.tsd.api.model.sql.StringTable in project atsd-api-test by axibase.

the class SqlEntityTagsTest method testIsNullOperator.

@Issue("2926")
@Test
public void testIsNullOperator() {
    String sqlQuery = String.format("SELECT entity.tags.tag4 FROM \"%s\"%nWHERE datetime='2016-06-19T11:00:00.000Z' " + "AND entity.tags.tag4 IS NULL AND entity = '%s'", TEST_METRIC_NAME, TEST_ENTITY_NAME);
    StringTable resultTable = queryResponse(sqlQuery).readEntity(StringTable.class);
    List<List<String>> expectedRows = Collections.singletonList(Collections.singletonList("null"));
    assertTableRowsExist(expectedRows, resultTable);
}
Also used : StringTable(com.axibase.tsd.api.model.sql.StringTable) List(java.util.List) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test) SqlTest(com.axibase.tsd.api.method.sql.SqlTest)

Example 69 with StringTable

use of com.axibase.tsd.api.model.sql.StringTable in project atsd-api-test by axibase.

the class SqlEntityTagsTest method testNotEqualsOperator.

@Issue("2926")
@Test
public void testNotEqualsOperator() {
    String sqlQuery = String.format("SELECT entity.tags.tag1 FROM \"%s\" %n" + "WHERE datetime='2016-06-19T11:00:00.000Z' AND entity.tags.tag1 <> 'val2' %nAND entity = '%s'", TEST_METRIC_NAME, TEST_ENTITY_NAME);
    StringTable resultTable = queryResponse(sqlQuery).readEntity(StringTable.class);
    List<List<String>> expectedRows = Collections.singletonList(Collections.singletonList("val1"));
    assertTableRowsExist(expectedRows, resultTable);
}
Also used : StringTable(com.axibase.tsd.api.model.sql.StringTable) List(java.util.List) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test) SqlTest(com.axibase.tsd.api.method.sql.SqlTest)

Example 70 with StringTable

use of com.axibase.tsd.api.model.sql.StringTable in project atsd-api-test by axibase.

the class SqlEntityTagsTest method testIsNotNullOperator.

@Issue("2926")
@Test
public void testIsNotNullOperator() {
    String sqlQuery = String.format("SELECT entity.tags.tag4 FROM \"%s\" %n" + "WHERE datetime='2016-06-19T11:00:00.000Z' AND entity.tags.tag4 IS NOT NULL %n" + "AND entity = '%s'", TEST_METRIC_NAME, TEST_ENTITY_NAME);
    StringTable resultTable = queryResponse(sqlQuery).readEntity(StringTable.class);
    List<List<String>> expectedRows = Collections.emptyList();
    assertTableRowsExist(expectedRows, resultTable);
}
Also used : StringTable(com.axibase.tsd.api.model.sql.StringTable) List(java.util.List) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test) SqlTest(com.axibase.tsd.api.method.sql.SqlTest)

Aggregations

StringTable (com.axibase.tsd.api.model.sql.StringTable)277 Test (org.testng.annotations.Test)276 SqlTest (com.axibase.tsd.api.method.sql.SqlTest)275 Issue (io.qameta.allure.Issue)270 List (java.util.List)147 Response (javax.ws.rs.core.Response)49 ArrayList (java.util.ArrayList)23 Series (com.axibase.tsd.api.model.series.Series)4 BigDecimal (java.math.BigDecimal)1 Date (java.util.Date)1 BeforeTest (org.testng.annotations.BeforeTest)1