use of com.axibase.tsd.api.model.property.PropertyQuery in project atsd-api-test by axibase.
the class PropertyDeleteTest method testCommonTypeEntityTypeEntityKey.
@Test
public void testCommonTypeEntityTypeEntityKey() throws Exception {
final Property property = new Property("delete-type-6", "delete-entity6");
property.addTag("t1", "v1");
property.addKey("k1", "v1");
insertPropertyCheck(property);
Property secondProperty = new Property(null, "delete-entity6-2");
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.setKey(property.getKey());
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 PropertyDeleteTest method testKeyValueEmptyExactTrue.
@Issue("2416")
@Test
public void testKeyValueEmptyExactTrue() throws Exception {
final Property property = new Property("delete-type-24", "delete-entity24");
property.addTag("t1", "v1");
insertPropertyCheck(property);
PropertyQuery deleteQuery = new PropertyQuery();
deleteQuery.setType(property.getType());
deleteQuery.setEntity(property.getEntity());
deleteQuery.addKey("k1", "");
deleteQuery.setExactMatch(true);
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 testKeyValueContainsSpaces.
@Issue("2416")
@Test
public void testKeyValueContainsSpaces() throws Exception {
final Property property = new Property("delete-type-27", "delete-entity27");
property.addTag("t1", "v1");
property.addKey("k1", "kv1");
insertPropertyCheck(property);
PropertyQuery deleteQuery = new PropertyQuery();
deleteQuery.setType(property.getType());
deleteQuery.setEntity(property.getEntity());
deleteQuery.addKey("k1", " kv1 ");
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 testTypeStartEndRaiseError.
@Test
public void testTypeStartEndRaiseError() throws Exception {
PropertyQuery deleteQuery = new PropertyQuery();
deleteQuery.setType("mock-type");
deleteQuery.setStartDate(MIN_QUERYABLE_DATE);
deleteQuery.setEndDate(MAX_QUERYABLE_DATE);
assertEquals("Fail to execute delete query", BAD_REQUEST.getStatusCode(), deleteProperty(deleteQuery).getStatus());
}
use of com.axibase.tsd.api.model.property.PropertyQuery in project atsd-api-test by axibase.
the class PropertyDeleteTest method testTypeOnlyRaiseError.
@Test
public void testTypeOnlyRaiseError() throws Exception {
PropertyQuery deleteQuery = new PropertyQuery();
deleteQuery.setType("mock-type");
assertEquals("Fail to execute delete query", BAD_REQUEST.getStatusCode(), deleteProperty(deleteQuery).getStatus());
}
Aggregations