use of com.hazelcast.config.CacheSimpleConfig in project hazelcast by hazelcast.
the class DynamicConfigTest method testSameCacheConfig_canBeAddedTwice.
@Test
public void testSameCacheConfig_canBeAddedTwice() {
CacheSimpleConfig config = new CacheSimpleConfig().setName(name).setBackupCount(NON_DEFAULT_BACKUP_COUNT);
driver.getConfig().addCacheConfig(config);
driver.getCacheManager().getCache(name);
driver.getConfig().addCacheConfig(config);
}
use of com.hazelcast.config.CacheSimpleConfig in project hazelcast by hazelcast.
the class PhoneHomeIntegrationTest method testCacheMetrics.
@Test
public void testCacheMetrics() {
CachingProvider cachingProvider = createServerCachingProvider(node.hazelcastInstance);
CacheManager cacheManager = cachingProvider.getCacheManager();
CacheSimpleConfig cacheSimpleConfig = new CacheSimpleConfig();
cacheSimpleConfig.setName("hazelcast");
cacheSimpleConfig.setWanReplicationRef(new WanReplicationRef());
cacheManager.createCache("hazelcast", new CacheConfig<>("hazelcast"));
node.getConfig().addCacheConfig(cacheSimpleConfig);
phoneHome.phoneHome(false);
verify(1, postRequestedFor(urlPathEqualTo("/ping")).withRequestBody(containingParam("cact", "1")).withRequestBody(containingParam("cawact", "1")));
}
use of com.hazelcast.config.CacheSimpleConfig in project hazelcast by hazelcast.
the class SinksTest method setUp.
@BeforeClass
public static void setUp() {
Config config = new Config();
config.setClusterName(randomName());
config.addCacheConfig(new CacheSimpleConfig().setName("*"));
remoteHz = createRemoteCluster(config, 2).get(0);
clientConfig = getClientConfigForRemoteCluster(remoteHz);
}
use of com.hazelcast.config.CacheSimpleConfig in project hazelcast by hazelcast.
the class AbstractSplitBrainProtectionTest method newCacheConfig.
protected static CacheSimpleConfig newCacheConfig(SplitBrainProtectionOn splitBrainProtectionOn, String splitBrainProtectionName) {
CacheSimpleConfig config = new CacheSimpleConfig();
config.setName(CACHE_NAME + splitBrainProtectionOn.name());
config.setSplitBrainProtectionName(splitBrainProtectionName);
return config;
}
use of com.hazelcast.config.CacheSimpleConfig in project hazelcast by hazelcast.
the class AbstractCacheService method findCacheConfig.
@Override
public CacheConfig findCacheConfig(String simpleName) {
if (simpleName == null) {
return null;
}
CacheSimpleConfig cacheSimpleConfig = nodeEngine.getConfig().findCacheConfigOrNull(simpleName);
if (cacheSimpleConfig == null) {
return null;
}
try {
// Set name explicitly, because found config might have a wildcard name.
CacheConfig cacheConfig = new CacheConfig(cacheSimpleConfig).setName(simpleName);
CacheConfigAccessor.setSerializationService(cacheConfig, nodeEngine.getSerializationService());
return cacheConfig;
} catch (Exception e) {
throw new CacheException(e);
}
}
Aggregations