use of com.yahoo.search.query.profile.config.QueryProfileXMLReader 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.search.query.profile.config.QueryProfileXMLReader 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.search.query.profile.config.QueryProfileXMLReader 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());
}
use of com.yahoo.search.query.profile.config.QueryProfileXMLReader in project vespa by vespa-engine.
the class XmlReadingTestCase method testNewsCase2.
@Test
public void testNewsCase2() {
CompiledQueryProfileRegistry registry = new QueryProfileXMLReader().read("src/test/java/com/yahoo/search/query/profile/config/test/newscase2").compile();
Query query;
query = new Query(HttpRequest.createTestRequest("?query=test&custid_1=parent", Method.GET), registry.getComponent("default"));
assertEquals("0.0", query.properties().get("a.features.b"));
assertEquals("0.0", query.properties().listProperties().get("a.features.b"));
query = new Query(HttpRequest.createTestRequest("?query=test&custid_1=parent&custid_2=child", Method.GET), registry.getComponent("default"));
assertEquals("0.1", query.properties().get("a.features.b"));
assertEquals("0.1", query.properties().listProperties().get("a.features.b"));
}
use of com.yahoo.search.query.profile.config.QueryProfileXMLReader in project vespa by vespa-engine.
the class XmlReadingTestCase method testNewsCase3.
@Test
public void testNewsCase3() {
CompiledQueryProfileRegistry registry = new QueryProfileXMLReader().read("src/test/java/com/yahoo/search/query/profile/config/test/newscase3").compile();
Query query;
query = new Query(HttpRequest.createTestRequest("?query=test&custid_1=parent", Method.GET), registry.getComponent("default"));
assertEquals("0.0", query.properties().get("a.features"));
query = new Query(HttpRequest.createTestRequest("?query=test&custid_1=parent&custid_2=child", Method.GET), registry.getComponent("default"));
assertEquals("0.1", query.properties().get("a.features"));
}
Aggregations