use of com.yahoo.config.model.application.provider.BaseDeployLogger in project vespa by vespa-engine.
the class TypeConversionTestCase method testExactStringToStringTypeConversion.
/**
* Tests that exact-string stuff is not spilled over to the default index
*/
@Test
public void testExactStringToStringTypeConversion() {
Search search = new Search("test", null);
RankProfileRegistry rankProfileRegistry = RankProfileRegistry.createRankProfileRegistryWithBuiltinRankProfiles(search);
SDDocumentType document = new SDDocumentType("test");
search.addDocument(document);
SDField a = new SDField("a", DataType.STRING);
a.parseIndexingScript("{ index }");
document.addField(a);
Processing.process(search, new BaseDeployLogger(), rankProfileRegistry, new QueryProfiles(), true);
DerivedConfiguration derived = new DerivedConfiguration(search, rankProfileRegistry, new QueryProfileRegistry());
IndexInfo indexInfo = derived.getIndexInfo();
assertFalse(indexInfo.hasCommand("default", "compact-to-term"));
}
use of com.yahoo.config.model.application.provider.BaseDeployLogger in project vespa by vespa-engine.
the class ApplicationPreprocessor method run.
public void run() throws IOException, TransformerException, ParserConfigurationException, SAXException {
DeployLogger logger = new BaseDeployLogger();
FilesApplicationPackage.Builder applicationPackageBuilder = new FilesApplicationPackage.Builder(applicationDir);
outputDir.ifPresent(applicationPackageBuilder::preprocessedDir);
ApplicationPackage preprocessed = applicationPackageBuilder.build().preprocess(new Zone(environment.orElse(Environment.defaultEnvironment()), region.orElse(RegionName.defaultName())), logger);
preprocessed.validateXML();
}
use of com.yahoo.config.model.application.provider.BaseDeployLogger in project vespa by vespa-engine.
the class RankPropertyVariablesTestCase method testRankPropVariables.
@Test
public void testRankPropVariables() throws IOException, ParseException {
RankProfileRegistry rankProfileRegistry = new RankProfileRegistry();
Search search = SearchBuilder.buildFromFile("src/test/examples/rankpropvars.sd", new BaseDeployLogger(), rankProfileRegistry, new QueryProfileRegistry());
assertRankPropEquals(rankProfileRegistry.getRankProfile(search, "other").getRankProperties(), "$testvar1", "foo");
assertRankPropEquals(rankProfileRegistry.getRankProfile(search, "other").getRankProperties(), "$testvar_2", "bar");
assertRankPropEquals(rankProfileRegistry.getRankProfile(search, "other").getRankProperties(), "$testvarOne23", "baz");
assertRankPropEquals(rankProfileRegistry.getRankProfile(search, "another").getRankProperties(), "$Testvar1", "1");
assertRankPropEquals(rankProfileRegistry.getRankProfile(search, "another").getRankProperties(), "$Testvar_4", "4");
assertRankPropEquals(rankProfileRegistry.getRankProfile(search, "another").getRankProperties(), "$testvarFour23", "234234.234");
}
use of com.yahoo.config.model.application.provider.BaseDeployLogger in project vespa by vespa-engine.
the class SummaryMapTestCase method testDeriving.
@Test
public void testDeriving() throws IOException, ParseException {
Search search = SearchBuilder.buildFromFile("src/test/examples/simple.sd");
SummaryMap summaryMap = new SummaryMap(search, new Summaries(search, new BaseDeployLogger()));
Iterator transforms = summaryMap.resultTransformIterator();
FieldResultTransform transform = (FieldResultTransform) transforms.next();
assertEquals("dyndesc", transform.getFieldName());
assertEquals(SummaryTransform.DYNAMICTEASER, transform.getTransform());
transform = (FieldResultTransform) transforms.next();
assertEquals("dynlong", transform.getFieldName());
assertEquals(SummaryTransform.DYNAMICTEASER, transform.getTransform());
transform = (FieldResultTransform) transforms.next();
assertEquals("dyndesc2", transform.getFieldName());
assertEquals(SummaryTransform.DYNAMICTEASER, transform.getTransform());
transform = (FieldResultTransform) transforms.next();
assertEquals("measurement", transform.getFieldName());
assertEquals(SummaryTransform.ATTRIBUTE, transform.getTransform());
transform = (FieldResultTransform) transforms.next();
assertEquals("rankfeatures", transform.getFieldName());
assertEquals(SummaryTransform.RANKFEATURES, transform.getTransform());
transform = (FieldResultTransform) transforms.next();
assertEquals("summaryfeatures", transform.getFieldName());
assertEquals(SummaryTransform.SUMMARYFEATURES, transform.getTransform());
transform = (FieldResultTransform) transforms.next();
assertEquals("popsiness", transform.getFieldName());
assertEquals(SummaryTransform.ATTRIBUTE, transform.getTransform());
transform = (FieldResultTransform) transforms.next();
assertEquals("popularity", transform.getFieldName());
assertEquals(SummaryTransform.ATTRIBUTE, transform.getTransform());
transform = (FieldResultTransform) transforms.next();
assertEquals("access", transform.getFieldName());
assertEquals(SummaryTransform.ATTRIBUTE, transform.getTransform());
assertTrue(!transforms.hasNext());
}
use of com.yahoo.config.model.application.provider.BaseDeployLogger in project vespa by vespa-engine.
the class AttributePropertiesTestCase method testInvalidAttributeProperties.
@Test
public void testInvalidAttributeProperties() throws IOException, ParseException {
try {
Search search = UnprocessingSearchBuilder.buildUnprocessedFromFile("src/test/examples/attributeproperties1.sd");
new AttributeProperties(search, new BaseDeployLogger(), new RankProfileRegistry(), new QueryProfiles()).process(true);
fail("attribute property should not be set");
} catch (RuntimeException e) {
// empty
}
}
Aggregations