use of com.yahoo.document.ReferenceDataType in project vespa by vespa-engine.
the class ReferenceFieldTestCase method assertSearchContainsReferenceField.
private static void assertSearchContainsReferenceField(String expectedFieldname, String referencedDocType, SDDocumentType documentType) {
Field field = documentType.getDocumentType().getField(expectedFieldname);
assertNotNull("Field does not exist in document type: " + expectedFieldname, field);
DataType dataType = field.getDataType();
assertThat(dataType, instanceOf(ReferenceDataType.class));
ReferenceDataType refField = (ReferenceDataType) dataType;
assertEquals(referencedDocType, refField.getTargetType().getName());
}
use of com.yahoo.document.ReferenceDataType in project vespa by vespa-engine.
the class JsonWriterTestCase method registerReferenceDocumentType.
private void registerReferenceDocumentType() {
DocumentType docTypeWithRef = new DocumentType("testrefs");
ReferenceDataType type = ReferenceDataType.createWithInferredId(types.getDocumentType("smoke"));
docTypeWithRef.addField(new Field("ref_field", type));
types.registerDocumentType(docTypeWithRef);
}
Aggregations