use of com.torodb.core.d2r.DocPartResult in project torodb by torodb.
the class R2DTranslatorTest method readSimpleDocument.
/*
* Document: { "name" : "jero" }
*/
@Test
public void readSimpleDocument() {
MetaDocPartBuilder builder = new MetaDocPartBuilder(rootRef);
builder.addMetaField("name", "name_s", FieldType.STRING);
builder.addRow(1, null, 1, null, "jero");
DocPartResult root = builder.getResultSet();
List<DocPartResult> lst = Collections.singletonList(root);
R2DTranslator r2dTranslator = new R2DTranslatorImpl();
Collection<ToroDocument> readedDocuments = r2dTranslator.translate(lst.iterator());
assertEquals(1, readedDocuments.size());
KvDocument doc = readedDocuments.iterator().next().getRoot();
assertEquals("jero", doc.get("name").getValue());
}
Aggregations