use of com.baidu.hugegraph.backend.serializer.TextBackendEntry in project incubator-hugegraph by apache.
the class TextBackendEntryTest method testColumns.
@Test
public void testColumns() {
TextBackendEntry entry = new TextBackendEntry(HugeType.VERTEX, IdGenerator.of(1));
entry.column(HugeKeys.ID, "1");
entry.column(HugeKeys.NAME, "tom");
BackendColumn col1 = BackendColumn.of(new byte[] { 'i', 'd' }, new byte[] { '1' });
BackendColumn col2 = BackendColumn.of(new byte[] { 'n', 'a', 'm', 'e' }, new byte[] { 't', 'o', 'm' });
Assert.assertEquals(2, entry.columnsSize());
Assert.assertEquals(ImmutableList.of(col1, col2), entry.columns());
}
use of com.baidu.hugegraph.backend.serializer.TextBackendEntry in project incubator-hugegraph by apache.
the class TextBackendEntryTest method testCopy.
@Test
public void testCopy() {
TextBackendEntry entry = new TextBackendEntry(HugeType.VERTEX, IdGenerator.of(1));
entry.column(HugeKeys.ID, "1");
entry.column(HugeKeys.NAME, "tom");
Assert.assertEquals(2, entry.columnsSize());
TextBackendEntry entry2 = entry.copy();
Assert.assertEquals(2, entry2.columnsSize());
Assert.assertEquals("1", entry2.column(HugeKeys.ID));
Assert.assertEquals("tom", entry2.column(HugeKeys.NAME));
entry2.clear();
Assert.assertEquals(0, entry2.columnsSize());
Assert.assertEquals(2, entry.columnsSize());
}
Aggregations