Search in sources :

Example 71 with PropertyQuery

use of com.axibase.tsd.api.model.property.PropertyQuery in project atsd-api-test by axibase.

the class PropertyQueryTimezoneTest method testXXTimezoneUnsupported.

@Issue("2850")
@Test
public void testXXTimezoneUnsupported() throws Exception {
    PropertyQuery propertyQuery = buildPropertyQuery();
    propertyQuery.setStartDate("2016-07-20T22:50:00-0110");
    Response response = queryProperty(propertyQuery);
    assertEquals("Incorrect response status code", BAD_REQUEST.getStatusCode(), response.getStatus());
    assertEquals("Error message mismatch", String.format(DATE_FILTER_WRONG_SYNTAX_TPL, "startDate", "2016-07-20T22:50:00-0110"), extractErrorMessage(response));
}
Also used : Response(javax.ws.rs.core.Response) PropertyQuery(com.axibase.tsd.api.model.property.PropertyQuery) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 72 with PropertyQuery

use of com.axibase.tsd.api.model.property.PropertyQuery in project atsd-api-test by axibase.

the class PropertyInsertTest method testISOTimezoneMinusHourMinute.

@Issue("2850")
@Test
public void testISOTimezoneMinusHourMinute() throws Exception {
    String entityName = "property-insert-test-iso-hm";
    Property property = new Property("test3", entityName);
    property.addTag("test", "test");
    property.setDate("2016-07-20T22:37:00-01:23");
    insertProperty(property);
    PropertyQuery propertyQuery = new PropertyQuery();
    propertyQuery.setType(property.getType());
    propertyQuery.setEntity(entityName);
    propertyQuery.setStartDate("2016-07-21T00:00:00.000Z");
    propertyQuery.setInterval(new Period(1, TimeUnit.MILLISECOND));
    List<Property> storedPropertyList = queryProperty(propertyQuery).readEntity(new GenericType<List<Property>>() {
    });
    Property storedProperty = storedPropertyList.get(0);
    assertEquals("Incorrect property entity", property.getEntity(), storedProperty.getEntity());
    assertEquals("Incorrect property tags", property.getTags(), storedProperty.getTags());
    assertEquals("Incorrect property date", propertyQuery.getStartDate(), storedProperty.getDate());
}
Also used : PropertyQuery(com.axibase.tsd.api.model.property.PropertyQuery) Period(com.axibase.tsd.api.model.Period) List(java.util.List) Property(com.axibase.tsd.api.model.property.Property) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 73 with PropertyQuery

use of com.axibase.tsd.api.model.property.PropertyQuery in project atsd-api-test by axibase.

the class PropertyInsertTest method testISOTimezonePlusHourMinute.

@Issue("2850")
@Test
public void testISOTimezonePlusHourMinute() throws Exception {
    String entityName = "property-insert-test-iso+hm";
    Property property = new Property("test2", entityName);
    property.addTag("test", "test");
    property.setDate("2016-07-21T01:23:00+01:23");
    insertProperty(property);
    PropertyQuery propertyQuery = new PropertyQuery();
    propertyQuery.setType(property.getType());
    propertyQuery.setEntity(entityName);
    propertyQuery.setStartDate("2016-07-21T00:00:00.000Z");
    propertyQuery.setInterval(new Period(1, TimeUnit.MILLISECOND));
    List<Property> storedPropertyList = queryProperty(propertyQuery).readEntity(new GenericType<List<Property>>() {
    });
    Property storedProperty = storedPropertyList.get(0);
    assertEquals("Incorrect property entity", property.getEntity(), storedProperty.getEntity());
    assertEquals("Incorrect property tags", property.getTags(), storedProperty.getTags());
    assertEquals("Incorrect property date", propertyQuery.getStartDate(), storedProperty.getDate());
}
Also used : PropertyQuery(com.axibase.tsd.api.model.property.PropertyQuery) Period(com.axibase.tsd.api.model.Period) List(java.util.List) Property(com.axibase.tsd.api.model.property.Property) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 74 with PropertyQuery

use of com.axibase.tsd.api.model.property.PropertyQuery in project atsd-api-test by axibase.

the class PropertyQueryTest method testKeyTagExpressionUpperTag.

@Issue("2908")
@Test
public void testKeyTagExpressionUpperTag() throws Exception {
    final Property property = new Property("query-type53", "query-entity53");
    property.addTag("t1", "tv1");
    insertPropertyCheck(property);
    PropertyQuery query = prepareSimplePropertyQuery(property.getType(), property.getEntity());
    query.setKeyTagExpression("upper(tags.t1) == 'TV1'");
    assertInsertedPropertyReturned(property, query);
}
Also used : PropertyQuery(com.axibase.tsd.api.model.property.PropertyQuery) Property(com.axibase.tsd.api.model.property.Property) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 75 with PropertyQuery

use of com.axibase.tsd.api.model.property.PropertyQuery in project atsd-api-test by axibase.

the class PropertyQueryTest method testKeyValueSpaces.

@Issue("2416")
@Test
public void testKeyValueSpaces() throws Exception {
    final Property property = new Property("query-type-65", "query-entity65");
    property.addTag("t1", "v1");
    insertPropertyCheck(property);
    PropertyQuery query = prepareSimplePropertyQuery(property.getType(), property.getEntity());
    query.addKey("k1", "      ");
    assertStoredPropertyDoesNotMatchToInserted(property, query);
}
Also used : PropertyQuery(com.axibase.tsd.api.model.property.PropertyQuery) Property(com.axibase.tsd.api.model.property.Property) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Aggregations

PropertyQuery (com.axibase.tsd.api.model.property.PropertyQuery)112 Test (org.testng.annotations.Test)109 Property (com.axibase.tsd.api.model.property.Property)94 Issue (io.qameta.allure.Issue)44 Entity (com.axibase.tsd.api.model.entity.Entity)12 Response (javax.ws.rs.core.Response)11 Period (com.axibase.tsd.api.model.Period)6 List (java.util.List)6 NotCheckedException (com.axibase.tsd.api.util.NotCheckedException)1