Search in sources :

Example 36 with StringTable

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

the class SqlSelectAllTagsOrderTest method testSelectAllTagsAndColumnBefore.

@Issue("3166")
@Test
public void testSelectAllTagsAndColumnBefore() {
    String sqlQuery = String.format("SELECT entity, tags.* FROM \"%s\"", TEST_METRIC_NAME);
    StringTable resultTable = queryResponse(sqlQuery).readEntity(StringTable.class);
    List<String> expectedColumnNames = sortedColumnNames(sortedTagsKeys(tags), "tags", false);
    expectedColumnNames.add(0, "entity");
    assertTableColumnsNames(expectedColumnNames, resultTable, true);
}
Also used : StringTable(com.axibase.tsd.api.model.sql.StringTable) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test) SqlTest(com.axibase.tsd.api.method.sql.SqlTest)

Example 37 with StringTable

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

the class SqlSelectAllTagsOrderTest method testSelectAllMetricTagsAndColumnBefore.

@Issue("3166")
@Test
public void testSelectAllMetricTagsAndColumnBefore() {
    String sqlQuery = String.format("SELECT entity, metric.tags.* FROM \"%s\"", TEST_METRIC_NAME);
    StringTable resultTable = queryResponse(sqlQuery).readEntity(StringTable.class);
    List<String> expectedColumnNames = sortedColumnNames(sortedTagsKeys(tags), "metric.tags", false);
    expectedColumnNames.add(0, "entity");
    assertTableColumnsNames(expectedColumnNames, resultTable, true);
}
Also used : StringTable(com.axibase.tsd.api.model.sql.StringTable) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test) SqlTest(com.axibase.tsd.api.method.sql.SqlTest)

Example 38 with StringTable

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

the class SqlSelectAllTagsOrderTest method testSelectAllSeriesMetricTags.

@Issue("3166")
@Test
public void testSelectAllSeriesMetricTags() {
    String sqlQuery = String.format("SELECT metric.tags.* FROM \"%s\"", TEST_METRIC_NAME);
    StringTable resultTable = queryResponse(sqlQuery).readEntity(StringTable.class);
    List<String> expectedColumnNames = sortedColumnNames(sortedTagsKeys(tags), "metric.tags", false);
    assertTableColumnsNames(expectedColumnNames, resultTable, true);
}
Also used : StringTable(com.axibase.tsd.api.model.sql.StringTable) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test) SqlTest(com.axibase.tsd.api.method.sql.SqlTest)

Example 39 with StringTable

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

the class SqlSelectLiteralTest method testSelectLiteral.

@Issue("3837")
@Test(dataProvider = "literalAndResultProvider")
public void testSelectLiteral(String literal, String result) {
    String sqlQuery = String.format("SELECT %s FROM \"%s\"", literal, metricName);
    StringTable resultTable = queryTable(sqlQuery);
    List<List<String>> res = resultTable.filterRows(literal);
    assertFalse(String.format("No column with name %s", literal), res.get(0).isEmpty());
    assertEquals("Column value is not as expected", res.get(0).get(0), result);
}
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 40 with StringTable

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

the class SqlSelectMetricTagsTest method testSelectMetricTags.

@Issue("3056")
@Test
public void testSelectMetricTags() {
    String sqlQuery = String.format("SELECT metric.tags %nFROM \"%s\" %nWHERE datetime = '2016-06-29T08:00:00.000Z'AND entity='%s' %n", TEST_METRIC_NAME, TEST_ENTITY_NAME);
    StringTable resultTable = queryResponse(sqlQuery).readEntity(StringTable.class);
    assertTableColumnsNames(Collections.singletonList("metric.tags"), resultTable);
    List<List<String>> expectedRows = Collections.singletonList(Collections.singletonList("a=b;a-b=b-c;b=c;tag=V"));
    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