Search in sources :

Example 56 with StringTable

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

the class SqlEntityGroupsWhereClauseTest method testTwoEntityGroupsIntersectingOneElementSet.

@Issue("3020")
@Test
public void testTwoEntityGroupsIntersectingOneElementSet() {
    EntityGroupMethod.addEntities(TEST_ENTITY_GROUP1_NAME, Collections.singletonList(TEST_ENTITY_NAME));
    EntityGroupMethod.addEntities(TEST_ENTITY_GROUP2_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_ENTITY_GROUP1_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 + ';' + TEST_ENTITY_GROUP2_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 57 with StringTable

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

the class SqlEntityGroupsWhereClauseTest method testCaseSensitivityEntityGroupsNotInSet.

@Issue("3020")
@Test
public void testCaseSensitivityEntityGroupsNotInSet() {
    EntityGroupMethod.addEntities(TEST_CASE_SENSITIVITY_GROUP_NAME, Collections.singletonList(TEST_ENTITY_NAME));
    String sqlQuery = String.format("SELECT datetime, entity, value, entity.groups FROM \"%s\" %nWHERE entity.groups NOT IN ('%s')   %n" + "AND 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)

Example 58 with StringTable

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

the class SqlEntityGroupsWhereClauseTest method testZeroEntityGroupsIntersectingTwoElementSet.

@Issue("3020")
@Test
public void testZeroEntityGroupsIntersectingTwoElementSet() {
    String sqlQuery = String.format("SELECT datetime, entity, value, entity.groups FROM \"%s\" %n" + "WHERE entity.groups IN ('group-1', 'group-2') %nAND datetime = '2016-07-14T15:00:07.000Z' %n", TEST_METRIC_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 59 with StringTable

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

the class SqlEntityGroupsWhereClauseTest method testZeroEntityGroupsNotIntersectingTwoElementSet.

@Issue("3020")
@Test
public void testZeroEntityGroupsNotIntersectingTwoElementSet() {
    String sqlQuery = String.format("SELECT datetime, entity, value, entity.groups FROM \"%s\" %n" + "WHERE entity.groups NOT IN ('group-1', 'group-2') %nAND datetime = '2016-07-14T15:00:07.000Z' %n", TEST_METRIC_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", "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 60 with StringTable

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

the class SqlEntityGroupsWhereClauseTest method testCaseSensitivityEntityGroupsInSet.

@Issue("3020")
@Test
public void testCaseSensitivityEntityGroupsInSet() {
    EntityGroupMethod.addEntities(TEST_CASE_SENSITIVITY_GROUP_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.singletonList(Arrays.asList("2016-07-14T15:00:07.000Z", TEST_ENTITY_NAME, "0", TEST_CASE_SENSITIVITY_GROUP_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)

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