Search in sources :

Example 66 with PropertyQuery

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

the class PropertyDeleteTest method testTimestampZeroNoDateFilterExactMatch.

@Test
public void testTimestampZeroNoDateFilterExactMatch() throws Exception {
    final Property property = new Property("delete-type21", "delete-entity21");
    property.addTag("t1", "v1");
    property.setDate(MIN_STORABLE_DATE);
    insertPropertyCheck(property);
    PropertyQuery deleteQuery = new PropertyQuery();
    deleteQuery.setType(property.getType());
    deleteQuery.setEntity(property.getEntity());
    deleteQuery.setExactMatch(true);
    assertEquals("Fail to execute delete query", OK.getStatusCode(), deleteProperty(deleteQuery).getStatus());
    assertFalse("Property should be removed", propertyExist(property));
}
Also used : PropertyQuery(com.axibase.tsd.api.model.property.PropertyQuery) Property(com.axibase.tsd.api.model.property.Property) Test(org.testng.annotations.Test)

Example 67 with PropertyQuery

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

the class PropertyQueryTimezoneTest method testMillisecondsUnsupported.

@Issue("2850")
@Test
public void testMillisecondsUnsupported() throws Exception {
    PropertyQuery propertyQuery = buildPropertyQuery();
    propertyQuery.setStartDate("1469059200000");
    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", "1469059200000"), 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 68 with PropertyQuery

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

the class PropertyQueryTimezoneTest method testLocalTimeUnsupported.

@Issue("2850")
@Test
public void testLocalTimeUnsupported() throws Exception {
    PropertyQuery propertyQuery = buildPropertyQuery();
    propertyQuery.setStartDate("2016-07-21 00:00:00");
    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-21 00:00:00"), 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 69 with PropertyQuery

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

the class PropertyQueryTimezoneTest method testISOTimezoneZ.

@Issue("2850")
@Test
public void testISOTimezoneZ() throws Exception {
    PropertyQuery propertyQuery = buildPropertyQuery();
    propertyQuery.setStartDate("2016-05-21T00:00:00Z");
    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", property.getDate(), storedProperty.getDate());
}
Also used : PropertyQuery(com.axibase.tsd.api.model.property.PropertyQuery) List(java.util.List) Property(com.axibase.tsd.api.model.property.Property) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 70 with PropertyQuery

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

the class PropertyQueryTimezoneTest method buildPropertyQuery.

private PropertyQuery buildPropertyQuery() {
    PropertyQuery propertyQuery = new PropertyQuery();
    propertyQuery.setType(property.getType());
    propertyQuery.setEntity(property.getEntity());
    propertyQuery.setInterval(new Period(1, TimeUnit.MILLISECOND));
    return propertyQuery;
}
Also used : PropertyQuery(com.axibase.tsd.api.model.property.PropertyQuery) Period(com.axibase.tsd.api.model.Period)

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