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")));
}
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);
}
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());
}
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);
}
Aggregations