use of com.axibase.tsd.api.model.property.Property 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.Property 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.Property 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));
}
use of com.axibase.tsd.api.model.property.Property 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.Property 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));
}
Aggregations