Search in sources :

Example 96 with Issue

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

the class CastTest method testImplicitCastInMathExpressionsRizesError.

@Issue("4020")
@Test
public void testImplicitCastInMathExpressionsRizesError() throws Exception {
    Series series = Mocks.series();
    SeriesMethod.insertSeriesCheck(series);
    String sql = String.format("SELECT CONCAT(value, '')+10%n" + "FROM \"%s\"", series.getMetric());
    assertBadRequest("Math expression with string variable applied", "Invalid expression: 'concat(value, '') + 10'", queryResponse(sql));
}
Also used : Series(com.axibase.tsd.api.model.series.Series) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test) SqlTest(com.axibase.tsd.api.method.sql.SqlTest)

Example 97 with Issue

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

the class IsNullTest method testIsNullInExpression.

@Issue("3844")
@Test
public void testIsNullInExpression() throws Exception {
    String sqlQuery = String.format("SELECT ROUND(100 - ISNULL(value, 0)) FROM \"%s\"", TEST_METRIC);
    StringTable resultTable = queryResponse(sqlQuery).readEntity(StringTable.class);
    String[][] expectedRows = { { "-23.0" } };
    assertTableRowsExist(expectedRows, resultTable);
}
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 98 with Issue

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

the class IsNullTest method testTypePreserved.

@Issue("3675")
@Test(dataProvider = "typeCheckTestProvider")
public void testTypePreserved(String from, String to, String type) throws Exception {
    String sqlQuery = String.format("SELECT ISNULL(%s, %s) FROM \"m-test-type-preserve-1\"", from, to);
    StringTable table = queryTable(sqlQuery, 1);
    assertEquals("wrong ISNULL result data type", type, table.getColumnMetaData(0).getDataType());
}
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 99 with Issue

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

the class MetaDataTest method testMetaEmptyExistentTagsExpansion.

@Issue("4363")
@Issue("4374")
@Test
public void testMetaEmptyExistentTagsExpansion() throws Exception {
    Metric existentMetric = new Metric(Mocks.metric());
    MetricMethod.createOrReplaceMetricCheck(existentMetric);
    String sqlQuery = String.format("SELECT tags.* FROM \"%s\"", NON_EXISTENT_METRIC_1);
    String[] expectedNames = {};
    String[] expectedTypes = {};
    assertSqlMetaNamesAndTypes("Wrong /api/sql/meta tags expansion for existent metric", expectedNames, expectedTypes, sqlQuery);
}
Also used : Metric(com.axibase.tsd.api.model.metric.Metric) Issue(io.qameta.allure.Issue) SqlMetaTest(com.axibase.tsd.api.method.sql.SqlMetaTest) Test(org.testng.annotations.Test)

Example 100 with Issue

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

the class LikeOperatorTest method testMultipleLikeMetricOperatorsAnd.

@Issue("4083")
@Test
public void testMultipleLikeMetricOperatorsAnd() {
    String sqlQuery = String.format("SELECT metric " + "FROM atsd_series " + "WHERE metric LIKE '%1$s-first-__' AND metric LIKE '%1$s-first-2%%'" + "ORDER BY metric ", TEST_METRIC_PREFIX);
    StringTable table = SqlMethod.queryTable(sqlQuery);
    assertTableContainsColumnValues(TEST_METRICS.subList(20, 30), table, "metric");
}
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)

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