Search in sources :

Example 1 with DocumentTypes

use of com.yahoo.vespa.configmodel.producers.DocumentTypes in project vespa by vespa-engine.

the class DocumentModelBuilderReferenceTypeTestCase method assertDocumenttypesCfg.

private void assertDocumenttypesCfg(DocumentModel model, String documenttypesCfgFile) throws IOException {
    DocumenttypesConfig.Builder documenttypesCfg = new DocumentTypes().produce(model, new DocumenttypesConfig.Builder());
    assertConfigFile(TEST_FOLDER + documenttypesCfgFile, new DocumenttypesConfig(documenttypesCfg).toString());
}
Also used : DocumenttypesConfig(com.yahoo.document.DocumenttypesConfig) DocumentTypes(com.yahoo.vespa.configmodel.producers.DocumentTypes)

Example 2 with DocumentTypes

use of com.yahoo.vespa.configmodel.producers.DocumentTypes in project vespa by vespa-engine.

the class DocumentModelBuilderTestCase method testDocumentTypesSimple.

@Test
public // This is ignored as enums in config are not testable in this way. See bug 4748050
void testDocumentTypesSimple() throws IOException, ParseException {
    DocumentModel model = createAndTestModel("src/test/configmodel/types/types.sd");
    DocumenttypesConfig.Builder documenttypesCfg = new DocumentTypes().produce(model, new DocumenttypesConfig.Builder());
    assertConfigFile("src/test/configmodel/types/documenttypes.cfg", new DocumenttypesConfig(documenttypesCfg).toString());
}
Also used : DocumenttypesConfig(com.yahoo.document.DocumenttypesConfig) DocumentTypes(com.yahoo.vespa.configmodel.producers.DocumentTypes) Test(org.junit.Test)

Example 3 with DocumentTypes

use of com.yahoo.vespa.configmodel.producers.DocumentTypes in project vespa by vespa-engine.

the class DocumentModelBuilderTestCase method testDocumentTypesWithDocumentField.

@Test
public void testDocumentTypesWithDocumentField() throws IOException, ParseException {
    SearchBuilder search = new SearchBuilder();
    search.importFile("src/test/configmodel/types/other_doc.sd");
    search.importFile("src/test/configmodel/types/type_with_doc_field.sd");
    search.build();
    DocumentModel model = search.getModel();
    DocumenttypesConfig.Builder documenttypesCfg = new DocumentTypes().produce(model, new DocumenttypesConfig.Builder());
    assertConfigFile("src/test/configmodel/types/documenttypes_with_doc_field.cfg", new DocumenttypesConfig(documenttypesCfg).toString());
}
Also used : DocumenttypesConfig(com.yahoo.document.DocumenttypesConfig) DocumentTypes(com.yahoo.vespa.configmodel.producers.DocumentTypes) SearchBuilder(com.yahoo.searchdefinition.SearchBuilder) Test(org.junit.Test)

Aggregations

DocumenttypesConfig (com.yahoo.document.DocumenttypesConfig)3 DocumentTypes (com.yahoo.vespa.configmodel.producers.DocumentTypes)3 Test (org.junit.Test)2 SearchBuilder (com.yahoo.searchdefinition.SearchBuilder)1