Search in sources :

Example 6 with SerializationServiceBuilder

use of com.hazelcast.internal.serialization.SerializationServiceBuilder 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());
}
Also used : DefaultSerializationServiceBuilder(com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder) SerializationServiceBuilder(com.hazelcast.internal.serialization.SerializationServiceBuilder) DefaultSerializationServiceBuilder(com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder) SerializationService(com.hazelcast.spi.serialization.SerializationService) Data(com.hazelcast.nio.serialization.Data) CollectionItem(com.hazelcast.collection.impl.collection.CollectionItem) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Aggregations

SerializationServiceBuilder (com.hazelcast.internal.serialization.SerializationServiceBuilder)6 DefaultSerializationServiceBuilder (com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder)6 SerializationConfig (com.hazelcast.config.SerializationConfig)2 PartitioningStrategy (com.hazelcast.core.PartitioningStrategy)2 InternalSerializationService (com.hazelcast.internal.serialization.InternalSerializationService)2 Data (com.hazelcast.nio.serialization.Data)2 DefaultPartitioningStrategy (com.hazelcast.partition.strategy.DefaultPartitioningStrategy)2 SerializationService (com.hazelcast.spi.serialization.SerializationService)2 ParallelTest (com.hazelcast.test.annotation.ParallelTest)2 QuickTest (com.hazelcast.test.annotation.QuickTest)2 Before (org.junit.Before)2 Test (org.junit.Test)2 ClientConfig (com.hazelcast.client.config.ClientConfig)1 CollectionItem (com.hazelcast.collection.impl.collection.CollectionItem)1 Config (com.hazelcast.config.Config)1 HazelcastInstance (com.hazelcast.core.HazelcastInstance)1 VersionMismatchException (com.hazelcast.internal.cluster.impl.VersionMismatchException)1