use of com.axibase.tsd.api.model.property.PropertyQuery in project atsd-api-test by axibase.
the class PropertyDeleteTest method testMultipleTypeEntityExactTrue.
@Test
public void testMultipleTypeEntityExactTrue() throws Exception {
final Property property = new Property("delete-type3", "delete-entity3");
property.addTag("t1", "v1");
property.addKey("k1", "v1");
insertPropertyCheck(property);
Property secondProperty = new Property();
secondProperty.setType(property.getType());
secondProperty.setEntity(property.getEntity());
secondProperty.addKey("k2", "v2");
secondProperty.setTags(property.getTags());
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());
assertTrue("First property should remain", 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 PropertyDeleteTest method testTypeTooLong.
@Test
public void testTypeTooLong() throws Exception {
final Property property = new Property(appendChar(new StringBuilder(), 'a', 10000).append("type-161").toString(), "delete-entity161");
property.addTag("t1", "v1");
property.addKey("k1", "v1");
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 testKeyNameTooLong.
@Test
public void testKeyNameTooLong() throws Exception {
final Property property = new Property("delete-type-6.4", "delete-entity6.4");
property.addTag("t1", "v1");
property.addKey(appendChar(new StringBuilder(), 'a', 10000).append("-key").toString(), "kv1");
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 testTimestampZeroDateFilterMatch.
@Test
public void testTimestampZeroDateFilterMatch() throws Exception {
final Property property = new Property("delete-type19", "delete-entity19");
property.addTag("t1", "v1");
property.setDate(MIN_STORABLE_DATE);
insertPropertyCheck(property);
assertTrue(propertyExist(property));
PropertyQuery deleteQuery = new PropertyQuery();
deleteQuery.setType(property.getType());
deleteQuery.setEntity(property.getEntity());
deleteQuery.setStartDate(property.getDate());
deleteQuery.setEndDate(Util.addOneMS(property.getDate()));
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 PropertyDeleteTest method testKeyCountTooMuch.
@Test
public void testKeyCountTooMuch() throws Exception {
final Integer count = 1000;
final Property property = new Property("delete-type-6.6", "delete-entity6.6");
property.addTag("t1", "v1");
for (int i = 0; i < count; i++) {
property.addKey("key_name-" + String.valueOf(i), "key_value-" + String.valueOf(i));
}
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));
}
Aggregations