use of com.yahoo.document.serialization.DeserializationException in project vespa by vespa-engine.
the class XMLNumericFieldErrorMsgTestCase method requireDescriptiveErrorMsgForLongs.
@Test
public void requireDescriptiveErrorMsgForLongs() throws Exception {
DocumentTypeManager dtm = setupTypes();
try {
VespaXMLDocumentReader documentReader = new VespaXMLDocumentReader(new ByteArrayInputStream(("<document id=\"doc:foo:bar\" type=\"doctype\">" + " <longfield></longfield>" + "</document>").getBytes(StandardCharsets.UTF_8)), dtm);
new Document(documentReader);
fail("Sorry mac");
} catch (DeserializationException e) {
assertThat(e.getMessage(), e.getMessage().contains("Field 'longfield': Invalid long \"\""), is(true));
}
}
Aggregations