Search in sources :

Example 21 with EmployeeDTO

use of example.serialization.EmployeeDTO in project hazelcast by hazelcast.

the class CompactStreamSerializerTest method testDefaultsReflection_nested.

@Test
public void testDefaultsReflection_nested() {
    SerializationService serializationService = createSerializationService();
    EmployeeDTO employeeDTO = new EmployeeDTO(30, 102310312);
    long[] ids = new long[2];
    ids[0] = 22;
    ids[1] = 44;
    EmployeeDTO[] employeeDTOS = new EmployeeDTO[5];
    for (int j = 0; j < employeeDTOS.length; j++) {
        employeeDTOS[j] = new EmployeeDTO(20 + j, j * 100);
    }
    EmployerDTO employerDTO = new EmployerDTO("nbss", 40, HIRING, ids, employeeDTO, employeeDTOS);
    Data data = serializationService.toData(employerDTO);
    Object object = serializationService.toObject(data);
    EmployerDTO o = (EmployerDTO) object;
    assertEquals(employerDTO, o);
}
Also used : EmployeeDTO(example.serialization.EmployeeDTO) ExternalizableEmployeeDTO(example.serialization.ExternalizableEmployeeDTO) InternalSerializationService(com.hazelcast.internal.serialization.InternalSerializationService) SerializationService(com.hazelcast.internal.serialization.SerializationService) Data(com.hazelcast.internal.serialization.Data) EmployerDTO(example.serialization.EmployerDTO) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

EmployeeDTO (example.serialization.EmployeeDTO)21 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)20 QuickTest (com.hazelcast.test.annotation.QuickTest)20 Test (org.junit.Test)20 Data (com.hazelcast.internal.serialization.Data)11 SerializationService (com.hazelcast.internal.serialization.SerializationService)11 ExternalizableEmployeeDTO (example.serialization.ExternalizableEmployeeDTO)11 InternalSerializationService (com.hazelcast.internal.serialization.InternalSerializationService)10 CompactSerializationConfig (com.hazelcast.config.CompactSerializationConfig)6 DefaultSerializationServiceBuilder (com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder)6 SerializationConfig (com.hazelcast.config.SerializationConfig)5 HazelcastInstance (com.hazelcast.core.HazelcastInstance)4 EmployerDTO (example.serialization.EmployerDTO)4 CompactReader (com.hazelcast.nio.serialization.compact.CompactReader)3 CompactWriter (com.hazelcast.nio.serialization.compact.CompactWriter)3 Nonnull (javax.annotation.Nonnull)3 GenericRecord (com.hazelcast.nio.serialization.GenericRecord)2 SqlResult (com.hazelcast.sql.SqlResult)2 EmployeeDTOSerializer (example.serialization.EmployeeDTOSerializer)2 NodeDTO (example.serialization.NodeDTO)2