use of com.yahoo.vespa.model.container.search.QueryProfiles in project vespa by vespa-engine.
the class QueryProfileVariantsTestCase method testExplicitReferenceOverride.
/**
* For comparison with the above
*/
@Test
public void testExplicitReferenceOverride() throws IOException {
QueryProfileRegistry registry = new QueryProfileRegistry();
QueryProfile a1 = new QueryProfile("a1");
a1.set("b", "a1.b", registry);
QueryProfile profile = new QueryProfile("test");
profile.set("a", a1, registry);
profile.set("a.b", "a.b", registry);
assertEquals("a.b", profile.get("a.b"));
registry.register(a1);
registry.register(profile);
QueryProfiles profiles = new QueryProfiles(registry);
assertSerializedConfigFileEquals(root + "explicit-reference-override.cfg", profiles.getConfig().toString());
}
use of com.yahoo.vespa.model.container.search.QueryProfiles in project vespa by vespa-engine.
the class QueryProfileVariantsTestCase method testConfigCreationNewsBESimple.
@Test
public void testConfigCreationNewsBESimple() throws IOException {
QueryProfileRegistry registry = new QueryProfileXMLReader().read(root + "newsbesimple");
QueryProfiles profiles = new QueryProfiles(registry);
assertSerializedConfigFileEquals(root + "newsbe-query-profiles-simple.cfg", profiles.getConfig().toString());
}
use of com.yahoo.vespa.model.container.search.QueryProfiles in project vespa by vespa-engine.
the class QueryProfileVariantsTestCase method testVariantsOfExplicitCompoundWithVariantReference.
@Test
public void testVariantsOfExplicitCompoundWithVariantReference() throws IOException {
QueryProfileRegistry registry = new QueryProfileRegistry();
QueryProfile a1 = new QueryProfile("a1");
a1.set("b", "a1.b", registry);
QueryProfile a2 = new QueryProfile("a2");
a2.set("b", "a2.b", registry);
QueryProfile profile = new QueryProfile("test");
profile.setDimensions(new String[] { "x" });
profile.set("a", a1, registry);
profile.set("a", a2, new String[] { "x1" }, registry);
profile.set("a.b", "a.b.x1", new String[] { "x1" }, registry);
profile.set("a.b", "a.b.x2", new String[] { "x2" }, registry);
registry.register(a1);
registry.register(a2);
registry.register(profile);
QueryProfiles profiles = new QueryProfiles(registry);
assertSerializedConfigFileEquals(root + "variants-of-explicit-compound-with-reference.cfg", profiles.getConfig().toString());
}
use of com.yahoo.vespa.model.container.search.QueryProfiles in project vespa by vespa-engine.
the class QueryProfileVariantsTestCase method testConfigCreation.
@Test
public void testConfigCreation() throws IOException {
QueryProfileRegistry registry = new QueryProfileXMLReader().read(root + "queryprofilevariants");
QueryProfiles profiles = new QueryProfiles(registry);
assertSerializedConfigFileEquals(root + "query-profile-variants-configuration.cfg", profiles.getConfig().toString());
}
use of com.yahoo.vespa.model.container.search.QueryProfiles in project vespa by vespa-engine.
the class QueryProfileVariantsTestCase method testConfigCreationNewsFESimple.
@Test
public void testConfigCreationNewsFESimple() throws IOException {
QueryProfileRegistry registry = new QueryProfileXMLReader().read(root + "newsfesimple");
QueryProfiles profiles = new QueryProfiles(registry);
assertSerializedConfigFileEquals(root + "newsfe-query-profiles-simple.cfg", profiles.getConfig().toString());
}
Aggregations