use of com.axibase.tsd.api.model.property.PropertyQuery in project atsd-api-test by axibase.
the class PropertyDeleteTest method testKeyValueEmptyExactFalse.
@Issue("2416")
@Test
public void testKeyValueEmptyExactFalse() throws Exception {
final Property property = new Property("delete-type-25", "delete-entity25");
property.addTag("t1", "v1");
insertPropertyCheck(property);
PropertyQuery deleteQuery = new PropertyQuery();
deleteQuery.setType(property.getType());
deleteQuery.setEntity(property.getEntity());
deleteQuery.addKey("k1", "");
deleteQuery.setExactMatch(false);
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 testExtraKeyPropNoKeyExactFalse.
@Test
public void testExtraKeyPropNoKeyExactFalse() throws Exception {
final Property property = new Property("delete-type15", "delete-entity15");
property.addTag("t1", "v1");
insertPropertyCheck(property);
PropertyQuery deleteQuery = new PropertyQuery();
deleteQuery.setType(property.getType());
deleteQuery.setEntity(property.getEntity());
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 testKeyValueMismatchExactTrue.
@Test
public void testKeyValueMismatchExactTrue() throws Exception {
final Property property = new Property("delete-type16", "delete-entity16");
final String keyName = "k1";
property.addTag("t1", "v1");
property.addKey(keyName, "kv1");
insertPropertyCheck(property);
PropertyQuery deleteQuery = new PropertyQuery();
deleteQuery.setType(property.getType());
deleteQuery.setEntity(property.getEntity());
deleteQuery.addKey(keyName, "kv2");
deleteQuery.setExactMatch(true);
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 testKeyValueSpaces.
@Issue("2416")
@Test
public void testKeyValueSpaces() throws Exception {
final Property property = new Property("delete-type-26", "delete-entity26");
property.addTag("t1", "v1");
insertPropertyCheck(property);
PropertyQuery deleteQuery = new PropertyQuery();
deleteQuery.setType(property.getType());
deleteQuery.setEntity(property.getEntity());
deleteQuery.addKey("k1", " ");
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 testFutureDateExactDefault.
@Test
public void testFutureDateExactDefault() throws Exception {
final Property property = new Property("delete-type7", "delete-entity7");
property.addTag("t1", "v1");
property.addKey("k1", "v1");
property.setDate(getNextDay());
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());
assertTrue("Property should remain", propertyExist(property));
}
Aggregations