use of com.axibase.tsd.api.model.property.Property in project atsd-api-test by axibase.
the class PropertyQueryTest method testEntityTagsEmptyKeyExactFalse.
/**
* #NoTicket
*/
@Test
public void testEntityTagsEmptyKeyExactFalse() throws Exception {
final Entity entity = new Entity("query-entity23");
entity.addTag("t1", "tv1");
entity.addTag("t2", "tv2");
final Property property = new Property();
property.setType(ENTITY_TAGS_PROPERTY_TYPE);
property.setEntity(entity.getName());
property.setTags(entity.getTags());
EntityMethod.createOrReplaceEntityCheck(entity);
PropertyQuery query = prepareSimplePropertyQuery(ENTITY_TAGS_PROPERTY_TYPE, entity.getName());
query.setExactMatch(false);
String given = queryProperty(query).readEntity(String.class);
String expected = jacksonMapper.writeValueAsString(Collections.singletonList(property));
assertTrue(String.format("Property with type %s for inserted entity should be returned", ENTITY_TAGS_PROPERTY_TYPE), compareJsonString(expected, given));
}
use of com.axibase.tsd.api.model.property.Property in project atsd-api-test by axibase.
the class PropertyQueryTest method testKeyValueNullExactFalse.
@Issue("2416")
@Test
public void testKeyValueNullExactFalse() throws Exception {
final Property property = new Property("query-type-62", "query-entity62");
property.addTag("t1", "v1");
insertPropertyCheck(property);
PropertyQuery query = prepareSimplePropertyQuery(property.getType(), property.getEntity());
query.addKey("k1", null);
query.setExactMatch(false);
assertStoredPropertyDoesNotMatchToInserted(property, query);
}
use of com.axibase.tsd.api.model.property.Property in project atsd-api-test by axibase.
the class PropertyQueryTest method testExtraKeyExactTrue.
/**
* #NoTicket
*/
@Test
public void testExtraKeyExactTrue() throws Exception {
final Property property = new Property("query-type14", "query-entity14");
property.addTag("t1", "tv1");
property.addKey("k1", "kv1");
insertPropertyCheck(property);
PropertyQuery query = prepareSimplePropertyQuery(property.getType(), "*");
query.setKey(property.getKey());
query.addKey("extra_key", "extra_key_val");
query.setExactMatch(true);
String emptyJsonList = "[]";
Response response = queryProperty(query);
assertTrue("Stored series do not match to inserted", compareJsonString(emptyJsonList, response.readEntity(String.class)));
}
use of com.axibase.tsd.api.model.property.Property in project atsd-api-test by axibase.
the class PropertyQueryTest method testPartKey.
/**
* #NoTicket
*/
@Test
public void testPartKey() throws Exception {
final Property property = new Property("query-type41.5", "query-entity41.5");
property.addTag("fs_type", "ext4");
property.addKey("file_system", "/");
property.addKey("mount_point", "/sda1");
property.setDate("2016-05-25T04:00:00.000Z");
insertPropertyCheck(property);
PropertyQuery query = new PropertyQuery(property.getType(), property.getEntity());
query.addKey("file_system", "/");
query.setStartDate("2016-05-25T04:00:00Z");
query.setEndDate("2016-05-25T05:00:00Z");
assertInsertedPropertyReturned(property, query);
}
use of com.axibase.tsd.api.model.property.Property in project atsd-api-test by axibase.
the class PropertyQueryTest method testKeyTagExpressionLowerKey.
@Issue("2908")
@Test
public void testKeyTagExpressionLowerKey() throws Exception {
final Property property = new Property("query-type52", "query-entity52");
property.addTag("t1", "tv1");
property.addKey("k1", "KV1");
insertPropertyCheck(property);
PropertyQuery query = prepareSimplePropertyQuery(property.getType(), property.getEntity());
query.setKeyTagExpression("lower(keys.k1) == 'kv1'");
assertInsertedPropertyReturned(property, query);
}
Aggregations