Search in sources :

Example 51 with StringTable

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

the class SqlSelectMetricTagsTest method testSelectMetricSpecifiedTagCaseSensitivityFalse.

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

Example 52 with StringTable

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

the class SqlEntityGroupsWhereClauseTest method testEntityGroupsNotInCaseSensitivitySet.

@Issue("3020")
@Test
public void testEntityGroupsNotInCaseSensitivitySet() {
    EntityGroupMethod.addEntities(TEST_ENTITY_GROUP1_NAME, Collections.singletonList(TEST_ENTITY_NAME));
    String sqlQuery = String.format("SELECT datetime, entity, value, entity.groups FROM \"%s\" %n" + "WHERE entity.groups NOT IN ('%s') %nAND datetime = '2016-07-14T15:00:07.000Z' %n", TEST_METRIC_NAME, TEST_CASE_SENSITIVITY_GROUP_NAME);
    StringTable resultTable = queryResponse(sqlQuery).readEntity(StringTable.class);
    List<List<String>> expectedRows = Collections.singletonList(Arrays.asList("2016-07-14T15:00:07.000Z", TEST_ENTITY_NAME, "0", TEST_ENTITY_GROUP1_NAME));
    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 53 with StringTable

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

the class SqlEntityGroupsWhereClauseTest method testEntityGroupsNotInSet.

@Issue("3020")
@Test
public void testEntityGroupsNotInSet() {
    EntityGroupMethod.addEntities(TEST_ENTITY_GROUP1_NAME, Collections.singletonList(TEST_ENTITY_NAME));
    String sqlQuery = String.format("SELECT datetime, entity, value, entity.groups FROM \"%s\" %n" + "WHERE entity.groups IN ('%s', 'group', '%s')   %nAND datetime = '2016-07-14T15:00:07.000Z' %n", TEST_METRIC_NAME, TEST_ENTITY_GROUP1_NAME, TEST_ENTITY_GROUP2_NAME);
    StringTable resultTable = queryResponse(sqlQuery).readEntity(StringTable.class);
    List<List<String>> expectedRows = Collections.singletonList(Arrays.asList("2016-07-14T15:00:07.000Z", TEST_ENTITY_NAME, "0", TEST_ENTITY_GROUP1_NAME));
    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 54 with StringTable

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

the class SqlEntityGroupsWhereClauseTest method testEntityGroupsNotInOneElementSet.

@Issue("3020")
@Test
public void testEntityGroupsNotInOneElementSet() {
    EntityGroupMethod.addEntities(TEST_ENTITY_GROUP1_NAME, Collections.singletonList(TEST_ENTITY_NAME));
    String sqlQuery = String.format("SELECT datetime, entity, value, entity.groups FROM \"%s\" %n" + "WHERE NOT entity.groups IN ('%s')   %nAND datetime = '2016-07-14T15:00:07.000Z' %n", TEST_METRIC_NAME, TEST_ENTITY_GROUP1_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)

Example 55 with StringTable

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

the class SqlEntityGroupsWhereClauseTest method testEntityGroupsInCaseSensitivitySet.

@Issue("3020")
@Test
public void testEntityGroupsInCaseSensitivitySet() {
    EntityGroupMethod.addEntities(TEST_ENTITY_GROUP1_NAME, Collections.singletonList(TEST_ENTITY_NAME));
    String sqlQuery = String.format("SELECT datetime, entity, value, entity.groups FROM \"%s\" %n" + "WHERE entity.groups IN ('%s') %nAND datetime = '2016-07-14T15:00:07.000Z' %n", TEST_METRIC_NAME, TEST_CASE_SENSITIVITY_GROUP_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