use of com.axibase.tsd.api.model.property.Property in project atsd-api-test by axibase.
the class PropertyQueryTest method testEntitiesWildcardStartChar.
@Issue("2979")
@Test
public void testEntitiesWildcardStartChar() throws Exception {
final Property property = new Property("query-type59", "query-entity59");
property.addTag("t1", "tv1");
insertPropertyCheck(property);
PropertyQuery query = new PropertyQuery();
query.setType(property.getType());
query.setEntities(Collections.singletonList("query-entity*"));
query.setStartDate(MIN_QUERYABLE_DATE);
query.setEndDate(MAX_QUERYABLE_DATE);
assertInsertedPropertyReturned(property, query);
}
use of com.axibase.tsd.api.model.property.Property in project atsd-api-test by axibase.
the class PropertyQueryTest method testKeyValueInteger.
@Issue("2416")
@Test
public void testKeyValueInteger() throws Exception {
final Property property = new Property("query-type-68", "query-entity68");
property.addTag("t1", "v1");
property.addKey("k1", "111");
insertPropertyCheck(property);
Map<String, Object> query = new HashMap<>();
query.put("type", property.getType());
query.put("entity", property.getEntity());
query.put("startDate", MIN_QUERYABLE_DATE);
query.put("endDate", MAX_QUERYABLE_DATE);
Map<String, Object> key = new HashMap<>();
key.put("k1", 111);
query.put("key", key);
assertStoredPropertyDoesNotMatchToInserted(property, query);
}
use of com.axibase.tsd.api.model.property.Property in project atsd-api-test by axibase.
the class PropertyQueryTest method testKeyTagExpressionUpperKey.
@Issue("2908")
@Test
public void testKeyTagExpressionUpperKey() throws Exception {
final Property property = new Property("query-type54", "query-entity54");
property.addTag("t1", "tv1");
property.addKey("k1", "KV1");
insertPropertyCheck(property);
PropertyQuery query = prepareSimplePropertyQuery(property.getType(), property.getEntity());
query.setKeyTagExpression("upper(keys.k1) == 'KV1'");
assertInsertedPropertyReturned(property, query);
}
use of com.axibase.tsd.api.model.property.Property in project atsd-api-test by axibase.
the class PropertyQueryTest method testLastDefault.
/**
* #NoTicket
*/
@Test
public void testLastDefault() throws Exception {
final Property property = new Property("query-type8", "query-entity8");
property.addTag("t1", "tv1");
property.addKey("k1", "kv1");
property.setDate(getPreviousDay());
insertPropertyCheck(property);
final Property lastProperty = new Property();
lastProperty.setType(property.getType());
lastProperty.setEntity(property.getEntity());
lastProperty.addTag("t2", "tv2");
lastProperty.setDate(getCurrentDate());
insertPropertyCheck(lastProperty);
PropertyQuery query = prepareSimplePropertyQuery(property.getType(), property.getEntity());
String expected = jacksonMapper.writeValueAsString(Arrays.asList(property, lastProperty));
String given = queryProperty(query).readEntity(String.class);
assertTrue("Both properties should be returned if 'last' field is not specified", compareJsonString(expected, given));
}
use of com.axibase.tsd.api.model.property.Property in project atsd-api-test by axibase.
the class PropertyQueryTest method testKeyMatchExactFalse.
/**
* #NoTicket
*/
@Test
public void testKeyMatchExactFalse() throws Exception {
final Property property = new Property("query-type11", "query-entity11");
property.addTag("t1", "tv1");
property.addKey("k1", "kv1");
insertPropertyCheck(property);
PropertyQuery query = prepareSimplePropertyQuery(property.getType(), "*");
query.setKey(property.getKey());
query.setExactMatch(false);
assertInsertedPropertyReturned(property, query);
}
Aggregations