Search in sources :

Example 16 with BytesContainer

use of com.orientechnologies.orient.core.serialization.serializer.record.binary.BytesContainer in project orientdb by orientechnologies.

the class OVarIntSerializerTest method serializeMaxLong.

@Test
public void serializeMaxLong() {
    BytesContainer bytes = new BytesContainer();
    bytes.offset = OVarIntSerializer.write(bytes, Long.MAX_VALUE);
    assertEquals(OVarIntSerializer.readAsLong(bytes), Long.MAX_VALUE);
}
Also used : BytesContainer(com.orientechnologies.orient.core.serialization.serializer.record.binary.BytesContainer) Test(org.testng.annotations.Test)

Example 17 with BytesContainer

use of com.orientechnologies.orient.core.serialization.serializer.record.binary.BytesContainer in project orientdb by orientechnologies.

the class OVarIntSerializerTest method serializeNegative.

@Test
public void serializeNegative() {
    BytesContainer bytes = new BytesContainer();
    OVarIntSerializer.write(bytes, -20432343);
    bytes.offset = 0;
    assertEquals(OVarIntSerializer.readAsLong(bytes), -20432343l);
}
Also used : BytesContainer(com.orientechnologies.orient.core.serialization.serializer.record.binary.BytesContainer) Test(org.testng.annotations.Test)

Aggregations

BytesContainer (com.orientechnologies.orient.core.serialization.serializer.record.binary.BytesContainer)17 Test (org.testng.annotations.Test)13 OBinaryField (com.orientechnologies.orient.core.serialization.serializer.record.binary.OBinaryField)3 ORecordNotFoundException (com.orientechnologies.orient.core.exception.ORecordNotFoundException)2 OrientMonoThreadTest (com.orientechnologies.orient.test.database.base.OrientMonoThreadTest)2 OException (com.orientechnologies.common.exception.OException)1 OCollate (com.orientechnologies.orient.core.collate.OCollate)1 OCommandExecutionException (com.orientechnologies.orient.core.exception.OCommandExecutionException)1 OQueryParsingException (com.orientechnologies.orient.core.exception.OQueryParsingException)1 OType (com.orientechnologies.orient.core.metadata.schema.OType)1 ORecord (com.orientechnologies.orient.core.record.ORecord)1 OSQLFunctionRuntime (com.orientechnologies.orient.core.sql.functions.OSQLFunctionRuntime)1 OQueryOperatorMatches (com.orientechnologies.orient.core.sql.operator.OQueryOperatorMatches)1 OSQLQuery (com.orientechnologies.orient.core.sql.query.OSQLQuery)1 ParseException (java.text.ParseException)1