use of com.axibase.tsd.api.model.property.PropertyQuery in project atsd-api-test by axibase.
the class PropertyDeleteTest method testEntityTooLong.
@Test
public void testEntityTooLong() throws Exception {
final Property property = new Property("delete-type-18", appendChar(new StringBuilder(), 'a', 5000).append("type-18").toString());
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 testExtraKeyExactFalse.
@Test
public void testExtraKeyExactFalse() throws Exception {
final Property property = new Property("delete-type13", "delete-entity13");
property.addTag("t1", "v1");
property.addKey("k1", "kv1");
insertPropertyCheck(property);
PropertyQuery deleteQuery = new PropertyQuery();
deleteQuery.setType(property.getType());
deleteQuery.setEntity(property.getEntity());
deleteQuery.setKey(property.getKey());
deleteQuery.addKey("k2", "kv2");
deleteQuery.setExactMatch(false);
assertEquals("Fail to execute delete query", OK.getStatusCode(), deleteProperty(deleteQuery).getStatus());
assertTrue("Property should remain", propertyExist(property));
}
use of com.axibase.tsd.api.model.property.PropertyQuery in project atsd-api-test by axibase.
the class PropertyDeleteTest method testEntityTagsExactTrue.
@Test
public void testEntityTagsExactTrue() throws Exception {
final String entityTagsType = "$entity_tags";
final Entity entity = new Entity("delete-entity10");
entity.addTag("t1", "v1");
entity.addTag("t2", "v2");
final Property property = new Property();
property.setType(entityTagsType);
property.setEntity(entity.getName());
property.setTags(entity.getTags());
EntityMethod.createOrReplaceEntityCheck(entity);
assertTrue(propertyExist(property));
PropertyQuery deleteQuery = new PropertyQuery();
deleteQuery.setType("$entity_tags");
deleteQuery.setEntity(entity.getName());
deleteQuery.setExactMatch(true);
assertEquals("Fail to execute delete query", OK.getStatusCode(), deleteProperty(deleteQuery).getStatus());
assertTrue(propertyExist(property));
}
use of com.axibase.tsd.api.model.property.PropertyQuery in project atsd-api-test by axibase.
the class PropertyDeleteTest method testTypeEntityExactFalse.
@Test
public void testTypeEntityExactFalse() throws Exception {
final Property property = new Property("delete-type-5", "delete-entity5");
property.addTag("t1", "v1");
property.addKey("k1", "v1");
insertPropertyCheck(property);
Property secondProperty = new Property();
secondProperty.setType(property.getType());
secondProperty.setEntity(property.getEntity());
secondProperty.setTags(property.getTags());
secondProperty.addKey("k2", "v2");
insertPropertyCheck(secondProperty);
PropertyQuery deleteQuery = new PropertyQuery();
deleteQuery.setType(property.getType());
deleteQuery.setEntity(property.getEntity());
deleteQuery.setExactMatch(false);
assertEquals("Fail to execute delete query", OK.getStatusCode(), deleteProperty(deleteQuery).getStatus());
assertFalse("First property should be deleted", propertyExist(property));
assertFalse("Second property should be deleted", propertyExist(secondProperty));
}
use of com.axibase.tsd.api.model.property.PropertyQuery in project atsd-api-test by axibase.
the class PropertyDeleteTest method testTimestampZeroNoDateFilter.
@Test
public void testTimestampZeroNoDateFilter() throws Exception {
final Property property = new Property("delete-type20", "delete-entity20");
property.addTag("t1", "v1");
property.setDate(MIN_STORABLE_DATE);
insertPropertyCheck(property);
PropertyQuery deleteQuery = new PropertyQuery();
deleteQuery.setType(property.getType());
deleteQuery.setEntity(property.getEntity());
assertEquals("Fail to execute delete query", OK.getStatusCode(), deleteProperty(deleteQuery).getStatus());
assertFalse("Property should be removed", propertyExist(property));
}
Aggregations