use of com.orientechnologies.orient.core.storage.impl.local.paginated.wal.OWALChangesTree in project orientdb by orientechnologies.
the class IntegerSerializerTest 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];
integerSerializer.serializeNative(OBJECT, data, 0);
OWALChanges walChanges = new OWALChangesTree();
walChanges.setBinaryValue(buffer, data, serializationOffset);
Assert.assertEquals(integerSerializer.getObjectSizeInByteBuffer(buffer, walChanges, serializationOffset), FIELD_SIZE);
Assert.assertEquals(integerSerializer.deserializeFromByteBufferObject(buffer, walChanges, serializationOffset), OBJECT);
}
use of com.orientechnologies.orient.core.storage.impl.local.paginated.wal.OWALChangesTree in project orientdb by orientechnologies.
the class ShortSerializerTest method testSerializationWALChanges.
public void testSerializationWALChanges() {
final int serializationOffset = 5;
final ByteBuffer buffer = ByteBuffer.allocateDirect(FIELD_SIZE + serializationOffset).order(ByteOrder.nativeOrder());
final byte[] data = new byte[FIELD_SIZE];
shortSerializer.serializeNative(OBJECT, data, 0);
final OWALChanges walChanges = new OWALChangesTree();
walChanges.setBinaryValue(buffer, data, serializationOffset);
Assert.assertEquals(shortSerializer.getObjectSizeInByteBuffer(buffer, walChanges, serializationOffset), FIELD_SIZE);
Assert.assertEquals(shortSerializer.deserializeFromByteBufferObject(buffer, walChanges, serializationOffset), OBJECT);
}
use of com.orientechnologies.orient.core.storage.impl.local.paginated.wal.OWALChangesTree in project orientdb by orientechnologies.
the class StringSerializerTest method testSerializeWALChanges.
public void testSerializeWALChanges() {
final int serializationOffset = 5;
final ByteBuffer buffer = ByteBuffer.allocateDirect(FIELD_SIZE - 7 + serializationOffset).order(ByteOrder.nativeOrder());
final byte[] data = new byte[FIELD_SIZE - 7];
stringSerializer.serializeNativeObject(OBJECT, data, 0);
OWALChanges walChanges = new OWALChangesTree();
walChanges.setBinaryValue(buffer, data, serializationOffset);
Assert.assertEquals(stringSerializer.getObjectSizeInByteBuffer(buffer, walChanges, serializationOffset), FIELD_SIZE - 7);
Assert.assertEquals(stringSerializer.deserializeFromByteBufferObject(buffer, walChanges, serializationOffset), OBJECT);
}
use of com.orientechnologies.orient.core.storage.impl.local.paginated.wal.OWALChangesTree in project orientdb by orientechnologies.
the class DateTimeSerializerTest 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];
dateTimeSerializer.serializeNativeObject(OBJECT, data, 0);
final OWALChanges walChanges = new OWALChangesTree();
walChanges.setBinaryValue(buffer, data, serializationOffset);
Assert.assertEquals(dateTimeSerializer.getObjectSizeInByteBuffer(buffer, walChanges, serializationOffset), FIELD_SIZE);
Assert.assertEquals(dateTimeSerializer.deserializeFromByteBufferObject(buffer, walChanges, serializationOffset), OBJECT);
}
use of com.orientechnologies.orient.core.storage.impl.local.paginated.wal.OWALChangesTree in project orientdb by orientechnologies.
the class DoubleSerializerTest 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];
doubleSerializer.serializeNativeObject(OBJECT, data, 0);
final OWALChanges walChanges = new OWALChangesTree();
walChanges.setBinaryValue(buffer, data, serializationOffset);
Assert.assertEquals(doubleSerializer.getObjectSizeInByteBuffer(buffer, walChanges, serializationOffset), FIELD_SIZE);
Assert.assertEquals(doubleSerializer.deserializeFromByteBufferObject(buffer, walChanges, serializationOffset), OBJECT);
}
Aggregations