use of com.yahoo.config.model.application.provider.BaseDeployLogger in project vespa by vespa-engine.
the class RankProfileTestCase method requireThatConfigIsDerivedForQueryFeatureTypeSettings.
@Test
public void requireThatConfigIsDerivedForQueryFeatureTypeSettings() throws ParseException {
RankProfileRegistry registry = new RankProfileRegistry();
SearchBuilder builder = new SearchBuilder(registry, setupQueryProfileTypes());
builder.importString("search test {\n" + " document test { } \n" + " rank-profile p1 {}\n" + " rank-profile p2 {}\n" + "}");
builder.build(true, new BaseDeployLogger());
Search search = builder.getSearch();
assertEquals(4, registry.allRankProfiles().size());
assertQueryFeatureTypeSettings(registry.getRankProfile(search, "default"), search);
assertQueryFeatureTypeSettings(registry.getRankProfile(search, "unranked"), search);
assertQueryFeatureTypeSettings(registry.getRankProfile(search, "p1"), search);
assertQueryFeatureTypeSettings(registry.getRankProfile(search, "p2"), search);
}
use of com.yahoo.config.model.application.provider.BaseDeployLogger in project vespa by vespa-engine.
the class SDDocumentTypeOrdererTestCase method testOrder.
@Test
public void testOrder() {
List<SDDocumentType> types = new ArrayList<>();
SDDocumentType a = new SDDocumentType("a");
SDDocumentType b = new SDDocumentType("b");
SDDocumentType c = new SDDocumentType("c");
SDDocumentType d = new SDDocumentType("d");
SDDocumentType e = new SDDocumentType("e");
SDDocumentType f = new SDDocumentType("f");
SDDocumentType g = new SDDocumentType("g");
b.inherit(new TemporarySDDocumentType(new DataTypeName("a")));
c.inherit(new TemporarySDDocumentType(new DataTypeName("b")));
d.inherit(new TemporarySDDocumentType(new DataTypeName("e")));
g.inherit(new TemporarySDDocumentType(new DataTypeName("e")));
g.inherit(new TemporarySDDocumentType(new DataTypeName("c")));
SDField aFieldTypeB = new TemporarySDField("atypeb", DataType.STRING);
a.addField(aFieldTypeB);
SDField bFieldTypeC = new TemporarySDField("btypec", DataType.STRING);
b.addField(bFieldTypeC);
SDField cFieldTypeG = new TemporarySDField("ctypeg", DataType.STRING);
c.addField(cFieldTypeG);
SDField gFieldTypeF = new TemporarySDField("gtypef", DataType.STRING);
g.addField(gFieldTypeF);
SDField fFieldTypeC = new TemporarySDField("ftypec", DataType.STRING);
f.addField(fFieldTypeC);
SDField dFieldTypeE = new TemporarySDField("dtypee", DataType.STRING);
d.addField(dFieldTypeE);
types.add(a);
types.add(b);
types.add(c);
types.add(d);
types.add(e);
types.add(f);
types.add(g);
SDDocumentTypeOrderer app = new SDDocumentTypeOrderer(types, new BaseDeployLogger());
app.process();
assertEquals(7, app.processingOrder.size());
assertEquals(a, app.processingOrder.get(0));
assertEquals(b, app.processingOrder.get(1));
assertEquals(c, app.processingOrder.get(2));
assertEquals(e, app.processingOrder.get(3));
assertEquals(d, app.processingOrder.get(4));
assertEquals(f, app.processingOrder.get(5));
assertEquals(g, app.processingOrder.get(6));
}
use of com.yahoo.config.model.application.provider.BaseDeployLogger in project vespa by vespa-engine.
the class ComponentValidatorTest method validateWithException.
private void validateWithException(String jarName, String exceptionMessage) throws IOException {
try {
JarFile jarFile = new JarFile(JARS_DIR + jarName);
ComponentValidator componentValidator = new ComponentValidator(jarFile);
componentValidator.validateAll(new BaseDeployLogger());
assert (false);
} catch (IllegalArgumentException e) {
assertThat(e.getMessage(), is(exceptionMessage));
}
}
use of com.yahoo.config.model.application.provider.BaseDeployLogger in project vespa by vespa-engine.
the class SummaryFieldsMustHaveValidSourceTestCase method requireThatDocumentIdIsAllowedToPass.
@Test
public void requireThatDocumentIdIsAllowedToPass() throws IOException, ParseException {
Search search = UnprocessingSearchBuilder.buildUnprocessedFromFile("src/test/examples/documentidinsummary.sd");
search.process();
BaseDeployLogger deployLogger = new BaseDeployLogger();
RankProfileRegistry rankProfileRegistry = new RankProfileRegistry();
new SummaryFieldsMustHaveValidSource(search, deployLogger, rankProfileRegistry, new QueryProfiles()).process(true);
assertEquals("documentid", search.getSummary("withid").getSummaryField("w").getSingleSource());
}
use of com.yahoo.config.model.application.provider.BaseDeployLogger in project vespa by vespa-engine.
the class SummaryTestCase method testDeriving.
@Test
public void testDeriving() throws IOException, ParseException {
Search search = SearchBuilder.buildFromFile("src/test/examples/simple.sd");
SummaryClass summary = new SummaryClass(search, search.getSummary("default"), new BaseDeployLogger());
assertEquals("default", summary.getName());
Iterator<SummaryClassField> fields = summary.fieldIterator();
SummaryClassField field;
assertEquals(13, summary.getFieldCount());
field = (SummaryClassField) fields.next();
assertEquals("exactemento", field.getName());
assertEquals(SummaryClassField.Type.LONGSTRING, field.getType());
field = (SummaryClassField) fields.next();
assertEquals("exact", field.getName());
assertEquals(SummaryClassField.Type.LONGSTRING, field.getType());
field = (SummaryClassField) fields.next();
assertEquals("title", field.getName());
assertEquals(SummaryClassField.Type.LONGSTRING, field.getType());
field = (SummaryClassField) fields.next();
assertEquals("description", field.getName());
assertEquals(SummaryClassField.Type.LONGSTRING, field.getType());
field = (SummaryClassField) fields.next();
assertEquals("dyndesc", field.getName());
assertEquals(SummaryClassField.Type.LONGSTRING, field.getType());
field = (SummaryClassField) fields.next();
assertEquals("longdesc", field.getName());
assertEquals(SummaryClassField.Type.LONGSTRING, field.getType());
field = (SummaryClassField) fields.next();
assertEquals("longstat", field.getName());
assertEquals(SummaryClassField.Type.LONGSTRING, field.getType());
field = (SummaryClassField) fields.next();
assertEquals("dynlong", field.getName());
assertEquals(SummaryClassField.Type.LONGSTRING, field.getType());
field = (SummaryClassField) fields.next();
assertEquals("dyndesc2", field.getName());
assertEquals(SummaryClassField.Type.LONGSTRING, field.getType());
field = (SummaryClassField) fields.next();
assertEquals("measurement", field.getName());
assertEquals(SummaryClassField.Type.INTEGER, field.getType());
field = (SummaryClassField) fields.next();
assertEquals("rankfeatures", field.getName());
assertEquals(SummaryClassField.Type.FEATUREDATA, field.getType());
field = (SummaryClassField) fields.next();
assertEquals("summaryfeatures", field.getName());
assertEquals(SummaryClassField.Type.FEATUREDATA, field.getType());
field = (SummaryClassField) fields.next();
assertEquals("documentid", field.getName());
assertEquals(SummaryClassField.Type.LONGSTRING, field.getType());
}
Aggregations