use of com.orientechnologies.orient.core.storage.impl.local.paginated.wal.OWALChanges in project orientdb by orientechnologies.
the class BooleanSerializerTest method testSerializationWalChanges.
public void testSerializationWalChanges() {
final int serializationOffset = 5;
byte[] data = new byte[FIELD_SIZE];
ByteBuffer buffer = ByteBuffer.allocateDirect(FIELD_SIZE + serializationOffset).order(ByteOrder.nativeOrder());
booleanSerializer.serializeNative(OBJECT_TRUE, data, 0);
OWALChanges walChanges = new OWALChangesTree();
walChanges.setBinaryValue(buffer, data, serializationOffset);
Assert.assertEquals(booleanSerializer.getObjectSizeInByteBuffer(buffer, walChanges, serializationOffset), FIELD_SIZE);
Assert.assertEquals(booleanSerializer.deserializeFromByteBufferObject(buffer, walChanges, serializationOffset), OBJECT_TRUE);
booleanSerializer.serializeNative(OBJECT_FALSE, data, 0);
walChanges.setBinaryValue(buffer, data, 0);
Assert.assertEquals(booleanSerializer.getObjectSizeInByteBuffer(buffer, walChanges, serializationOffset), FIELD_SIZE);
Assert.assertEquals(booleanSerializer.deserializeFromByteBufferObject(buffer, walChanges, serializationOffset), OBJECT_FALSE);
}
use of com.orientechnologies.orient.core.storage.impl.local.paginated.wal.OWALChanges in project orientdb by orientechnologies.
the class CharSerializerTest 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];
charSerializer.serializeNative(OBJECT, data, 0);
OWALChanges walChanges = new OWALChangesTree();
walChanges.setBinaryValue(buffer, data, serializationOffset);
Assert.assertEquals(charSerializer.getObjectSizeInByteBuffer(buffer, walChanges, serializationOffset), FIELD_SIZE);
Assert.assertEquals(charSerializer.deserializeFromByteBufferObject(buffer, walChanges, serializationOffset), OBJECT);
}
use of com.orientechnologies.orient.core.storage.impl.local.paginated.wal.OWALChanges 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.OWALChanges 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);
}
use of com.orientechnologies.orient.core.storage.impl.local.paginated.wal.OWALChanges 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);
}
Aggregations