use of com.axibase.tsd.api.model.property.PropertyQuery in project atsd-api-test by axibase.
the class PropertyDeleteTest method testKeyValueTooLong.
@Test
public void testKeyValueTooLong() throws Exception {
final Property property = new Property("delete-type-6.5", "delete-entity6.5");
property.addTag("t1", "v1");
property.addKey("kv1", appendChar(new StringBuilder(), 'a', 10000).append("-value").toString());
insertPropertyCheck(property);
PropertyQuery deleteQuery = new PropertyQuery();
deleteQuery.setType(property.getType());
deleteQuery.setEntity(property.getEntity());
deleteQuery.setKey(property.getKey());
assertEquals("Fail to execute delete query", OK.getStatusCode(), deleteProperty(deleteQuery).getStatus());
assertFalse("Property should be deleted", propertyExist(property));
}
use of com.axibase.tsd.api.model.property.PropertyQuery in project atsd-api-test by axibase.
the class PropertyDeleteTest method testEmptyKeyExactTrue.
@Test
public void testEmptyKeyExactTrue() throws Exception {
final Property property = new Property("delete-type-6.1", "delete-entity6.1");
property.addTag("t1", "v1");
insertPropertyCheck(property);
Property secondProperty = new Property();
secondProperty.setType(property.getType());
secondProperty.setEntity(property.getEntity());
secondProperty.setType(property.getType());
secondProperty.setTags(property.getTags());
secondProperty.addKey("k2", "v2");
insertPropertyCheck(secondProperty);
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("First property should be deleted", propertyExist(property));
assertTrue("Second property should remain", propertyExist(secondProperty));
}
use of com.axibase.tsd.api.model.property.PropertyQuery in project atsd-api-test by axibase.
the class PropertyQueryTimezoneTest method testISOTimezonePlusHourMinute.
@Issue("2850")
@Test
public void testISOTimezonePlusHourMinute() throws Exception {
PropertyQuery propertyQuery = buildPropertyQuery();
propertyQuery.setStartDate("2016-05-21T01:23:00+01:23");
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 testISOTimezoneMinusHourMinute.
@Issue("2850")
@Test
public void testISOTimezoneMinusHourMinute() throws Exception {
PropertyQuery propertyQuery = buildPropertyQuery();
propertyQuery.setStartDate("2016-05-20T22:37:00-01:23");
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 PropertyMethod method propertyTypeExist.
public static boolean propertyTypeExist(String propertyType) {
final PropertyQuery q = new PropertyQuery();
q.setEntity("*");
q.setType(propertyType);
q.setStartDate(MIN_STORABLE_DATE);
q.setEndDate(MAX_STORABLE_DATE);
q.setLimit(1);
final Response response = queryProperty(q);
if (response.getStatus() != OK.getStatusCode()) {
throw new NotCheckedException("Fail to execute property query");
}
String given = response.readEntity(String.class);
if ("[]".equals(given)) {
return false;
} else
return true;
}
Aggregations