use of com.yahoo.config.model.application.provider.BaseDeployLogger in project vespa by vespa-engine.
the class UserConfigBuilderTest method assertArraysOfStructs.
private void assertArraysOfStructs(Element configRoot) {
UserConfigRepo map = UserConfigBuilder.build(configRoot, configDefinitionStore, new BaseDeployLogger());
assertFalse(map.isEmpty());
ConfigDefinitionKey key = new ConfigDefinitionKey(SpecialtokensConfig.CONFIG_DEF_NAME, SpecialtokensConfig.CONFIG_DEF_NAMESPACE);
assertNotNull(map.get(key));
SpecialtokensConfig config = createConfig(SpecialtokensConfig.class, map.get(key));
assertThat(config.tokenlist().size(), is(1));
assertThat(config.tokenlist().get(0).name(), is("default"));
assertThat(config.tokenlist().get(0).tokens().size(), is(1));
assertThat(config.tokenlist().get(0).tokens().get(0).token(), is("dvd+-r"));
}
use of com.yahoo.config.model.application.provider.BaseDeployLogger in project vespa by vespa-engine.
the class UserConfigBuilderTest method no_exception_when_config_class_does_not_exist.
@Test
public void no_exception_when_config_class_does_not_exist() throws ParserConfigurationException, IOException, SAXException {
Element configRoot = getDocument("<config name=\"unknown\">" + " <foo>1</foo>" + "</config>");
UserConfigRepo repo = UserConfigBuilder.build(configRoot, configDefinitionStore, new BaseDeployLogger());
ConfigPayloadBuilder builder = repo.get(new ConfigDefinitionKey("unknown", "config"));
assertNotNull(builder);
}
use of com.yahoo.config.model.application.provider.BaseDeployLogger in project vespa by vespa-engine.
the class IndexingScriptRewriterTestCase method processField.
private static ScriptExpression processField(SDField unprocessedField) {
SDDocumentType sdoc = new SDDocumentType("test");
sdoc.addField(unprocessedField);
Search search = new Search("test", null);
search.addDocument(sdoc);
Processing.process(search, new BaseDeployLogger(), new RankProfileRegistry(), new QueryProfiles(), true);
return unprocessedField.getIndexingScript();
}
use of com.yahoo.config.model.application.provider.BaseDeployLogger in project vespa by vespa-engine.
the class TensorTransformTestCase method buildSearch.
private List<Pair<String, String>> buildSearch(String expression) throws ParseException {
RankProfileRegistry rankProfileRegistry = new RankProfileRegistry();
QueryProfileRegistry queryProfiles = setupQueryProfileTypes();
SearchBuilder builder = new SearchBuilder(rankProfileRegistry, queryProfiles);
builder.importString("search test {\n" + " document test { \n" + " field double_field type double { \n" + " indexing: summary | attribute \n" + " }\n" + " field double_array_field type array<double> { \n" + " indexing: summary | attribute \n" + " }\n" + " field weightedset_field type weightedset<double> { \n" + " indexing: summary | attribute \n" + " }\n" + " field tensor_field_1 type tensor(x{}) { \n" + " indexing: summary | attribute \n" + " attribute: tensor(x{}) \n" + " }\n" + " field tensor_field_2 type tensor(x[3],y[3]) { \n" + " indexing: summary | attribute \n" + " attribute: tensor(x[3],y[3]) \n" + " }\n" + " }\n" + " constant file_constant_tensor {\n" + " file: constants/tensor.json\n" + " type: tensor(x{})\n" + " }\n" + " rank-profile base {\n" + " constants {\n" + " base_constant_tensor {\n" + " value: { {x:0}:0 }\n" + " }\n" + " }\n" + " macro base_tensor() {\n" + " expression: constant(base_constant_tensor)\n" + " }\n" + " }\n" + " rank-profile test inherits base {\n" + " constants {\n" + " test_constant_tensor {\n" + " value: { {x:0}:1 }\n" + " }\n" + " }\n" + " macro returns_tensor_with_arg(arg1) {\n" + " expression: 2.0 * arg1\n" + " }\n" + " macro wraps_returns_tensor() {\n" + " expression: returns_tensor\n" + " }\n" + " macro returns_tensor() {\n" + " expression: attribute(tensor_field_2)\n" + " }\n" + " macro tensor_inheriting() {\n" + " expression: base_tensor\n" + " }\n" + " macro testexpression() {\n" + " expression: " + expression + "\n" + " }\n" + " }\n" + "}\n");
builder.build(true, new BaseDeployLogger());
Search s = builder.getSearch();
RankProfile test = rankProfileRegistry.getRankProfile(s, "test").compile(queryProfiles);
List<Pair<String, String>> testRankProperties = new RawRankProfile(test, queryProfiles, new AttributeFields(s)).configProperties();
return testRankProperties;
}
use of com.yahoo.config.model.application.provider.BaseDeployLogger in project vespa by vespa-engine.
the class FileSenderTest method require_that_null_files_are_not_sent.
@Test(expected = IllegalArgumentException.class)
public void require_that_null_files_are_not_sent() {
def.addFileDef("fileVal");
service.pathToRef.put("foo.txt", new FileNode("fooshash").value());
FileSender.sendUserConfiguredFiles(producer, serviceList, new BaseDeployLogger());
}
Aggregations