use of com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder in project hazelcast by hazelcast.
the class AsyncInboundResponseHandlerTest method setup.
@Before
public void setup() {
ILogger logger = Logger.getLogger(getClass());
HazelcastThreadGroup threadGroup = new HazelcastThreadGroup("test", logger, getClass().getClassLoader());
responsePacketHandler = mock(PacketHandler.class);
asyncHandler = new AsyncInboundResponseHandler(threadGroup, logger, responsePacketHandler, new HazelcastProperties(new Config()));
asyncHandler.start();
serializationService = new DefaultSerializationServiceBuilder().build();
}
use of com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder in project hazelcast by hazelcast.
the class CollectionUtilTest method testObjectToDataCollection_size.
@Test
public void testObjectToDataCollection_size() {
SerializationService serializationService = new DefaultSerializationServiceBuilder().build();
Collection<Object> list = new ArrayList<Object>();
list.add(1);
list.add("foo");
Collection<Data> dataCollection = objectToDataCollection(list, serializationService);
assertEquals(list.size(), dataCollection.size());
}
use of com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder in project hazelcast by hazelcast.
the class CollectionTxnUtilTest method testWriteRead.
@Test
public void testWriteRead() throws IOException {
InternalSerializationService ss = new DefaultSerializationServiceBuilder().build();
BufferObjectDataOutput out = ss.createObjectDataOutput();
CollectionTxnUtil.write(out, operationList);
BufferObjectDataInput in = ss.createObjectDataInput(out.toByteArray());
List<Operation> resultList = CollectionTxnUtil.read(in);
assertEquals(operationList.size(), resultList.size());
for (int i = 0; i < operationList.size(); i++) {
assertEquals(operationList.get(i), resultList.get(i));
}
}
use of com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder in project hazelcast by hazelcast.
the class RecordInfoTest method setUp.
@Before
public void setUp() throws Exception {
SerializationServiceBuilder builder = new DefaultSerializationServiceBuilder();
ss = builder.setVersion(InternalSerializationService.VERSION_1).build();
}
use of com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder in project hazelcast by hazelcast.
the class SetEqualsHashTest method testCollectionItem_equalsAndHash.
@Test
public void testCollectionItem_equalsAndHash() {
SerializationServiceBuilder serializationServiceBuilder = new DefaultSerializationServiceBuilder();
SerializationService build = serializationServiceBuilder.build();
Data value = build.toData(randomString());
CollectionItem firstItem = new CollectionItem(1, value);
CollectionItem secondItem = new CollectionItem(2, value);
assertTrue(firstItem.equals(secondItem));
assertEquals(firstItem.hashCode(), secondItem.hashCode());
}
Aggregations