added missing test for ORecordSerializerNetworkV37 serializer
@@ -63,8 +63,10 @@ public class ODocumentSchemalessBinarySerializationTest {
@Before
public void createSerializer() {
//we want new instance before method only for network serializers
- if (serializerVersion >= ORecordSerializerBinary.INSTANCE.getNumberOfSupportedVersions())
+ if (serializerVersion == ORecordSerializerBinary.INSTANCE.getNumberOfSupportedVersions())
serializer = new ORecordSerializerNetwork();
+ else if (serializerVersion == ORecordSerializerBinary.INSTANCE.getNumberOfSupportedVersions() + 1)
+ serializer = new ORecordSerializerNetworkV37();
}
@Test
@@ -927,7 +929,27 @@ public class ODocumentSchemalessBinarySerializationTest {
assertEquals(document.<Object>field("oldAge"), extr.field("oldAge"));
assertEquals(document.fieldNames().length, extr.fieldNames().length);
+ }
+
+ @Test
+ public void testPartialNotFound() {
+ //this test want to do only for ORecordSerializerNetworkV37
+ if (serializer instanceof ORecordSerializerNetworkV37){
+ System.out.println("ISIDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE");
+ ODocument document = new ODocument();
+ document.field("name", "name");
+ document.field("age", 20);
+ document.field("youngAge", (short) 20);
+ document.field("oldAge", (long) 20);
+
+ byte[] res = serializer.toStream(document, false);
+ ODocument extr = (ODocument) serializer.fromStream(res, new ODocument(), new String[]{"foo"});
+ assertEquals(document.field("name"), extr.<Object>field("name"));
+ assertEquals(document.<Object>field("age"), extr.field("age"));
+ assertEquals(document.<Object>field("youngAge"), extr.field("youngAge"));
+ assertEquals(document.<Object>field("oldAge"), extr.field("oldAge"));
+ }
}
public static class Custom implements OSerializableStream {
