Search in sources :

Example 21 with HazelcastServerCachingProvider

use of com.hazelcast.cache.impl.HazelcastServerCachingProvider in project hazelcast by hazelcast.

the class CacheConfigTest method testEntryListenerFactoryFromSimpleCacheConfig.

@Test
public void testEntryListenerFactoryFromSimpleCacheConfig() {
    String cacheName = randomString();
    Config config = createConfig(cacheName);
    HazelcastInstance instance = createHazelcastInstance(config);
    HazelcastServerCachingProvider cachingProvider = createServerCachingProvider(instance);
    CacheManager cacheManager = cachingProvider.getCacheManager();
    Cache<Object, Object> cache = cacheManager.getCache(cacheName);
    EntryListener.latch = new CountDownLatch(1);
    cache.put(randomString(), randomString());
    assertOpenEventually(EntryListener.latch);
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) TimedExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.TimedExpiryPolicyFactoryConfig) DurationConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.DurationConfig) ExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig) HazelcastCacheManager(com.hazelcast.cache.HazelcastCacheManager) CacheManager(javax.cache.CacheManager) HazelcastServerCacheManager(com.hazelcast.cache.impl.HazelcastServerCacheManager) CountDownLatch(java.util.concurrent.CountDownLatch) HazelcastServerCachingProvider(com.hazelcast.cache.impl.HazelcastServerCachingProvider) Test(org.junit.Test) SlowTest(com.hazelcast.test.annotation.SlowTest)

Aggregations

HazelcastServerCachingProvider (com.hazelcast.cache.impl.HazelcastServerCachingProvider)21 HazelcastInstance (com.hazelcast.core.HazelcastInstance)16 Test (org.junit.Test)16 QuickTest (com.hazelcast.test.annotation.QuickTest)11 CacheManager (javax.cache.CacheManager)10 CacheConfig (com.hazelcast.config.CacheConfig)8 Config (com.hazelcast.config.Config)8 CountDownLatch (java.util.concurrent.CountDownLatch)7 CacheSimpleConfig (com.hazelcast.config.CacheSimpleConfig)6 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)6 QuorumConfig (com.hazelcast.config.QuorumConfig)5 QuorumListenerConfig (com.hazelcast.config.QuorumListenerConfig)5 SlowTest (com.hazelcast.test.annotation.SlowTest)5 CacheTestSupport.createClientCachingProvider (com.hazelcast.cache.CacheTestSupport.createClientCachingProvider)4 CacheTestSupport.createServerCachingProvider (com.hazelcast.cache.CacheTestSupport.createServerCachingProvider)4 QuorumEvent (com.hazelcast.quorum.QuorumEvent)4 QuorumException (com.hazelcast.quorum.QuorumException)4 QuorumListener (com.hazelcast.quorum.QuorumListener)4 AssertTask (com.hazelcast.test.AssertTask)4 TestHazelcastInstanceFactory (com.hazelcast.test.TestHazelcastInstanceFactory)4