use of com.yahoo.document.DocumentType in project vespa by vespa-engine.
the class JsonWriterTestCase method registerRawDocumentType.
private void registerRawDocumentType() {
DocumentType x = new DocumentType("testraw");
DataType d = DataType.RAW;
x.addField(new Field("actualraw", d));
types.registerDocumentType(x);
}
use of com.yahoo.document.DocumentType in project vespa by vespa-engine.
the class PredicateFieldValueSerializationTestCase method createDocType.
private static DocumentType createDocType() {
DocumentType type = new DocumentType("my_type");
type.addField(PREDICATE_FIELD, DataType.PREDICATE);
return type;
}
use of com.yahoo.document.DocumentType in project vespa by vespa-engine.
the class SystemTestCase method testSystemTest.
public void testSystemTest() {
DocumentType type = manager.getDocumentType("article");
Document inDocument = new Document(type, "doc:article:boringarticle:longarticle");
annotate(inDocument);
GrowableByteBuffer buffer = new GrowableByteBuffer();
DocumentSerializer serializer = DocumentSerializerFactory.create42(buffer);
serializer.write(inDocument);
buffer.flip();
DocumentDeserializer deserializer = DocumentDeserializerFactory.create42(manager, buffer);
Document outDocument = new Document(deserializer);
consume(outDocument);
}
use of com.yahoo.document.DocumentType in project vespa by vespa-engine.
the class ReferenceFieldValueTestCase method createDocumentType.
private static DocumentType createDocumentType(String name) {
DocumentType type = new DocumentType(name);
type.addField(new Field("foo", DataType.STRING));
return type;
}
use of com.yahoo.document.DocumentType in project vespa by vespa-engine.
the class StringTestCase method testAnnotatorConsumer.
/**
* Test for bug 4066566. No assertions, but works if it runs without exceptions.
*/
@Test
public void testAnnotatorConsumer() {
DocumentTypeManager manager = new DocumentTypeManager();
DocumentTypeManagerConfigurer.configure(manager, "file:src/test/java/com/yahoo/document/datatypes/documentmanager.blog.sd");
DocumentType blogType = manager.getDocumentType("blog");
Document doc = new Document(blogType, "doc:blog:http://blogs.sun.com/praveenm");
doc.setFieldValue("url", new StringFieldValue("http://blogs.sun.com/praveenm"));
doc.setFieldValue("title", new StringFieldValue("Beginning JavaFX"));
doc.setFieldValue("author", new StringFieldValue("Praveen Mohan"));
doc.setFieldValue("body", new StringFieldValue("JavaFX can expand its wings across different domains such as manufacturing, logistics, retail, etc. Many companies have adopted it - IBM, Oracle, Yahoo, Honeywell. Even the non-IT industries such as GE, WIPRO, Ford etc. So it is a success for Christopher Oliver and Richard Bair. Scott Mcnealy is happy"));
doc = annotate(doc, manager);
doc = serializeAndDeserialize(doc, manager);
doc = consume(doc, manager);
System.err.println(doc);
}
Aggregations