use of com.axibase.tsd.api.model.property.PropertyQuery in project atsd-api-test by axibase.
the class PropertyQueryTest method testEntityTagsTagsAsPartKeyExactFalse.
/**
* #NoTicket
*/
@Test
public void testEntityTagsTagsAsPartKeyExactFalse() throws Exception {
final Entity entity = new Entity("query-entity22");
entity.addTag("t1", "tv1");
entity.addTag("t2", "tv2");
EntityMethod.createOrReplaceEntityCheck(entity);
PropertyQuery query = prepareSimplePropertyQuery(ENTITY_TAGS_PROPERTY_TYPE, entity.getName());
query.addKey("t1", "tv1");
query.setExactMatch(false);
String given = queryProperty(query).readEntity(String.class);
String emptyJsonList = "[]";
assertTrue("No property should be returned", compareJsonString(emptyJsonList, given));
}
use of com.axibase.tsd.api.model.property.PropertyQuery in project atsd-api-test by axibase.
the class PropertyQueryTest method testStartDateInFuture.
/**
* #NoTicket
*/
@Test
public void testStartDateInFuture() throws Exception {
final Property property = new Property("query-type19", "query-entity19");
property.addTag("t1", "tv1");
property.addKey("k1", "kv1");
property.setDate(getNextDay());
insertPropertyCheck(property);
PropertyQuery query = new PropertyQuery(property.getType(), property.getEntity(), property.getKey());
query.setStartDate(property.getDate());
query.setInterval(new Period(2, TimeUnit.DAY));
assertInsertedPropertyReturned(property, query);
}
use of com.axibase.tsd.api.model.property.PropertyQuery in project atsd-api-test by axibase.
the class PropertyQueryTest method testOnlyTypeSpecified.
/**
* #NoTicket
*/
@Test
public void testOnlyTypeSpecified() throws Exception {
PropertyQuery query = new PropertyQuery();
query.setType("mock-type");
Response response = queryProperty(query);
assertEquals("Query should fail if DateFiled is not specified", BAD_REQUEST.getStatusCode(), response.getStatus());
assertEquals("Error message mismatch", ErrorTemplate.DATE_FILTER_COMBINATION_REQUIRED, extractErrorMessage(response));
}
use of com.axibase.tsd.api.model.property.PropertyQuery in project atsd-api-test by axibase.
the class PropertyQueryTest method testStartPastEndFuture.
/**
* #NoTicket
*/
@Test
public void testStartPastEndFuture() throws Exception {
final Property property = new Property("query-type3", "query-entity3");
property.addTag("t1", "tv1");
property.addKey("k1", "kv1");
property.setDate(getCurrentDate());
insertPropertyCheck(property);
PropertyQuery query = new PropertyQuery(property.getType(), property.getEntity());
query.setStartDate(Util.ISOFormat(getPreviousDay()));
query.setEndDate(Util.ISOFormat(getNextDay()));
assertInsertedPropertyReturned(property, query);
}
use of com.axibase.tsd.api.model.property.PropertyQuery in project atsd-api-test by axibase.
the class PropertyQueryTest method testDefaultQueryExactDefault.
/**
* #NoTicket
*/
@Test
public void testDefaultQueryExactDefault() throws Exception {
final Property property = new Property("query-type2", "query-entity2");
property.addTag("t1", "tv1");
property.addKey("k1", "kv1");
property.setDate(getCurrentDate());
insertPropertyCheck(property);
PropertyQuery query = prepareSimplePropertyQuery(property.getType(), property.getEntity());
assertInsertedPropertyReturned(property, query);
}
Aggregations