Search in sources :

Example 66 with CacheSimpleConfig

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);
}
Also used : CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 67 with CacheSimpleConfig

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")));
}
Also used : CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) WanReplicationRef(com.hazelcast.config.WanReplicationRef) CacheManager(javax.cache.CacheManager) CacheTestSupport.createServerCachingProvider(com.hazelcast.cache.CacheTestSupport.createServerCachingProvider) CachingProvider(javax.cache.spi.CachingProvider) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 68 with CacheSimpleConfig

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);
}
Also used : CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) MapConfig(com.hazelcast.config.MapConfig) PartitioningStrategyConfig(com.hazelcast.config.PartitioningStrategyConfig) ClientConfig(com.hazelcast.client.config.ClientConfig) Config(com.hazelcast.config.Config) BeforeClass(org.junit.BeforeClass)

Example 69 with CacheSimpleConfig

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;
}
Also used : CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig)

Example 70 with CacheSimpleConfig

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);
    }
}
Also used : CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) CacheException(javax.cache.CacheException) CacheConfig(com.hazelcast.config.CacheConfig) ConfigValidator.checkCacheConfig(com.hazelcast.internal.config.ConfigValidator.checkCacheConfig) PreJoinCacheConfig.asCacheConfig(com.hazelcast.cache.impl.PreJoinCacheConfig.asCacheConfig) CacheNotExistsException(com.hazelcast.cache.CacheNotExistsException) CacheException(javax.cache.CacheException)

Aggregations

CacheSimpleConfig (com.hazelcast.config.CacheSimpleConfig)84 Test (org.junit.Test)41 Config (com.hazelcast.config.Config)40 QuickTest (com.hazelcast.test.annotation.QuickTest)37 EvictionConfig (com.hazelcast.config.EvictionConfig)17 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)17 BeforeClass (org.junit.BeforeClass)16 CachePartitionLostListenerConfig (com.hazelcast.config.CachePartitionLostListenerConfig)15 MapConfig (com.hazelcast.config.MapConfig)11 ClientConfig (com.hazelcast.client.config.ClientConfig)10 EventJournalConfig (com.hazelcast.config.EventJournalConfig)10 MergePolicyConfig (com.hazelcast.config.MergePolicyConfig)10 HazelcastInstance (com.hazelcast.core.HazelcastInstance)10 ExpiryPolicyFactoryConfig (com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig)9 QuorumConfig (com.hazelcast.config.QuorumConfig)9 CacheConfig (com.hazelcast.config.CacheConfig)8 TimedExpiryPolicyFactoryConfig (com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.TimedExpiryPolicyFactoryConfig)8 QueueConfig (com.hazelcast.config.QueueConfig)8 CacheSimpleEntryListenerConfig (com.hazelcast.config.CacheSimpleEntryListenerConfig)7 CardinalityEstimatorConfig (com.hazelcast.config.CardinalityEstimatorConfig)7