use of com.yahoo.document.Field in project vespa by vespa-engine.
the class VespaXmlUpdateReaderTestCase method requireThatStructFieldDeserializeExceptionIncludesFieldName.
@Test
public void requireThatStructFieldDeserializeExceptionIncludesFieldName() throws Exception {
StructDataType structType = new StructDataType("my_struct");
structType.addField(new Field("my_byte", DataType.BYTE));
Field field = new Field("my_field", structType);
assertThrows(field, "<assign field='my_field'><my_byte>-129</my_byte></assign>", "Field 'my_byte': Invalid byte \"-129\". (at line 1, column 89)");
assertThrows(field, "<assign fieldpath='my_field'><my_byte>-129</my_byte></assign>", "Field 'my_byte': Invalid byte \"-129\". (at line 1, column 93)");
assertThrows(field, "<add field='my_field'><my_byte>-129</my_byte></add>", "Field 'my_byte': Invalid byte \"-129\". (at line 1, column 86)");
assertThrows(field, "<add fieldpath='my_field'><my_byte>-129</my_byte></add>", "Field 'my_byte': Invalid byte \"-129\". (at line 1, column 90)");
assertThrows(field, "<remove field='my_field'><my_byte>-129</my_byte></remove>", "Field 'my_byte': Invalid byte \"-129\". (at line 1, column 89)");
}
use of com.yahoo.document.Field in project vespa by vespa-engine.
the class JsonWriterTestCase method registerArrayDocumentType.
private void registerArrayDocumentType() {
DocumentType x = new DocumentType("testarray");
DataType d = new ArrayDataType(DataType.STRING);
x.addField(new Field("actualarray", d));
types.registerDocumentType(x);
}
use of com.yahoo.document.Field in project vespa by vespa-engine.
the class JsonWriterTestCase method registerSmokeDocumentType.
private void registerSmokeDocumentType() {
DocumentType x = new DocumentType("smoke");
x.addField(new Field("something", DataType.STRING));
x.addField(new Field("nalle", DataType.STRING));
types.registerDocumentType(x);
}
use of com.yahoo.document.Field in project vespa by vespa-engine.
the class JsonWriterTestCase method registerMapDocumentType.
private void registerMapDocumentType() {
DocumentType x = new DocumentType("testmap");
DataType d = new MapDataType(DataType.STRING, DataType.STRING);
x.addField(new Field("actualmap", d));
types.registerDocumentType(x);
}
use of com.yahoo.document.Field in project vespa by vespa-engine.
the class JsonWriterTestCase method registerPredicateDocumentType.
private void registerPredicateDocumentType() {
DocumentType x = new DocumentType("testpredicate");
DataType d = DataType.PREDICATE;
x.addField(new Field("actualpredicate", d));
types.registerDocumentType(x);
}
Aggregations