use of com.yahoo.vespa.model.test.utils.VespaModelCreatorWithFilePkg in project vespa by vespa-engine.
the class RankingConstantsValidatorTest method ensure_that_failing_ranking_constants_fails.
@Test
public void ensure_that_failing_ranking_constants_fails() {
expectedException.expect(TensorValidationFailed.class);
expectedException.expectMessage("Ranking constant \"constant_tensor_2\" (tensors/constant_tensor_2.json): Tensor coordinate is not a string (VALUE_NUMBER_INT)");
expectedException.expectMessage("Ranking constant \"constant_tensor_3\" (tensors/constant_tensor_3.json): Tensor dimension \"cd\" does not exist");
expectedException.expectMessage("Ranking constant \"constant_tensor_4\" (tensors/constant_tensor_4.json): Tensor dimension \"z\" does not exist");
new VespaModelCreatorWithFilePkg("src/test/cfg/application/validation/ranking_constants_fail/").create();
}
use of com.yahoo.vespa.model.test.utils.VespaModelCreatorWithFilePkg in project vespa by vespa-engine.
the class SearchDataTypeValidatorTestCase method requireThatIndexingMapsInNonStreamingClusterIsIllegal.
@Test
public void requireThatIndexingMapsInNonStreamingClusterIsIllegal() {
try {
new VespaModelCreatorWithFilePkg("src/test/cfg/application/validation/index_struct/").create();
fail();
} catch (IllegalArgumentException e) {
assertEquals("Field type 'Map<string,string>' cannot be indexed for search clusters (field 'baz' in definition " + "'simple' for cluster 'content').", e.getMessage());
}
}
use of com.yahoo.vespa.model.test.utils.VespaModelCreatorWithFilePkg in project vespa by vespa-engine.
the class ModelConfigProviderTest method testGetModelConfig.
/**
* Get the config via ConfigInstance based API, by getting whole config
*/
@Test
public void testGetModelConfig() {
VespaModel vespaModel = new VespaModelCreatorWithFilePkg("src/test/cfg/admin/adminconfig20").create();
ModelConfig config = vespaModel.getConfig(ModelConfig.class, "");
assertEquals(config.hosts().size(), 1);
// Actually set to hostname.
ModelConfig.Hosts localhost = config.hosts(0);
int numLogservers = 0;
int numSlobroks = 0;
for (ModelConfig.Hosts.Services service : localhost.services()) {
if ("logserver".equals(service.type())) {
numLogservers++;
}
if ("slobrok".equals(service.type())) {
numSlobroks++;
}
}
assertEquals(1, numLogservers);
assertEquals(2, numSlobroks);
}
Aggregations