Search in sources :

Example 26 with Portable

use of com.hazelcast.nio.serialization.Portable in project hazelcast by hazelcast.

the class ClientListenersTest method setup.

@Before
public void setup() {
    ClientConfig config = new ClientConfig();
    config.getSerializationConfig().addPortableFactory(5, new PortableFactory() {

        @Override
        public Portable create(int classId) {
            if (classId == 6) {
                return new ClientRegressionWithMockNetworkTest.SamplePortable();
            }
            return null;
        }
    });
    server = hazelcastFactory.newHazelcastInstance();
    client = hazelcastFactory.newHazelcastClient(config);
}
Also used : Portable(com.hazelcast.nio.serialization.Portable) ClientConfig(com.hazelcast.client.config.ClientConfig) PortableFactory(com.hazelcast.nio.serialization.PortableFactory) Before(org.junit.Before)

Aggregations

Portable (com.hazelcast.nio.serialization.Portable)26 QuickTest (com.hazelcast.test.annotation.QuickTest)10 Test (org.junit.Test)10 PortableFactory (com.hazelcast.nio.serialization.PortableFactory)9 ParallelTest (com.hazelcast.test.annotation.ParallelTest)7 GroupPortable (com.hazelcast.nio.serialization.impl.DefaultPortableReaderTestStructure.GroupPortable)6 Portable (com.hazelcast.nio.serialization.impl.DefaultPortableReaderTestStructure.Method.Portable)6 NestedGroupPortable (com.hazelcast.nio.serialization.impl.DefaultPortableReaderTestStructure.NestedGroupPortable)6 PrimitivePortable (com.hazelcast.nio.serialization.impl.DefaultPortableReaderTestStructure.PrimitivePortable)6 HazelcastInstance (com.hazelcast.core.HazelcastInstance)5 ClientConfig (com.hazelcast.client.config.ClientConfig)4 Config (com.hazelcast.config.Config)4 MapStoreConfig (com.hazelcast.config.MapStoreConfig)4 SqlPredicate (com.hazelcast.query.SqlPredicate)3 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)3 MapIndexConfig (com.hazelcast.config.MapIndexConfig)2 SerializationConfig (com.hazelcast.config.SerializationConfig)2 ClassDefinition (com.hazelcast.nio.serialization.ClassDefinition)2 ClassDefinitionBuilder (com.hazelcast.nio.serialization.ClassDefinitionBuilder)2 HazelcastSerializationException (com.hazelcast.nio.serialization.HazelcastSerializationException)2