Search in sources :

Example 61 with ClientConfig

use of com.hazelcast.client.config.ClientConfig in project hazelcast by hazelcast.

the class AbstractListenersOnReconnectTest method testTemporaryBlockedNoDisconnectionSmartRouting.

//-------------------------- testListenersTemporaryNetworkBlockage --------------------- //
@Test
public void testTemporaryBlockedNoDisconnectionSmartRouting() {
    factory.newHazelcastInstance();
    ClientConfig clientConfig = getSmartClientConfig(4, 1);
    client = factory.newHazelcastClient(clientConfig);
    testListenersTemporaryNetworkBlockage();
}
Also used : ClientConfig(com.hazelcast.client.config.ClientConfig) Test(org.junit.Test)

Example 62 with ClientConfig

use of com.hazelcast.client.config.ClientConfig in project hazelcast by hazelcast.

the class AbstractListenersOnReconnectTest method testListenersSmartRoutingTerminateRandomNode.

@Test
public void testListenersSmartRoutingTerminateRandomNode() {
    factory.newInstances(null, 3);
    ClientConfig clientConfig = getSmartClientConfig();
    client = factory.newHazelcastClient(clientConfig);
    testListenersTerminateRandomNode();
}
Also used : ClientConfig(com.hazelcast.client.config.ClientConfig) Test(org.junit.Test)

Example 63 with ClientConfig

use of com.hazelcast.client.config.ClientConfig in project hazelcast by hazelcast.

the class AbstractListenersOnReconnectTest method testClusterReconnectMultipleServerDueToHeartbeatNonSmartRouting.

@Test
public void testClusterReconnectMultipleServerDueToHeartbeatNonSmartRouting() {
    factory.newInstances(null, 3);
    ClientConfig clientConfig = getNonSmartClientConfig(4, 1);
    client = factory.newHazelcastClient(clientConfig);
    testListenersHeartbeatTimeoutToOwner();
}
Also used : ClientConfig(com.hazelcast.client.config.ClientConfig) Test(org.junit.Test)

Example 64 with ClientConfig

use of com.hazelcast.client.config.ClientConfig in project hazelcast by hazelcast.

the class AbstractListenersOnReconnectTest method testClusterReconnectDueToHeartbeatNonSmartRouting.

@Test
public void testClusterReconnectDueToHeartbeatNonSmartRouting() {
    factory.newHazelcastInstance();
    ClientConfig clientConfig = getNonSmartClientConfig(4, 1);
    client = factory.newHazelcastClient(clientConfig);
    testListenersHeartbeatTimeoutToOwner();
}
Also used : ClientConfig(com.hazelcast.client.config.ClientConfig) Test(org.junit.Test)

Example 65 with ClientConfig

use of com.hazelcast.client.config.ClientConfig in project hazelcast by hazelcast.

the class ClientMapNearCacheBasicTest method createContext.

@Override
protected <K, V> NearCacheTestContext<K, V, Data, String> createContext() {
    ClientConfig clientConfig = getClientConfig().addNearCacheConfig(nearCacheConfig);
    HazelcastInstance member = hazelcastFactory.newHazelcastInstance(getConfig());
    HazelcastClientProxy client = (HazelcastClientProxy) hazelcastFactory.newHazelcastClient(clientConfig);
    IMap<K, V> memberMap = member.getMap(DEFAULT_NEAR_CACHE_NAME);
    IMap<K, V> clientMap = client.getMap(DEFAULT_NEAR_CACHE_NAME);
    NearCacheManager nearCacheManager = client.client.getNearCacheManager();
    NearCache<Data, String> nearCache = nearCacheManager.getNearCache(DEFAULT_NEAR_CACHE_NAME);
    return new NearCacheTestContext<K, V, Data, String>(client.getSerializationService(), client, member, new IMapDataStructureAdapter<K, V>(clientMap), new IMapDataStructureAdapter<K, V>(memberMap), false, nearCache, nearCacheManager);
}
Also used : NearCacheTestContext(com.hazelcast.internal.nearcache.NearCacheTestContext) HazelcastInstance(com.hazelcast.core.HazelcastInstance) NearCacheManager(com.hazelcast.internal.nearcache.NearCacheManager) Data(com.hazelcast.nio.serialization.Data) ClientConfig(com.hazelcast.client.config.ClientConfig) HazelcastClientProxy(com.hazelcast.client.impl.HazelcastClientProxy)

Aggregations

ClientConfig (com.hazelcast.client.config.ClientConfig)214 Test (org.junit.Test)129 HazelcastInstance (com.hazelcast.core.HazelcastInstance)110 QuickTest (com.hazelcast.test.annotation.QuickTest)107 ParallelTest (com.hazelcast.test.annotation.ParallelTest)81 Config (com.hazelcast.config.Config)45 NearCacheConfig (com.hazelcast.config.NearCacheConfig)32 NightlyTest (com.hazelcast.test.annotation.NightlyTest)32 CountDownLatch (java.util.concurrent.CountDownLatch)25 AssertTask (com.hazelcast.test.AssertTask)20 Before (org.junit.Before)20 HazelcastClientProxy (com.hazelcast.client.impl.HazelcastClientProxy)16 ClientNetworkConfig (com.hazelcast.client.config.ClientNetworkConfig)15 HazelcastClientCachingProvider (com.hazelcast.client.cache.impl.HazelcastClientCachingProvider)13 CachingProvider (javax.cache.spi.CachingProvider)13 IMap (com.hazelcast.core.IMap)12 LifecycleListener (com.hazelcast.core.LifecycleListener)12 LifecycleEvent (com.hazelcast.core.LifecycleEvent)11 Data (com.hazelcast.nio.serialization.Data)11 NearCacheManager (com.hazelcast.internal.nearcache.NearCacheManager)10