use of com.axibase.tsd.api.model.entity.Entity in project atsd-api-test by axibase.
the class EntityGetPropertyTypesTest method testEntityNameContainsSlash.
@Issue("1278")
@Test
public void testEntityNameContainsSlash() throws Exception {
Entity entity = new Entity("get_property_types_/entity-2");
createOrReplaceEntityCheck(entity);
assertUrlencodedPathHandledSuccessfullyOnGetPropertyTypes(entity);
}
use of com.axibase.tsd.api.model.entity.Entity 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.entity.Entity in project atsd-api-test by axibase.
the class PropertyQueryTest method testEntityTags.
/**
* #NoTicket
*/
@Test
public static void testEntityTags() throws Exception {
final Entity entity = new Entity("query-entity20");
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);
assertTrue("Properties with entityTag should be specified", propertyExist(property));
}
use of com.axibase.tsd.api.model.entity.Entity in project atsd-api-test by axibase.
the class PropertyQueryTest method testEntityWildcardTagsAsKey.
/**
* #NoTicket
*/
@Test
public void testEntityWildcardTagsAsKey() throws Exception {
final Entity entity = new Entity("wck-query-entity33");
entity.addTag("wct1", "wcv1");
EntityMethod.createOrReplaceEntityCheck(entity);
PropertyQuery query = prepareSimplePropertyQuery(ENTITY_TAGS_PROPERTY_TYPE, "wck-*");
query.setKey(entity.getTags());
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.entity.Entity in project atsd-api-test by axibase.
the class PropertyQueryTest method testEntityWildcardExpression.
/**
* #NoTicket
*/
@Test
public void testEntityWildcardExpression() throws Exception {
Entity entity1 = new Entity("wcke-query-entity37");
entity1.addTag("wc2t1", "wc2v1");
Entity entity2 = new Entity("wcke-query-entity38");
entity2.addTag("wc2t1", "wc2V1");
Entity entity3 = new Entity("wcke-query-entity39");
entity3.addTag("wc2t1", "wc2v1");
entity3.addTag("wc2t2", "wc2v2");
Entity entity4 = new Entity("wcke-query-entity40");
entity4.addTag("wc2t2", "wc2V2");
EntityMethod.createOrReplaceEntityCheck(entity1);
EntityMethod.createOrReplaceEntityCheck(entity2);
EntityMethod.createOrReplaceEntityCheck(entity3);
EntityMethod.createOrReplaceEntityCheck(entity4);
final Property property3 = new Property();
property3.setType(ENTITY_TAGS_PROPERTY_TYPE);
property3.setEntity(entity3.getName());
property3.setTags(entity3.getTags());
PropertyQuery query = prepareSimplePropertyQuery(ENTITY_TAGS_PROPERTY_TYPE, "wcke-*");
query.setKeyTagExpression("keys.wc2t1 = 'wc2V1' OR tags.wc2t2 = 'wc2v2'");
String given = queryProperty(query).readEntity(String.class);
String expected = jacksonMapper.writeValueAsString(Collections.singletonList(property3));
assertTrue(String.format("Property with type %s for inserted entity should be returned", ENTITY_TAGS_PROPERTY_TYPE), compareJsonString(expected, given));
}
Aggregations