Search in sources :

Example 51 with ClientConfig

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

the class ClientExecutionPoolSizeLowTest method setup.

@Before
public void setup() throws IOException {
    server1 = hazelcastFactory.newHazelcastInstance();
    server2 = hazelcastFactory.newHazelcastInstance();
    ClientConfig clientConfig = new ClientConfig();
    clientConfig.setExecutorPoolSize(1);
    clientConfig.getNetworkConfig().setRedoOperation(true);
    HazelcastInstance client = hazelcastFactory.newHazelcastClient(clientConfig);
    map = client.getMap(randomString());
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) ClientConfig(com.hazelcast.client.config.ClientConfig) Before(org.junit.Before)

Example 52 with ClientConfig

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

the class AbstractListenersOnReconnectTest method testTemporaryBlockedNoDisconnectionMultipleServerNonSmartRouting.

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

Example 53 with ClientConfig

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

the class AbstractListenersOnReconnectTest method testListenersSmartRouting.

@Test
public void testListenersSmartRouting() {
    factory.newHazelcastInstance();
    ClientConfig clientConfig = getSmartClientConfig();
    client = factory.newHazelcastClient(clientConfig);
    testListenersTerminateOwnerNode();
}
Also used : ClientConfig(com.hazelcast.client.config.ClientConfig) Test(org.junit.Test)

Example 54 with ClientConfig

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

the class ClientRandomLBTest method testRandomLB_withMembers.

@Test
public void testRandomLB_withMembers() {
    RandomLB randomLB = new RandomLB();
    TestHazelcastInstanceFactory factory = new TestHazelcastInstanceFactory();
    HazelcastInstance server = factory.newHazelcastInstance();
    Cluster cluster = server.getCluster();
    ClientConfig clientConfig = new ClientConfig();
    clientConfig.setLoadBalancer(randomLB);
    randomLB.init(cluster, clientConfig);
    Member member = cluster.getLocalMember();
    Member nextMember = randomLB.next();
    assertEquals(member, nextMember);
    factory.terminateAll();
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) Cluster(com.hazelcast.core.Cluster) ClientConfig(com.hazelcast.client.config.ClientConfig) TestHazelcastInstanceFactory(com.hazelcast.test.TestHazelcastInstanceFactory) Member(com.hazelcast.core.Member) RandomLB(com.hazelcast.client.util.RandomLB) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 55 with ClientConfig

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

the class AbstractListenersOnReconnectTest method testClusterReconnectMultipleServersDueToHeartbeatSmartRouting.

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

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