use of com.orientechnologies.orient.core.storage.impl.local.paginated.wal.OWALChangesTree in project orientdb by orientechnologies.
the class DecimalSerializerTest method testSerializeWALChanges.
public void testSerializeWALChanges() {
final int serializationOffset = 5;
final ByteBuffer buffer = ByteBuffer.allocateDirect(FIELD_SIZE + serializationOffset).order(ByteOrder.nativeOrder());
final byte[] data = new byte[FIELD_SIZE];
decimalSerializer.serializeNativeObject(OBJECT, data, 0);
final OWALChanges walChanges = new OWALChangesTree();
walChanges.setBinaryValue(buffer, data, serializationOffset);
Assert.assertEquals(decimalSerializer.getObjectSizeInByteBuffer(buffer, walChanges, serializationOffset), FIELD_SIZE);
Assert.assertEquals(decimalSerializer.deserializeFromByteBufferObject(buffer, walChanges, serializationOffset), OBJECT);
}
use of com.orientechnologies.orient.core.storage.impl.local.paginated.wal.OWALChangesTree in project orientdb by orientechnologies.
the class FloatSerializerTest method testSerializeWALChanges.
public void testSerializeWALChanges() {
final int serializationOffset = 5;
ByteBuffer buffer = ByteBuffer.allocateDirect(FIELD_SIZE + serializationOffset).order(ByteOrder.nativeOrder());
byte[] data = new byte[FIELD_SIZE];
floatSerializer.serializeNative(OBJECT, data, 0);
OWALChanges walChanges = new OWALChangesTree();
walChanges.setBinaryValue(buffer, data, serializationOffset);
Assert.assertEquals(floatSerializer.getObjectSizeInByteBuffer(buffer, walChanges, serializationOffset), FIELD_SIZE);
Assert.assertEquals(floatSerializer.deserializeFromByteBufferObject(buffer, walChanges, serializationOffset), OBJECT);
}
use of com.orientechnologies.orient.core.storage.impl.local.paginated.wal.OWALChangesTree in project orientdb by orientechnologies.
the class LongSerializerTest method testSerializationWALChanges.
public void testSerializationWALChanges() {
final int serializationOffset = 5;
final ByteBuffer buffer = ByteBuffer.allocateDirect(FIELD_SIZE + serializationOffset);
final byte[] data = new byte[FIELD_SIZE];
longSerializer.serializeNative(OBJECT, data, 0);
OWALChanges walChanges = new OWALChangesTree();
walChanges.setBinaryValue(buffer, data, serializationOffset);
Assert.assertEquals(longSerializer.getObjectSizeInByteBuffer(buffer, walChanges, serializationOffset), FIELD_SIZE);
Assert.assertEquals(longSerializer.deserializeFromByteBufferObject(buffer, walChanges, serializationOffset), OBJECT);
}
use of com.orientechnologies.orient.core.storage.impl.local.paginated.wal.OWALChangesTree in project orientdb by orientechnologies.
the class OUUIDSerializerTest method testsSerializationWALChanges.
public void testsSerializationWALChanges() {
final int serializationOffset = 5;
final ByteBuffer buffer = ByteBuffer.allocateDirect(FIELD_SIZE + serializationOffset).order(ByteOrder.nativeOrder());
final byte[] data = new byte[FIELD_SIZE];
uuidSerializer.serializeNativeObject(OBJECT, data, 0);
OWALChanges walChanges = new OWALChangesTree();
walChanges.setBinaryValue(buffer, data, serializationOffset);
Assert.assertEquals(uuidSerializer.getObjectSizeInByteBuffer(buffer, walChanges, serializationOffset), FIELD_SIZE);
Assert.assertEquals(uuidSerializer.deserializeFromByteBufferObject(buffer, walChanges, serializationOffset), OBJECT);
}
use of com.orientechnologies.orient.core.storage.impl.local.paginated.wal.OWALChangesTree in project orientdb by orientechnologies.
the class BinarySerializerTest method testSerializeInWalChanges.
public void testSerializeInWalChanges() {
final int serializationOffset = 5;
final ByteBuffer buffer = ByteBuffer.allocateDirect(FIELD_SIZE + serializationOffset).order(ByteOrder.nativeOrder());
final byte[] data = new byte[FIELD_SIZE];
final OWALChangesTree walChangesTree = new OWALChangesTree();
binarySerializer.serializeNativeObject(OBJECT, data, 0);
walChangesTree.add(data, serializationOffset);
Assert.assertEquals(binarySerializer.getObjectSizeInByteBuffer(buffer, walChangesTree, serializationOffset), FIELD_SIZE);
Assert.assertEquals(binarySerializer.deserializeFromByteBufferObject(buffer, walChangesTree, serializationOffset), OBJECT);
}
Aggregations