use of com.hazelcast.client.config.ClientConfig in project hazelcast by hazelcast.
the class InvalidationMetadataDistortionTest method createClientConfig.
protected ClientConfig createClientConfig() {
ClientConfig clientConfig = new ClientConfig();
clientConfig.setProperty("hazelcast.invalidation.max.tolerated.miss.count", "0");
return clientConfig;
}
use of com.hazelcast.client.config.ClientConfig in project hazelcast by hazelcast.
the class ClientCacheThroughHazelcastInstanceTest method createInstance.
@Override
protected HazelcastInstance createInstance(Config config) {
if (instanceFactory != null) {
throw new IllegalStateException("There should not be multiple creation of TestHazelcastFactory!");
}
instanceFactory = new TestHazelcastFactory();
ownerInstance = instanceFactory.newHazelcastInstance(config);
if (config.getClassLoader() != null) {
final ClassLoader tccl = Thread.currentThread().getContextClassLoader();
try {
ClientConfig clientConfig = new ClientConfig();
clientConfig.setClassLoader(config.getClassLoader());
Thread.currentThread().setContextClassLoader(config.getClassLoader());
return instanceFactory.newHazelcastClient(clientConfig);
} finally {
Thread.currentThread().setContextClassLoader(tccl);
}
} else {
return instanceFactory.newHazelcastClient();
}
}
use of com.hazelcast.client.config.ClientConfig in project hazelcast by hazelcast.
the class ClientCacheNearCacheBasicTest method createContext.
@Override
protected <K, V> com.hazelcast.internal.nearcache.NearCacheTestContext<K, V, Data, String> createContext() {
ClientConfig clientConfig = getClientConfig().addNearCacheConfig(nearCacheConfig);
CacheConfig<K, V> cacheConfig = createCacheConfig(nearCacheConfig);
HazelcastInstance member = hazelcastFactory.newHazelcastInstance(getConfig());
HazelcastClientProxy client = (HazelcastClientProxy) hazelcastFactory.newHazelcastClient(clientConfig);
CachingProvider memberProvider = HazelcastServerCachingProvider.createCachingProvider(member);
HazelcastServerCacheManager memberCacheManager = (HazelcastServerCacheManager) memberProvider.getCacheManager();
NearCacheManager nearCacheManager = client.client.getNearCacheManager();
CachingProvider provider = HazelcastClientCachingProvider.createCachingProvider(client);
HazelcastClientCacheManager cacheManager = (HazelcastClientCacheManager) provider.getCacheManager();
String cacheNameWithPrefix = cacheManager.getCacheNameWithPrefix(DEFAULT_NEAR_CACHE_NAME);
ICache<K, V> clientCache = cacheManager.createCache(DEFAULT_NEAR_CACHE_NAME, cacheConfig);
ICache<K, V> memberCache = memberCacheManager.createCache(DEFAULT_NEAR_CACHE_NAME, cacheConfig);
NearCache<Data, String> nearCache = nearCacheManager.getNearCache(cacheNameWithPrefix);
return new NearCacheTestContext<K, V, Data, String>(client.getSerializationService(), client, member, new ICacheDataStructureAdapter<K, V>(clientCache), new ICacheDataStructureAdapter<K, V>(memberCache), false, nearCache, nearCacheManager, cacheManager, memberCacheManager);
}
use of com.hazelcast.client.config.ClientConfig in project hazelcast by hazelcast.
the class ClientCachePutAllTest method onSetup.
@Override
protected void onSetup() {
super.onSetup();
ClientConfig clientConfig = createClientConfig();
client = clientFactory.newHazelcastClient(clientConfig);
}
use of com.hazelcast.client.config.ClientConfig in project hazelcast by hazelcast.
the class ClientCachingProviderTest method createHazelcastInstance.
@Override
protected HazelcastInstance createHazelcastInstance(String instanceName) {
// Since `HazelcastClient.getHazelcastClientByName(instanceName);` doesn't work on mock client,
// we are using real instances.
ClientConfig clientConfig = new ClientConfig();
clientConfig.setInstanceName(instanceName);
clientConfig.getGroupConfig().setName("test-group1");
clientConfig.getGroupConfig().setPassword("test-pass1");
HazelcastInstance instance = HazelcastClient.newHazelcastClient(clientConfig);
instances.add(instance);
return instance;
}
Aggregations