Search in sources :

Example 21 with WanReplicationRef

use of com.hazelcast.config.WanReplicationRef 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 22 with WanReplicationRef

use of com.hazelcast.config.WanReplicationRef in project hazelcast by hazelcast.

the class WanReplicationConfigurationTest method getConfig.

@Override
protected Config getConfig() {
    if (!isWanReplicationEnabled) {
        return super.getConfig();
    }
    WanCustomPublisherConfig wanCustomPublisherConfig = new WanCustomPublisherConfig().setPublisherId("dummyPublisherId").setClassName(WanDummyPublisher.class.getName());
    WanReplicationConfig wanReplicationConfig = new WanReplicationConfig().setName("dummyWan").addCustomPublisherConfig(wanCustomPublisherConfig);
    WanReplicationRef wanRef = new WanReplicationRef().setName("dummyWan").setRepublishingEnabled(isWanRepublishingEnabled).setMergePolicyClassName(PassThroughMergePolicy.class.getName());
    MapConfig mapConfig = new MapConfig("default").setWanReplicationRef(wanRef);
    return super.getConfig().addWanReplicationConfig(wanReplicationConfig).addMapConfig(mapConfig);
}
Also used : WanReplicationConfig(com.hazelcast.config.WanReplicationConfig) PassThroughMergePolicy(com.hazelcast.spi.merge.PassThroughMergePolicy) WanReplicationRef(com.hazelcast.config.WanReplicationRef) WanCustomPublisherConfig(com.hazelcast.config.WanCustomPublisherConfig) MapConfig(com.hazelcast.config.MapConfig)

Example 23 with WanReplicationRef

use of com.hazelcast.config.WanReplicationRef in project hazelcast by hazelcast.

the class WanReplicationConfigurationTest method testWanReplicationAndNoWanRepublishing.

@Test
public void testWanReplicationAndNoWanRepublishing() {
    isWanReplicationEnabled = true;
    isWanRepublishingEnabled = false;
    initInstanceAndMapContainer("withWanReplicationOnly");
    assertTrue(mapContainer.isWanReplicationEnabled());
    assertFalse(mapContainer.isWanRepublishingEnabled());
    assertNotNull(mapContainer.getWanReplicationDelegate());
    assertNotNull(mapContainer.getWanMergePolicy());
    WanReplicationRef wanReplicationRef = mapContainer.getMapConfig().getWanReplicationRef();
    assertNotNull(wanReplicationRef);
    assertEquals(mapContainer.getWanMergePolicy().getClass().getName(), wanReplicationRef.getMergePolicyClassName());
    assertFalse(wanReplicationRef.isRepublishingEnabled());
}
Also used : WanReplicationRef(com.hazelcast.config.WanReplicationRef) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 24 with WanReplicationRef

use of com.hazelcast.config.WanReplicationRef in project hazelcast by hazelcast.

the class WanCustomPublisherMapTest method getConfig.

@Override
protected Config getConfig() {
    WanReplicationConfig wanReplicationConfig = new WanReplicationConfig().setName("dummyWan").addCustomPublisherConfig(getPublisherConfig());
    WanReplicationRef wanRef = new WanReplicationRef().setName("dummyWan").setMergePolicyClassName(PassThroughMergePolicy.class.getName());
    MapConfig mapConfig = new MapConfig("default").setInMemoryFormat(inMemoryFormat).setWanReplicationRef(wanRef);
    return smallInstanceConfig().addWanReplicationConfig(wanReplicationConfig).addMapConfig(mapConfig);
}
Also used : WanReplicationConfig(com.hazelcast.config.WanReplicationConfig) PassThroughMergePolicy(com.hazelcast.spi.merge.PassThroughMergePolicy) WanReplicationRef(com.hazelcast.config.WanReplicationRef) MapConfig(com.hazelcast.config.MapConfig)

Aggregations

WanReplicationRef (com.hazelcast.config.WanReplicationRef)24 MapConfig (com.hazelcast.config.MapConfig)10 WanReplicationConfig (com.hazelcast.config.WanReplicationConfig)9 QuickTest (com.hazelcast.test.annotation.QuickTest)9 Test (org.junit.Test)9 CacheSimpleConfig (com.hazelcast.config.CacheSimpleConfig)6 EventJournalConfig (com.hazelcast.config.EventJournalConfig)6 Config (com.hazelcast.config.Config)5 IndexConfig (com.hazelcast.config.IndexConfig)5 WanCustomPublisherConfig (com.hazelcast.config.WanCustomPublisherConfig)5 AttributeConfig (com.hazelcast.config.AttributeConfig)4 EvictionConfig (com.hazelcast.config.EvictionConfig)4 HotRestartConfig (com.hazelcast.config.HotRestartConfig)4 QueryCacheConfig (com.hazelcast.config.QueryCacheConfig)4 WanConsumerConfig (com.hazelcast.config.WanConsumerConfig)4 PassThroughMergePolicy (com.hazelcast.spi.merge.PassThroughMergePolicy)4 EntryListenerConfig (com.hazelcast.config.EntryListenerConfig)3 MapPartitionLostListenerConfig (com.hazelcast.config.MapPartitionLostListenerConfig)3 MapStoreConfig (com.hazelcast.config.MapStoreConfig)3 MultiMapConfig (com.hazelcast.config.MultiMapConfig)3