use of com.yahoo.search.query.profile.QueryProfileProperties in project vespa by vespa-engine.
the class QueryProfileTestCase method testSettingNonLeaf4a.
public void testSettingNonLeaf4a() {
QueryProfile p = new QueryProfile("test");
p.setDimensions(new String[] { "x" });
p.set("a.b", "a.b-value", new String[] { "x1" }, null);
p.set("a", "a-value", (QueryProfileRegistry) null);
QueryProfileProperties cp = new QueryProfileProperties(p.compile(null));
assertEquals("a-value", cp.get("a"));
assertNull(cp.get("a.b"));
assertEquals("a-value", cp.get("a", new String[] { "x1" }));
assertEquals("a.b-value", cp.get("a.b", QueryProfileVariantsTestCase.toMap(p, new String[] { "x1" })));
}
use of com.yahoo.search.query.profile.QueryProfileProperties in project vespa by vespa-engine.
the class QueryProfileTestCase method testListProperties.
public void testListProperties() {
QueryProfile barn = new QueryProfile("barn");
QueryProfile mor = new QueryProfile("mor");
QueryProfile far = new QueryProfile("far");
QueryProfile mormor = new QueryProfile("mormor");
QueryProfile morfar = new QueryProfile("morfar");
QueryProfile farfar = new QueryProfile("farfar");
barn.addInherited(mor);
barn.addInherited(far);
mor.addInherited(mormor);
mor.addInherited(morfar);
far.addInherited(farfar);
morfar.set("a", "morfar-a", (QueryProfileRegistry) null);
morfar.set("model.b", "morfar-model.b", (QueryProfileRegistry) null);
mormor.set("a", "mormor-a", (QueryProfileRegistry) null);
mormor.set("model.b", "mormor-model.b", (QueryProfileRegistry) null);
farfar.set("a", "farfar-a", (QueryProfileRegistry) null);
mor.set("a", "mor-a", (QueryProfileRegistry) null);
far.set("a", "far-a", (QueryProfileRegistry) null);
barn.set("a", "barn-a", (QueryProfileRegistry) null);
mormor.set("b", "mormor-b", (QueryProfileRegistry) null);
far.set("b", "far-b", (QueryProfileRegistry) null);
mor.set("c", "mor-c", (QueryProfileRegistry) null);
far.set("c", "far-c", (QueryProfileRegistry) null);
CompiledQueryProfile cbarn = barn.compile(null);
QueryProfileProperties properties = new QueryProfileProperties(cbarn);
assertEquals("barn-a", cbarn.get("a"));
assertEquals("mormor-b", cbarn.get("b"));
Map<String, Object> rootMap = properties.listProperties();
assertEquals("barn-a", rootMap.get("a"));
assertEquals("mormor-b", rootMap.get("b"));
assertEquals("mor-c", rootMap.get("c"));
Map<String, Object> modelMap = properties.listProperties("model");
assertEquals("mormor-model.b", modelMap.get("b"));
QueryProfile annetBarn = new QueryProfile("annetBarn");
annetBarn.set("venn", barn, (QueryProfileRegistry) null);
CompiledQueryProfile cannetBarn = annetBarn.compile(null);
Map<String, Object> annetBarnMap = new QueryProfileProperties(cannetBarn).listProperties();
assertEquals("barn-a", annetBarnMap.get("venn.a"));
assertEquals("mormor-b", annetBarnMap.get("venn.b"));
assertEquals("mor-c", annetBarnMap.get("venn.c"));
assertEquals("mormor-model.b", annetBarnMap.get("venn.model.b"));
}
use of com.yahoo.search.query.profile.QueryProfileProperties in project vespa by vespa-engine.
the class QueryProfileTestCase method testSettingNonLeaf2.
public void testSettingNonLeaf2() {
QueryProfile p = new QueryProfile("test");
p.set("a.b", "a.b-value", (QueryProfileRegistry) null);
p.set("a", "a-value", (QueryProfileRegistry) null);
QueryProfileProperties cp = new QueryProfileProperties(p.compile(null));
assertEquals("a-value", cp.get("a"));
assertEquals("a.b-value", cp.get("a.b"));
}
use of com.yahoo.search.query.profile.QueryProfileProperties in project vespa by vespa-engine.
the class QueryProfileTestCase method testSettingNonLeaf3b.
public void testSettingNonLeaf3b() {
QueryProfile p = new QueryProfile("test");
p.setDimensions(new String[] { "x" });
p.set("a", "a-value", new String[] { "x1" }, null);
p.set("a.b", "a.b-value", (QueryProfileRegistry) null);
QueryProfileProperties cp = new QueryProfileProperties(p.compile(null));
assertNull(cp.get("a"));
assertEquals("a.b-value", cp.get("a.b"));
assertEquals("a-value", cp.get("a", QueryProfileVariantsTestCase.toMap(p, new String[] { "x1" })));
assertEquals("a.b-value", cp.get("a.b", new String[] { "x1" }));
}
use of com.yahoo.search.query.profile.QueryProfileProperties in project vespa by vespa-engine.
the class QueryProfileTestCase method testSettingNonLeaf4b.
public void testSettingNonLeaf4b() {
QueryProfile p = new QueryProfile("test");
p.setDimensions(new String[] { "x" });
p.set("a", "a-value", (QueryProfileRegistry) null);
p.set("a.b", "a.b-value", new String[] { "x1" }, null);
QueryProfileProperties cp = new QueryProfileProperties(p.compile(null));
assertEquals("a-value", cp.get("a"));
assertNull(cp.get("a.b"));
assertEquals("a-value", cp.get("a", new String[] { "x1" }));
assertEquals("a.b-value", cp.get("a.b", QueryProfileVariantsTestCase.toMap(p, new String[] { "x1" })));
}
Aggregations