Search in sources :

Example 1 with IdentifiedDataSerializableFactory

use of com.hazelcast.client.test.IdentifiedDataSerializableFactory in project hazelcast by hazelcast.

the class RingbufferTest method init.

@Before
public void init() {
    Config config = new Config();
    config.addRingBufferConfig(new RingbufferConfig("rb*").setCapacity(CAPACITY));
    // Set operation timeout to larger than test timeout. So the tests do not pass accidentally because of retries.
    // The tests should depend on notifier system, not retrying.
    config.setProperty("hazelcast.operation.call.timeout.millis", "305000");
    config.getSerializationConfig().addDataSerializableFactory(IdentifiedDataSerializableFactory.FACTORY_ID, new IdentifiedDataSerializableFactory());
    server = hazelcastFactory.newHazelcastInstance(config);
    ClientConfig clientConfig = new ClientConfig();
    clientConfig.getSerializationConfig().addDataSerializableFactory(IdentifiedDataSerializableFactory.FACTORY_ID, new IdentifiedDataSerializableFactory());
    client = hazelcastFactory.newHazelcastClient(clientConfig);
    String name = "rb-" + randomString();
    serverRingbuffer = server.getRingbuffer(name);
    clientRingbuffer = client.getRingbuffer(name);
}
Also used : IdentifiedDataSerializableFactory(com.hazelcast.client.test.IdentifiedDataSerializableFactory) RingbufferConfig(com.hazelcast.config.RingbufferConfig) ClientConfig(com.hazelcast.client.config.ClientConfig) Config(com.hazelcast.config.Config) RingbufferConfig(com.hazelcast.config.RingbufferConfig) ClientConfig(com.hazelcast.client.config.ClientConfig) Before(org.junit.Before)

Aggregations

ClientConfig (com.hazelcast.client.config.ClientConfig)1 IdentifiedDataSerializableFactory (com.hazelcast.client.test.IdentifiedDataSerializableFactory)1 Config (com.hazelcast.config.Config)1 RingbufferConfig (com.hazelcast.config.RingbufferConfig)1 Before (org.junit.Before)1