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));
}
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));
}
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));
}
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());
}
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;
}
Aggregations